🔴

HEX ↔ RGB Converter

Convert colour values between HEX, RGB, HSL and CSS custom properties instantly. Free and runs entirely in your browser.

✓ Free forever✓ No signup✓ 100% private — runs in your browser

HEX ↔ RGB Converter

Convert between HEX, RGB, HSL, and CMYK color formats instantly.

HEX Input
rgb(124, 108, 255)
hsl(245, 100%, 71%)
cmyk(51%, 58%, 0%, 0%)
⇄
RGB Input
R (0–255)
G (0–255)
B (0–255)
#7c6cff
hsl(245, 100%, 71%)

Design tools, CSS and image editors all favour different colour notations, so converting between them is routine. The values are equivalent — only the notation changes.

How to use the HEX ↔ RGB Converter

  1. Enter a colour in any supported format
  2. Read the equivalent values in the other formats
  3. Copy the one you need

How HEX maps to RGB

A HEX colour is three pairs of hexadecimal digits, one per channel, each running from 00 to FF — that is 0 to 255 in decimal.

#7C6CFF
  7C → 124  (red)
  6C → 108  (green)
  FF → 255  (blue)

→ rgb(124, 108, 255)

The three-digit shorthand doubles each digit: #f0a expands to #ff00aa. It only works when both digits of every pair match, which is why not every colour has a shorthand.

Useful values to recognise

  • #000000 black · #FFFFFF white
  • #FF0000 pure red · #00FF00 pure green · #0000FF pure blue
  • Equal values in all three channels always give a neutral grey — #808080 is mid grey.

That last rule is a quick sanity check: if a colour is meant to be neutral and the three channel values differ, it has a colour cast.

Frequently asked questions

Is HEX more precise than RGB?

No, they are identical. Both describe each channel with 8 bits — 256 levels. HEX is just a shorter way of writing the same numbers.

How does the three-digit shorthand work?

Each digit is doubled: #f0a becomes #ff00aa. It only works when both digits in every pair are the same, so most colours have no shorthand form.

What is HSL better for?

Manipulation. Making a colour darker, lighter or less saturated is a single-number change in HSL, and guesswork in HEX. For generating palettes it is much easier to reason about.

Can I convert to CMYK?

Not here. CMYK is for print and depends on the specific inks, paper and colour profile, so an accurate conversion needs those parameters rather than a formula.