Paste a hex code such as #6495ED and the finder returns its CSS keyword, cornflowerblue, with distance 0 because it is an exact match. Any other value gets the closest of the 148 named colors by straight-line RGB distance, plus the next five runners-up. You can also type a name to get its hex, or list every web color name.
About this tool
Front-end developers, designers and anyone reading a stylesheet often meet a value like #708090 and want a word for it, or the reverse: a keyword like slategray and its exact code. This finder covers both directions using only the 148 keywords browsers understand in CSS, so every name it returns can be pasted straight into a style rule. In Hex to name, it accepts 3- or 6-digit hex and rgb() notation, and reports the nearest keyword with its distance and five alternatives. Name to hex ignores spaces and capitals. The third mode lists the keywords, optionally narrowed to names containing a word like blue. One limit: the CSS list is small and patchy, so many values (deep teals, muted browns) have no near keyword at all, and the answer is then only the least-bad option.
How to use it
Pick a mode
Hex to name, Name to hex, or All web names.
Type a color
Enter #RGB, #RRGGBB or rgb(r, g, b); the leading # is optional.
Read the match
The headline is the keyword; Match says Exact or gives the RGB distance to it.
Copy a name
Each table row has a copy button beside the CSS name.
Examples
#6495ED to its name
Mode
Hex to name
Hex or RGB color
#6495ED
ResultColor: cornflowerblue
Reference: #6495ED
Match: Exact match
Input read as #6495ED = rgb(100, 149, 237).
Distance = √(ΔR² + ΔG² + ΔB²) to each of the 148 named colors.
Closest: cornflowerblue #6495ED at distance 0 (exact).
This hex value is exactly the CSS keyword cornflowerblue, so the match distance is zero.
Name read as "rebeccapurple" (spaces and capitals ignored).
CSS Color 4 defines rebeccapurple as #663399, which is rgb(102, 51, 153).
The table lists the five nearest other named colors.
Spaces and capitals are ignored, so Rebecca Purple finds the keyword added to CSS in 2014.
The full web color list
Mode
All web names
Names containing
ResultColor: 148 names
Reference: All CSS named colors
Match: 148 of 148
Filtered the 148 CSS Color 4 keywords by the text "": 148 match.
With no filter the table shows all 148 CSS keywords with hex and RGB values.
How it is calculated
distance = √((R₁−R₂)² + (G₁−G₂)² + (B₁−B₂)²), nearest name = keyword with the smallest distance
Each of the 148 keywords from the CSS Color Module Level 4 table is stored with its sRGB channels. Your value is read as three 0–255 channels; a short form like #69E doubles each digit to #6699EE. The tool measures straight-line distance in RGB space to every keyword and sorts them. Keywords sharing one value (gray and grey, aqua and cyan, fuchsia and magenta) are shown together. RGB distance is simple and repeatable but not perceptual: two pairs with the same distance can look more or less alike depending on hue, so treat distances above about 40 as a different color.
Brand or paint matching needs a Pantone or paint maker's fan deck, not CSS keywords.
Picking a color from a photo needs an eyedropper first; this finder starts from a code.
Common mistakes
Typing a 5-digit hex; only 3 or 6 hex digits are valid.
Assuming darkgray is darker than gray; in CSS it is lighter (#A9A9A9 versus #808080).
Reading the nearest keyword as an exact match when Match shows a distance.
Frequently asked questions
How do I convert a hex code to a color name?
Choose Hex to name and paste the code, with or without the #. The finder compares it with all 148 CSS keywords and shows the closest one. If the code is one of the defined values, such as #FF7F50 for coral, the Match line reads Exact match; otherwise it gives the RGB distance so you know how far off the name is.
What are the HTML web color names?
They are the 148 keywords CSS Color Module Level 4 defines, from aliceblue to yellowgreen, usable anywhere HTML or CSS takes a color. Sixteen come from early HTML (black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, aqua); the rest came from the X11 color list, plus rebeccapurple added in 2014.
Can I find a color name from an image?
Not directly: this finder reads a code, not a picture. Use any eyedropper (most browsers' developer tools or an image editor have one) to read the pixel's hex value, then paste it into Hex to name to get the nearest CSS keyword.
Can I get a color name from RGB values?
Yes. Type rgb(46, 139, 87) or simply 46, 139, 87 in Hex to name. Each channel must be 0 to 255. That example is exactly seagreen, so it shows Exact match with hex #2E8B57.
Which hex values have a CSS color name?
Only 139 distinct values do, because nine keywords are aliases: aqua and cyan, fuchsia and magenta, and seven gray/grey pairs share one code each. Switch to All web names to see every keyword with its hex and RGB value, or filter it, for example by gray, to see the alias pairs side by side.
Are web safe colors the same as web color names?
No. The old web-safe palette is 216 values built from the steps 00, 33, 66, 99, CC and FF on each channel. Named colors are a separate list of 148 keywords; some (black, white, red, blue, rebeccapurple #663399) happen to be web safe, but most, like cornflowerblue #6495ED, are not.
Can I use these names in CSS instead of hex?
Yes. Every keyword returned here is valid CSS, so color: steelblue; renders exactly like color: #4682B4; in every current browser. Keywords are case-insensitive, but they cannot contain spaces, so write lightgoldenrodyellow as one word.
Cite this tool
Using this tool in an assignment, article or report? Copy a citation, or a link for your website.