CSS Color Reference

Browse every CSS named colour sorted by hue, search them, and find the nearest name for any colour you have.

All CSS named colors, sorted by hue. Click any card to copy its name; click the hex to copy the hex. Every gray also accepts the grey spelling.

darkgray is lighter than gray

That is not a typo, and it is not the only one. The 148 names look like a designed set — a base name with dark and light variants either side — but they are an accumulation of X11 window-system colours from the 1980s, with prefixes applied by different people at different times and no rule connecting them.

NameHexRelative luminance
dimgray #696969 0.1413
gray #808080 0.2159
darkgray #a9a9a9 0.3968
silver #c0c0c0 0.5271
lightgray #d3d3d3 0.6514
gainsboro #dcdcdc 0.7157

Sorted by actual brightness, darkgray sits above gray — it is almost twice as luminous. Both names are correct in the sense that every browser agrees on them, and neither is correct in the sense of meaning what it says.

Across the whole list, 23 base names have a dark or a light sibling and 6 of those rows break the expected ordering — coral, gray, grey, pink, salmon, seagreen — which is 26%. Two of the six are the same colour under two spellings, so it is 5 distinct colours rather than 6; both numbers are worth having rather than whichever reads better.

And the failures go both ways. darkgray</code>, <code>darkgrey</code>, <code>darksalmon</code>, <code>darkseagreen are all lighter than their base; lightcoral</code>, <code>lightpink are darker than theirs. Most families do behave, which is the point — the prefixes are not backwards, they are simply not a system.

Nine of the names are aliases

148 names resolve to 139 distinct colours, so 9 of them are duplicates:

HexNames
#00ffff aqua, cyan
#a9a9a9 darkgray, darkgrey
#2f4f4f darkslategray, darkslategrey
#696969 dimgray, dimgrey
#ff00ff fuchsia, magenta
#808080 gray, grey
#d3d3d3 lightgray, lightgrey
#778899 lightslategray, lightslategrey
#708090 slategray, slategrey

Seven are the gray/grey spelling pairs, which is a courtesy to two spellings of one word. The other 2 are not spelling at all: aqua and cyan are the same colour under different words, and so are fuchsia and magenta. Those exist because the names arrived from two different places — one set from the original sixteen HTML colours, one from the X11 list — and both were kept rather than either being dropped.

And green is not the greenest green

NameHexRelative luminance
darkgreen #006400 0.0911
green #008000 0.1544
limegreen #32cd32 0.4457
lime #00ff00 0.7152
springgreen #00ff7f 0.7305
lawngreen #7cfc00 0.7391

green is #008000, half brightness. The full-brightness one is lime, 4.6 times more luminous. There is no brightgreen, and "lime" sounds like a shade rather than the primary, so almost nobody reaches for it first.

It is the same historical seam. green came from the sixteen named colours of early HTML, where it meant the darker of two greens; lime came from X11. The result is that the most obvious name points at something two stops darker than the obvious colour, and every other green here except darkgreen is brighter than it.

Which gives the practical advice, and it is short: these names are for prototyping, not for a design system. They are not ordered, not complete and not consistent, and the ones you can safely reason about are black, white, red and blue.

How to use

  1. Browse by hue, or search by name.
  2. Paste a hex value to find the nearest name.
  3. Copy the name or the hex value.
  4. Check contrast before using one for text.

Frequently asked questions

How many named colours are there in CSS?

148, including the synonyms — grey and gray are both valid, and several colours have two spellings. They descend from the X11 colour list by way of early browser support, which is why the set is idiosyncratic rather than systematic.

Why are the names so strange?

Because they were never designed as a palette. The list inherited names from X11 in the 1980s, which themselves came from a paint catalogue, so it contains four shades of gray spelled two ways, several near-identical greens, and rebeccapurple — added in 2014 in memory of a web developer's daughter.

Are named colours worth using?

For quick prototyping and for readable code in small projects, yes. For anything designed, no — the set is arbitrary and does not form a coherent palette, so a deliberately chosen scale will look better and be far easier to keep consistent.

Is there a difference between grey and gray?

Only in spelling — both are valid CSS and identical in value. The exception is the confusing pair where darkgray is lighter than gray, which is an inherited quirk of the X11 list rather than anything sensible.

Can I rely on these rendering identically everywhere?

The values are exact and defined, so yes in terms of the colour specified. What varies is the display — an uncalibrated monitor, a wide-gamut screen or a phone with boosted saturation will render the same value differently.

How is the nearest name calculated?

By finding the smallest distance between your colour and each named one in a perceptual colour space, which matches human judgement far better than comparing raw channel values. Two colours can be numerically close and look quite different, which is exactly what perceptual spaces correct for.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.