# Color Name Finder

> Turn a hex or RGB value into the nearest of the 148 CSS color names, look up a name's hex code, or browse the full web color names list.

Use it online (free, runs in your browser): https://directory.milunir.com/color-tools/color-pickers/color-name-finder/

Paste a hex code such as #6495ED and the finder returns its CSS keyword, cornflowerblue, with distance 0 because it is an exact match. Any other value gets the closest of the 148 named colors by straight-line RGB distance, plus the next five runners-up. You can also type a name to get its hex, or list every web color name.

Front-end developers, designers and anyone reading a stylesheet often meet a value like #708090 and want a word for it, or the reverse: a keyword like slategray and its exact code. This finder covers both directions using only the 148 keywords browsers understand in CSS, so every name it returns can be pasted straight into a style rule. In Hex to name, it accepts 3- or 6-digit hex and rgb() notation, and reports the nearest keyword with its distance and five alternatives. Name to hex ignores spaces and capitals. The third mode lists the keywords, optionally narrowed to names containing a word like blue. One limit: the CSS list is small and patchy, so many values (deep teals, muted browns) have no near keyword at all, and the answer is then only the least-bad option.

## How to use

1. **Pick a mode**: Hex to name, Name to hex, or All web names.
2. **Type a color**: Enter #RGB, #RRGGBB or rgb(r, g, b); the leading # is optional.
3. **Read the match**: The headline is the keyword; Match says Exact or gives the RGB distance to it.
4. **Copy a name**: Each table row has a copy button beside the CSS name.

## Examples

### #6495ED to its name

- Mode: Hex to name
- Hex or RGB color: #6495ED

Result: Color: cornflowerblue Reference: #6495ED Match: Exact match

This hex value is exactly the CSS keyword cornflowerblue, so the match distance is zero.

### rebeccapurple to hex

- Mode: Name to hex
- CSS color name: Rebecca Purple

Result: Color: #663399 Reference: rebeccapurple Match: rgb(102, 51, 153)

Spaces and capitals are ignored, so Rebecca Purple finds the keyword added to CSS in 2014.

### The full web color list

- Mode: All web names
- Names containing: 

Result: Color: 148 names Reference: All CSS named colors Match: 148 of 148

With no filter the table shows all 148 CSS keywords with hex and RGB values.

## How it works

`distance = √((R₁−R₂)² + (G₁−G₂)² + (B₁−B₂)²), nearest name = keyword with the smallest distance`

Each of the 148 keywords from the CSS Color Module Level 4 table is stored with its sRGB channels. Your value is read as three 0–255 channels; a short form like #69E doubles each digit to #6699EE. The tool measures straight-line distance in RGB space to every keyword and sorts them. Keywords sharing one value (gray and grey, aqua and cyan, fuchsia and magenta) are shown together. RGB distance is simple and repeatable but not perceptual: two pairs with the same distance can look more or less alike depending on hue, so treat distances above about 40 as a different color.

Sources:

- [CSS Color Module Level 4 – Named Colors](https://www.w3.org/TR/css-color-4/), W3C

## When not to use it

- Brand or paint matching needs a Pantone or paint maker's fan deck, not CSS keywords.
- Picking a color from a photo needs an eyedropper first; this finder starts from a code.

## Common mistakes

- Typing a 5-digit hex; only 3 or 6 hex digits are valid.
- Assuming darkgray is darker than gray; in CSS it is lighter (#A9A9A9 versus #808080).
- Reading the nearest keyword as an exact match when Match shows a distance.

## Questions

### How do I convert a hex code to a color name?

Choose Hex to name and paste the code, with or without the #. The finder compares it with all 148 CSS keywords and shows the closest one. If the code is one of the defined values, such as #FF7F50 for coral, the Match line reads Exact match; otherwise it gives the RGB distance so you know how far off the name is.

### What are the HTML web color names?

They are the 148 keywords CSS Color Module Level 4 defines, from aliceblue to yellowgreen, usable anywhere HTML or CSS takes a color. Sixteen come from early HTML (black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, aqua); the rest came from the X11 color list, plus rebeccapurple added in 2014.

### Can I find a color name from an image?

Not directly: this finder reads a code, not a picture. Use any eyedropper (most browsers' developer tools or an image editor have one) to read the pixel's hex value, then paste it into Hex to name to get the nearest CSS keyword.

### Can I get a color name from RGB values?

Yes. Type rgb(46, 139, 87) or simply 46, 139, 87 in Hex to name. Each channel must be 0 to 255. That example is exactly seagreen, so it shows Exact match with hex #2E8B57.

### Which hex values have a CSS color name?

Only 139 distinct values do, because nine keywords are aliases: aqua and cyan, fuchsia and magenta, and seven gray/grey pairs share one code each. Switch to All web names to see every keyword with its hex and RGB value, or filter it, for example by gray, to see the alias pairs side by side.

### Are web safe colors the same as web color names?

No. The old web-safe palette is 216 values built from the steps 00, 33, 66, 99, CC and FF on each channel. Named colors are a separate list of 148 keywords; some (black, white, red, blue, rebeccapurple #663399) happen to be web safe, but most, like cornflowerblue #6495ED, are not.

### Can I use these names in CSS instead of hex?

Yes. Every keyword returned here is valid CSS, so color: steelblue; renders exactly like color: #4682B4; in every current browser. Keywords are case-insensitive, but they cannot contain spaces, so write lightgoldenrodyellow as one word.

## Use from code or an AI agent

Free JSON API, no key needed. The answer is in `result.stats.primary`.

```bash
curl -X POST https://api.tools-directory.workers.dev/v1/tools/color-name-finder \
  -H 'Content-Type: application/json' \
  -d '{"inputs":{"mode":"hex","color":"#6495ED"}}'
```

- Inputs (JSON Schema): https://directory.milunir.com/api/v1/tools/color-name-finder.json
- MCP server: https://api.tools-directory.workers.dev/mcp (tool `color_name_finder`)
- Docs: https://directory.milunir.com/docs/
