CSS defines 148 named colors that browsers recognize by keyword instead of numeric code. Rather than writing #ff6347 in a stylesheet, you can write Tomato. Rather than #6a5acd, you can write SlateBlue. These names were standardized across CSS Color Level 3 (2011) and Level 4 (2022), building on the original 17 colors from CSS 2.1 and the 140 X11 color names inherited from early Unix window systems.
A color name finder takes an arbitrary hex or RGB value and locates the named CSS color closest to it. The matching algorithm computes the distance between two colors in RGB space, usually Euclidean distance: sqrt((r1-r2)^2 + (g1-g2)^2 + (b1-b2)^2). The named color with the smallest distance to your input wins. If the distance is zero, your input is an exact match for that name.
This matters when you want readable, self-documenting CSS. A rule like background-color: Tomato communicates intent faster than background-color: #ff6347. It also helps when you need to reference a color verbally in a design review, accessibility audit, or documentation. Instead of saying 'that reddish-orange one,' you can say 'Tomato.'
Why Use This Color Name Finder?
Looking up the nearest named color by hand means scrolling through a 148-entry reference table and eyeballing hex values. This tool does the distance calculation for you and returns the top 5 closest matches with their exact hex codes and distance scores.
π
Identify Any Color by Name
Paste a hex code from a design file, color picker, or screenshot and get the closest CSS named color instantly. The tool returns 5 matches ranked by distance so you can pick the best fit.
π
Privacy-first Processing
All color matching runs in your browser. No color values are sent to any server. The tool works offline after the page loads.
β‘
Instant Results
Distance calculations run on every keystroke. Change a single character in the hex input and the ranked results update immediately with no round-trip delay.
π
Copy Names and Hex Codes
Click any result to copy the color name or hex value to your clipboard. Paste directly into CSS, Sass variables, Tailwind config, or design tool fields.
Color Name Finder Use Cases
Readable CSS Authoring
Frontend developers replacing hex literals with named colors get stylesheets that are easier to scan during code review. Named colors communicate intent without requiring a color preview extension.
API Response Labeling
Backend engineers building color-related APIs can return a human-readable label alongside a hex code. Finding the nearest CSS color name gives users a familiar reference point without maintaining a custom name dictionary.
Accessibility Documentation
QA engineers documenting color contrast issues can refer to colors by name in bug reports. Writing 'the Crimson text on DarkSlateGray background fails AA contrast' is clearer than citing hex pairs.
Data Visualization Legends
Data engineers labeling chart series with named colors produce legends that are readable without a color swatch. The name 'CornflowerBlue' is more useful in a printed or monochrome context than '#6495ed.'
Design Handoff
When a designer shares a color from Figma or Sketch as a hex value, a developer can look up the closest CSS name and discuss it by name in Slack or a pull request comment.
Learning CSS Colors
Students exploring CSS can type arbitrary hex values and discover which named colors exist nearby. Browsing the distance results builds familiarity with the 148 built-in color keywords.
CSS Named Colors Reference by Group
The CSS Color Level 4 specification defines 148 named color keywords. The table below organizes them by hue group, with the count and first few names per group. Every name listed here is a valid CSS color keyword that works in all modern browsers.
Color group
Count
Example names
Red / Pink
14
IndianRed, LightCoral, Salmon, DarkSalmon, Crimson, Red, +8 more
Orange
5
Coral, Tomato, OrangeRed, DarkOrange, Orange
Yellow
10
Gold, Yellow, LightYellow, LemonChiffon, PapayaWhip, Moccasin, +4 more
Green
19
GreenYellow, Chartreuse, LawnGreen, Lime, LimeGreen, SpringGreen, +13 more
Blue / Cyan
24
Aqua, Cyan, LightCyan, PaleTurquoise, Aquamarine, Turquoise, +18 more
Purple
19
Lavender, Thistle, Plum, Violet, Orchid, Fuchsia, +13 more
Brown
17
Cornsilk, BlanchedAlmond, Bisque, NavajoWhite, Wheat, BurlyWood, +11 more
Gray / White
27
White, Snow, HoneyDew, MintCream, Azure, AliceBlue, +21 more
Color Distance: Euclidean RGB vs Perceptual
The method used to measure color distance affects which named color is reported as the closest match. Two approaches exist, and they can give different results for the same input.
Euclidean RGB Distance
Treats R, G, B as axes in a 3D space and computes straight-line distance: sqrt((r1-r2)^2 + (g1-g2)^2 + (b1-b2)^2). Simple, fast, and used by this tool. It works well for most practical cases but can disagree with human perception for certain green-to-blue transitions because the human eye is more sensitive to green than to blue.
CIEDE2000 (Delta E)
A perceptual distance formula defined by the International Commission on Illumination (CIE). It converts colors to the CIELAB color space first, then applies corrections for lightness, chroma, and hue to match human perception. More accurate for edge cases but significantly more complex to compute. Needed for industrial color matching; overkill for finding the nearest CSS keyword.
Code Examples
Find the nearest CSS named color programmatically using Euclidean distance in RGB space. Each example takes a hex string and returns the closest color name from the CSS specification.
JavaScript
// Euclidean distance in RGB space
function nearestCssColor(hex) {
const r = parseInt(hex.slice(1, 3), 16)
const g = parseInt(hex.slice(3, 5), 16)
const b = parseInt(hex.slice(5, 7), 16)
let bestName = ''
let bestDist = Infinity
for (const [name, value] of Object.entries(cssColors)) {
const r2 = parseInt(value.slice(1, 3), 16)
const g2 = parseInt(value.slice(3, 5), 16)
const b2 = parseInt(value.slice(5, 7), 16)
const dist = Math.sqrt((r - r2) ** 2 + (g - g2) ** 2 + (b - b2) ** 2)
if (dist < bestDist) { bestDist = dist; bestName = name }
}
return bestName
}
nearestCssColor('#6366f1') // β "SlateBlue"
nearestCssColor('#1e293b') // β "DarkSlateGray"
package main
import (
"fmt"
"math"
"strconv"
)
type CSSColor struct {
Name string
R, G, B int
}
var colors = []CSSColor{
{"Crimson", 220, 20, 60},
{"SlateBlue", 106, 90, 205},
{"Tomato", 255, 99, 71},
// ... full list
}
func hexToRGB(hex string) (int, int, int) {
r, _ := strconv.ParseInt(hex[1:3], 16, 64)
g, _ := strconv.ParseInt(hex[3:5], 16, 64)
b, _ := strconv.ParseInt(hex[5:7], 16, 64)
return int(r), int(g), int(b)
}
func nearest(hex string) string {
r, g, b := hexToRGB(hex)
best := ""
bestDist := math.MaxFloat64
for _, c := range colors {
d := math.Sqrt(float64((r-c.R)*(r-c.R) + (g-c.G)*(g-c.G) + (b-c.B)*(b-c.B)))
if d < bestDist {
bestDist = d
best = c.Name
}
}
return best
}
func main() {
fmt.Println(nearest("#6366f1")) // β SlateBlue
}
Frequently Asked Questions
How many named colors does CSS support?
CSS Color Level 4 defines 148 named color keywords. This includes the 17 original CSS 2.1 colors (like black, white, red, blue), the 140 X11 color names added in CSS 3, and the RebeccaPurple keyword added in CSS 4 as a tribute to Eric Meyer's daughter. All 148 names are case-insensitive and work in every modern browser.
What is the difference between a color name finder and a color converter?
A color converter transforms a color between formats: hex to RGB, HSL to hex, RGB to CMYK. A color name finder does something different. It searches the 148 CSS named colors and returns the one with the smallest distance to your input. The output is a keyword (like Tomato or SlateBlue), not a numeric representation.
How accurate is Euclidean RGB distance for color matching?
Euclidean RGB distance gives correct results for the majority of color lookups. It can produce unexpected matches in the green-blue range because human eyes perceive green more intensely than blue, but the RGB model treats all three channels equally. For web development tasks like finding the nearest CSS keyword, the difference rarely matters in practice.
Can I use CSS color names in JavaScript?
Yes. The CSS.supports() API, canvas 2D context, and SVG fill/stroke attributes all accept named colors. You can set element.style.backgroundColor = 'Tomato' directly. Named colors also work in CSS custom properties and with the getComputedStyle() method, though browsers return the computed value in rgb() format regardless of how you set it.
Why do some colors have strange names like PapayaWhip or BlanchedAlmond?
These names come from the X11 color database, which was created for the X Window System on Unix workstations in the 1980s. The names were chosen by their original authors without a formal naming convention. When CSS adopted X11 colors in Level 3, it kept the existing names for backward compatibility. The result is a mix of descriptive names (DarkRed), food references (PapayaWhip, Chocolate, Salmon), and geographic terms (Peru, Sienna).
Is RebeccaPurple an official CSS color?
Yes. RebeccaPurple (#663399) was added to the CSS Color Level 4 specification in 2014. It was proposed by the CSS Working Group in memory of Rebecca Meyer, the daughter of CSS author Eric Meyer, who died of brain cancer at age six. The color is supported in all browsers released after 2014.
What happens when my input hex is equally distant from two named colors?
When two named colors have identical Euclidean distances from the input, the result depends on iteration order. This tool iterates through the CSS color list alphabetically and keeps the first match found. In practice, exact ties are rare because the 148 named colors are unevenly distributed across RGB space. Most hex inputs have a single closest match.