HEX to RGB Converter

Convert hex color codes to RGB and HSL instantly, with a live preview and one-click copy.

Loading tool…

Convert HEX colors to RGB instantly

The HEX to RGB Converter turns any hexadecimal color code into its RGB and HSL equivalents in real time, with a live color preview and one-click copy. Type a hex value or use the color picker, and you immediately get rgb() and hsl() strings ready to paste into your CSS, design tool, or code. Everything runs in your browser, so it is instant and private.

What is a HEX color code?

A hex color code is a six-digit representation of a color used throughout web design, written as #RRGGBB. Each pair of characters is a hexadecimal number from 00 to FF (0–255 in decimal) describing the red, green, and blue channels. For example, #6d8bff means red 109, green 139, blue 255. Three-digit shorthand like #f80 is also valid and expands to #ff8800.

HEX vs RGB vs HSL

FormatExampleBest for
HEX#6d8bffCompact CSS, design handoff
RGBrgb(109, 139, 255)Opacity with rgba(), canvas, JS
HSLhsl(227, 100%, 71%)Intuitive tweaks to hue/saturation/lightness

How to use the converter

  1. Type a hex code into the field, or click the color swatch to pick visually.
  2. Read the RGB, HSL, and channel values instantly.
  3. Click the copy icon next to any format to grab it for your stylesheet.

Why convert between color formats?

Different tools and contexts prefer different formats. CSS accepts all three, but RGB is essential when you need transparency via rgba(), and HSL is the easiest format for programmatically generating lighter or darker shades by adjusting the lightness value. Designers often receive a brand palette in hex and need RGB for a presentation tool, or HSL to build a consistent set of tints. This converter bridges those formats without manual math.

A quick note on accessibility

When you choose text and background colors, check that they have enough contrast for readability. Converting to RGB or HSL is often the first step before running a contrast check, since contrast ratios are calculated from the relative luminance of the RGB channels. Pair this tool with a color contrast checker to make sure your palette meets accessibility standards.

Private and instant

All conversions happen locally in your browser using simple arithmetic, so there is no upload, no waiting, and nothing stored. Use it as often as you like, completely free.

Frequently asked questions

How do I convert HEX to RGB?

Split the six-digit hex code into three pairs and convert each pair from hexadecimal to decimal. For example, #6d8bff becomes rgb(109, 139, 255). This tool does it instantly.

Does it support 3-digit hex codes?

Yes. Shorthand like #f80 is automatically expanded to #ff8800 before conversion.

Can I also get HSL values?

Yes. Alongside RGB, the tool shows the equivalent HSL value, which is handy for creating tints and shades.

Is my color data sent anywhere?

No. All conversions happen in your browser. Nothing is uploaded or stored.