Hex to Nearest CSS Named Color

Find the closest CSS named color to any hex value

Ad placeholder (leaderboard)

Find the nearest CSS named color

Given any hex color, this tool finds the single closest CSS named color and tells you exactly how close it is. It is the reverse of a name-to-hex lookup: useful when a design hands you a raw hex and you want a readable keyword, or when you are debugging why a named color does not quite match a comp. The match uses perceptual distance, not naive RGB math, so the result actually looks right.

How it works

Both your input color and every CSS named color are converted from sRGB into CIE Lab. The path is sRGB to linear RGB (inverse gamma), linear RGB to CIE XYZ via the D65 matrix, XYZ normalized against the D65 white point, then the standard Lab transform with its cube-root and linear segments. The tool then computes the CIE76 Delta-E — the straight-line distance between the two Lab points — for every named color and returns the smallest. Lab is used because Euclidean distance in it tracks perceived difference, which raw RGB distance does not.

Example and tips

The hex #6a4f9e resolves to a nearest match near mediumpurple (#9370db) with a moderate Delta-E, telling you it is in the right family but not a clean match. Treat the Delta-E score as your confidence meter: under 2.3 is a genuinely close visual match, while a double-digit score means CSS simply has no name near your color and you should keep using the hex. For the exact reverse lookup, use the CSS Named Color to Hex tool.

Ad placeholder (rectangle)