Skip to main content
CN

Color Name Finder

Find the closest CSS named colour for any hex code — top 5 matches ranked by RGB distance.

Did you like the tool? Thanks!
Share:

How to Use Color Name Finder

Type a hex code or use the colour picker, and the tool finds the 5 nearest CSS named colours from the full list of 148 standard names. Each match shows the name, hex value, a colour swatch, and the Euclidean RGB distance. An exact match highlights "Exact match!" with distance zero.

About Color Name Finder

The CSS specification defines 148 named colours — from `aliceblue` to `yellowgreen` — that can be used anywhere a CSS colour value is accepted. While modern web development tends to use hex codes or RGB functions, named colours remain useful: they are more readable in source code (`coral` is more self-documenting than `#FF7F50`), they are often used in teaching and documentation, and they provide a shared vocabulary for discussing colours across disciplines. But with 148 names, memorising all of them is not practical, and mentally mapping a colour you see on screen (or have as a hex value from a design tool) to the closest named colour is a surprisingly common need. The matching algorithm uses Euclidean distance in the RGB colour cube — the straight-line distance between two points in a three-dimensional space where each axis is a colour channel (red, green, blue) ranging from 0 to 255. The distance between two colours (R₁, G₁, B₁) and (R₂, G₂, B₂) is given by sqrt((R₁ - R₂)² + (G₁ - G₂)² + (B₁ - B₂)²). A smaller distance means the two colours are perceptually closer, although RGB distance is not a perfect model of human colour perception — two colours that are distant in RGB may look more similar to the eye than two colours that are closer, because the human visual system is more sensitive to differences in some hues and brightness levels than others. For a closer match to human perception, a colour space like CIELAB with its ΔE metric would be needed, but for a practical tool that runs instantly in the browser, Euclidean RGB distance is the right trade-off: it is fast to compute, produces sensible results for the vast majority of inputs, and requires no complex colour-space transformations beyond the initial hex-to-RGB parse. The full set of 148 CSS named colours is embedded directly in the widget's JavaScript — no network requests, no database lookups — so the matching is instantaneous and works offline. The 148 names include all the traditional HTML colours (`red`, `green`, `blue`, `white`, `black`, etc.), the X11 extended colour set (`coral`, `salmon`, `thistle`, etc.), and some newer additions introduced over various CSS specification revisions.

Details & Tips

Algorithm and data in detail: **Distance formula:** For each named colour in the 148-colour array, compute d = sqrt( (R_input - R_name)² + (G_input - G_name)² + (B_input - B_name)² ). Then sort the array by ascending distance and take the top 5. **Exact match detection:** If the distance equals 0 (i.e., all three channels match exactly), the result is flagged as an exact match. The UI shows "Exact match!" instead of a distance value for this entry. **Distance interpretation:** - 0: exact match - < 10: virtually indistinguishable - 10-30: very close, probably the same colour in a different naming scheme - 30-80: related but noticeably different - > 80: meaningfully different colours The maximum possible distance in a 255³ RGB cube is sqrt(255² + 255² + 255²) ≈ 441.67 (the diagonal of the cube from (0,0,0) to (255,255,255)). **Display:** The top 5 matches are shown as a vertical list, each row containing a colour swatch (a small coloured square), the CSS name in bold, the hex value in monospace font, and the distance value (or "Exact match!" for distance 0). The closest match (distance < 30) is highlighted with a subtle accent border. **Performance:** With 148 colours, computing 148 distances and sorting them is trivial — the entire operation takes well under 1 ms, so the results update live on every keystroke. **The 148 CSS named colours** included are: aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkgrey, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, green, greenyellow, grey, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgreen, lightgrey, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, rebeccapurple, red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen.

Frequently Asked Questions

How does the colour name finder work?
It converts your input hex code to RGB, then computes the Euclidean distance (in the RGB cube) to each of the 148 CSS named colours. The 5 closest matches are shown, ranked by distance.
What is Euclidean distance in RGB space?
It is the straight-line distance between two colour points in a 3D cube where the axes are Red, Green, and Blue (0-255 each): sqrt((R₁-R₂)² + (G₁-G₂)² + (B₁-B₂)²). Lower distance means colours are more similar.
What happens if my colour exactly matches a named colour?
The distance is 0 and the UI highlights "Exact match!" so you know it is a 100% match, not just a near-miss.
How many CSS named colours are there?
The CSS specification defines 148 named colours, from aliceblue to yellowgreen. This tool includes all 148 in its lookup table.
Is RGB distance a perfect measure of colour similarity?
No — RGB distance is a computational approximation. The human eye perceives colour differences non-uniformly (e.g., we are more sensitive to green than blue). For perceptually accurate colour difference, CIELAB ΔE would be needed, but RGB distance is fast and practical for most use cases.
What does a distance score mean?
Distance 0-10: virtually identical. 10-30: very close. 30-80: noticeably different but related. 80+: quite different colours. The maximum possible distance is approximately 442.
Can I type hex codes with or without the hash symbol?
Both work — the tool strips a leading # if present and validates the 6 hex digits.
Can I use the colour picker instead of typing?
Yes — a native `<input type="color">` picker is provided. Selecting a colour from the OS palette instantly finds the closest named colours.
Why are there only 5 matches shown?
Five is enough to show the closest match and a few runners-up for context. Showing all 148 would clutter the interface. If you need more, look at the distance scores — anything beyond the top 5 is generally too different to be useful.
What are named colours useful for?
CSS named colours are more readable in source code (coral vs #FF7F50), useful in education and documentation, and provide a shared vocabulary for discussing colours across design and development teams.
Does the tool work offline?
Yes — all 148 named colours are embedded directly in the widget's JavaScript. No network requests or database lookups are needed.
Is my data sent to a server?
No — colour matching runs entirely in your browser. Nothing is transmitted anywhere.

Part of These Collections

Also Available As

color name finder, hex to color name, css color name, find color name, closest color name, named colors, color match, rgb distance

Found a Problem?

Let us know if something with Color Name Finder isn't working as expected.

Thanks — we'll take a look.