Skip to content
AZ Tools

Color Name Finder

Find the closest CSS, Tailwind, or XKCD-survey color name for any hex/RGB input — ranked by perceptual distance in OKLab color space.

Closest matches
  • dodgerblue
    #1e90ff · ΔE 0.0363
  • royalblue
    #4169e1 · ΔE 0.0668
  • cornflowerblue
    #6495ed · ΔE 0.0697
  • mediumslateblue
    #7b68ee · ΔE 0.0871
  • steelblue
    #4682b4 · ΔE 0.1011
  • mediumpurple
    #9370db · ΔE 0.1131
  • slateblue
    #6a5acd · ΔE 0.1140
  • lightslategray
    #778899 · ΔE 0.1564

Distance is OKLab Euclidean — perceptually uniform. Smaller is closer.

How to use

  1. Enter a hex (#3b82f6, 3b82f6, #36e), rgb(59, 130, 246), or use the color picker.
  2. Switch between CSS, Tailwind, and XKCD databases.
  3. Copy a name to use directly in your CSS or Tailwind config.

About this tool

Show

Give it a colour — hex, RGB or the picker — and it returns the eight closest named colours from three different vocabularies: the CSS named colours you can write directly in a stylesheet, the default Tailwind palette from slate-50 through rose-700, and the names from the XKCD colour survey, which asked a couple of hundred thousand people what they would call a swatch and kept the answers that agreed.

Distance is measured in OKLab rather than by comparing RGB values, and that choice is what makes the ranking usable. RGB is a storage format, not a model of vision: the straight-line distance from black to pure blue and from black to pure green is 255 in both cases, yet green is close to twice as bright to the eye. In OKLab those two land at lightness 0.45 and 0.87, which is what you actually see. A nearest-colour search in RGB will happily tell you that a dark saturated blue is the closest match to something that reads as nothing like it, because the arithmetic gave equal weight to a channel the eye barely notices and one it is exquisitely sensitive to.

The three vocabularies are useful for different reasons rather than being three attempts at the same list. The CSS names are the only ones you can type into a stylesheet and have work, and they are a historical accident — inherited from X11, full of duplicates like gray and grey and oddities like rebeccapurple, added in 2014 as a memorial. Tailwind's names tell you which token to reach for in a project already using it. The survey names are the ones ordinary speakers actually use, which is why they include things no standards body would ratify and why they are the right list when you are trying to describe a colour to a person rather than a compiler.

What a nearest name does not give you is a substitute. The closest CSS colour to a brand hex is closest, not equal, and swapping it in shifts the colour by however far the match was — fine for a sketch or a conversation, not for the logo.

Frequently asked questions

Why OKLab instead of RGB distance?

Pure RGB distance gives misleading rankings — a 10% brightness change in dark colors counts the same as in bright colors, but our eyes are much more sensitive to mid-tones. OKLab (released by Björn Ottosson in 2020) is calibrated for perceptual uniformity, so 'closest' really means 'looks most similar'.

What's the XKCD color survey?

In 2010, Randall Munroe ran a survey asking 222,500 people to name 5 random colors each. The most-agreed-upon names became a useful palette — sometimes used in data visualization libraries like matplotlib. Includes folksy names like 'puke green' and 'baby poop brown' (not in our top-60 subset).

Why only 8 results?

Beyond rank 8, distances grow large enough that 'closest' becomes meaningless. If you need a full sorted list, the algorithm is just OKLab Euclidean distance — easy to reproduce.

Can I use the closest name to communicate a colour?

As a label, yes; as a specification, no. Several distinct colours share a nearest name, and the name a person pictures when they read it is not the exact hex that produced it. Send the hex and offer the name as a description — the name is for talking about the colour, not for reproducing it.

Why do the XKCD names sometimes fit better than the CSS ones?

Because they came from what a large number of people actually called the colours they were shown, so the list is dense where human colour vocabulary is dense — many greens, many blues — and it uses compound names that describe rather than label. The CSS list is a small, arbitrary inheritance from X11, so a colour in a crowded region often has no close standard name at all.

Related tools