Hex to RGB
Nearest named colour: salmon
A hex colour is three bytes written in base 16, one per channel: #e07a5f is red 224, green 122, blue 95. This shows the RGB, HSL and OKLCH equivalents together, accepts any of the 148 CSS colour names typed in place of a code, names the nearest one back for any colour you set, and reports how the colour performs against white and black text.
How to use the hex to rgb
Converting by hand means reading each pair of digits as a hexadecimal number. Two variants are worth recognising: the three-digit shorthand where each digit is doubled, so #e75 means #ee7755, and the eight-digit form where the final pair is alpha. The shorthand only works when both digits of each pair happen to match, which is why most real colours cannot be written short. The field also takes a name, and the named colours are a historical accident worth understanding before relying on them. They came from the X11 window system by way of early Netscape and were never designed as a coherent set: darkgray is lighter than gray, gray and grey are the same colour spelled two ways, there are four greens nowhere near each other in the colour space, and the coverage is wildly uneven: dozens of blues and almost no browns. The one deliberate addition is rebeccapurple, #663399, added to CSS in 2014 in memory of Eric Meyer’s daughter. For prototyping a name is fine; for designed work use the exact value, because the names are arbitrary and rarely the colour you meant.
What people use it for
- Converting a hex code to RGB, HSL and OKLCH
- Looking up what a CSS colour name resolves to
- Finding which CSS colour name a hex code is closest to
- Expanding a three-digit shorthand or reading an alpha pair
- Checking a colour against white and black text before using it
- Lifting a colour off the screen with the eyedropper
- Reading a light-to-dark scale at the same hue
Questions
Read each pair of digits as a hexadecimal number. e0 is 224, 7a is 122, 5f is 95.
Yes. The field accepts any CSS colour name. Type orange and it resolves to #ffa500 with every other format alongside.
Yes, both directions work. Paste #e07a5f and the nearest named colour is printed under the sliders; salmon, in that case. It is the nearest by perceptual distance, not an exact match, and the search runs over a shortlist of 52 everyday names rather than all 148, because a nearest-name answer of lightgoldenrodyellow helps nobody.
Each digit is doubled; #e75 is #ee7755. It only works when both digits of each pair match.
The last two digits are alpha, from 00 fully transparent to ff fully opaque.
No. #E07A5F and #e07a5f are identical. Lowercase is the convention in CSS and uppercase in most design tools, and nothing anywhere cares.
In CSS, yes; without it the value is not a colour at all. Most other places accept the code bare, and the field here takes it either way.
That is what the RGB line does. If you are going the other way, starting from three channel values, the RGB to hex page sets out the rgb() syntax and the 0-to-1 float form that trips people up.
148, inherited from X11 and early Netscape rather than designed. They cover the colour space very unevenly.
A genuine inconsistency in the inherited set. Nobody reconciled them, and now nobody can without breaking pages.
Both work and resolve identically. CSS accepts either spelling for every grey-related name.
#663399, added to CSS in 2014 in memory of Eric Meyer’s daughter. The only named colour added deliberately rather than inherited.
For prototyping, fine. For designed work use exact values; the names are arbitrary and rarely the colour you meant.
Its lightness is perceptual, so two colours with the same L look equally light. HSL lightness does not work that way.
They are the WCAG ratios against white and black, with a pass or fail at AA for normal text. Checking a specific pair is the contrast checker’s job.
Hex is sRGB, which is a screen space. Converting to CMYK for print shifts saturated colours noticeably.