Find the closest Tailwind or Radix color to a given color value
Nearest Color Finder takes any color you provide and tells you the closest named token in a Tailwind CSS or Radix UI palette. This is useful when you want to stay within a design system but need to reconcile an arbitrary color with the nearest allowed equivalent. This can also help when migrating to newer Tailwind CSS versions, since the default color palette has changed significantly from v0 to v4 where it's at currently.
The tool supports five input formats (HEX, RGB, HSL, LAB, and OKLCH) and four distance algorithms. The algorithm you choose has a significant impact on which color is ranked closest, especially for edge cases like highly saturated colors, near-neutrals, and colors near the boundary between two palette families.
A color space is simply a system that translates colors into numbers. The color space you choose dictates how the tool determines the "distance" between two colors, and whether that math actually matches what human eyes see.
RGB: The native language of screens, mixing Red, Green, and Blue light. While it's great for computers, it's not ideal for human eyes. An equal numerical jump in RGB doesn't always look like an equal visual jump to us.
HEX: Uses the same exact color space as RGB. While RGB uses decimal numbers, HEX uses a hexadecimal shorthand.
HSL (Hue, Saturation, Lightness): A cylindrical remapping of RGB that is more intuitive for humans to think about. Adjusting hue rotates around a color wheel; adjusting saturation moves between gray and full color; adjusting lightness moves between black and white. But because it's built on top of RGB, it inherits the same flaws when trying to measure how similar two colors truly look.
CIELAB (L*a*b*): A color space defined by CIE in 1976 specifically to be perceptually uniform — meaning equal distances in the space should correspond to equal perceived color differences. It models colors using three axes: L* (lightness from black to white), a* (green to red), and b* (blue to yellow). It's the industry standard for accurate color matching.
OKLCH: The modern, improved version of CIELAB. It consists of three value — Lightness, Chroma, Hue — behaves more consistently and predictably than CIELAB when interpolating between certain colors. OKLCH is the cyclindrical counterpart of the Oklab color space which uses polar coordinates. This is the color space Tailwind CSS v4 adopted for its entire palette.
A distance algorithm defines the formula used to compute how far apart two colors are. Different algorithms make different tradeoffs between accuracy and complexity.
Euclidean RGB: The simplest approach: treat R, G, and B as coordinates in a cube and compute the straight-line distance between two points. It's rarely the right choice for design work. Because RGB doesn't match human vision, this formula might tell you two very different colors are a "close match."
Delta E CIE76: The first standardized perceptual color difference formula, published by CIE in 1976. It converts both colors to CIELAB and then computes a Euclidean distance in that space. Because CIELAB was designed to be perceptually uniform, this produces results that correlate much better with human judgment than RGB Euclidean distance. It's an improvement but it's known to have weaknesses in high-chroma blue regions and for large color differences.
Delta E CIEDE2000 (recommended default): The current industry-standard, published by CIE in 2000. It extends CIE76 with corrections for lightness, chroma, and hue — applying different weighting functions in regions where earlier formulas were known to diverge from human perception. It also includes a rotation term for the blue hue region, where CIELAB's uniformity breaks down. CIEDE2000 is the most computationally complex algorithm here but produces the results most consistent with how color differences are judged by human observers. If you aren't sure what to pick, use this.
OKLCH Euclidean: Computes Euclidean distance directly in OKLCH space. The best choice if you are specifically working with Tailwind v4. Since Tailwind v4 colors are natively defined in OKLCH, this formula will find matches that feel most natural and consistent within that specific design system.