Hex to CSS Color Name

Find the closest named CSS or X11 color for any hex color code

Please enter a valid hex color (e.g., #22C55E or 22C55E)

Top 5 Closest Matches

    How It Works

    This tool converts your hex color code into RGB values (Red, Green, Blue), then compares those values against all 147 named CSS and X11 colors. The comparison uses the Euclidean distance formula in RGB space: the straight-line distance between your color and each named color calculated as √((R₂−R₁)² + (G₂−G₁)² + (B₂−B₁)²). The named color with the smallest distance is reported as the closest match. A distance of zero means an exact match. The tool also shows the top 5 nearest colors so you can compare alternatives visually.

    Frequently Asked Questions

    What is the difference between CSS named colors and X11 colors?
    CSS named colors are the set of color keywords defined in the CSS Color specification. This includes the basic HTML color names (like red, blue, green), the extended X11/CSS3 color names (like coral, tomato, dodgerblue), and the full set of 147 standard named colors. X11 colors originated from the X Window System color database and were adopted into CSS3. Today they are essentially the same set — when we refer to "CSS color names" we include all X11/CSS3 named colors.
    How accurate is the closest color match?
    The match uses Euclidean distance in RGB color space, which is a mathematically precise way to measure how different two colors are based on their red, green, and blue components. However, human perception of color differences doesn't always align perfectly with RGB distance — two colors with the same mathematical distance may not look equally different to your eyes. For most practical purposes the closest match is visually very similar, especially when the distance value is low.
    Can I use hex color names directly in my CSS?
    Yes! Instead of using a hex code like #FF6347, you can use the named color keyword tomato directly in your CSS: color: tomato;. All modern browsers support the 147 standard named CSS colors. Named colors can make your code more readable, though they do limit you to a fixed palette compared to the full range of hex or RGB values.
    Free tools by TUNA — energy supply from vetted manufacturers