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
- Enter a colour in any supported format
- Read the equivalent values in the other formats
- 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
#000000black ·#FFFFFFwhite#FF0000pure red ·#00FF00pure green ·#0000FFpure blue- Equal values in all three channels always give a neutral grey —
#808080is 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.