CSS lets you write color: tomato; instead of a hex code, which raises a reasonable question: what exactly is "tomato," and where does that specific color value come from? Named colors are a genuinely useful shorthand, but understanding what they actually represent avoids some common confusion about their precision and limits. Knowing the difference helps explain why a codebase might mix both approaches without that being a sign of inconsistency.

What a named color actually is

Every CSS named color is simply a predefined alias for a specific, fixed hex value — "tomato" is defined as exactly #FF6347, nothing more mysterious than that. When a browser encounters a named color, it looks up the corresponding hex value from a standard predefined list and renders that value, exactly as if you'd typed the hex code directly.

How many named colors exist

The CSS specification defines 147 named colors, ranging from obvious ones like "red," "blue," and "black" to more specific and less commonly known ones like "peachpuff," "mediumseagreen," and "rebeccapurple." This is a fixed, standardized list — you can't invent new named colors, only use the ones already defined in the specification.

When named colors make sense to use

For quick prototyping, casual projects, or situations where a color's exact precision genuinely doesn't matter, a named color like "tomato" or "steelblue" can be more immediately readable in code than an abstract hex string, since the name itself gives a rough sense of the color without needing to mentally parse or look up the hex value.

When hex codes are the better choice

For any project with a defined brand palette, precise design requirements, or a need for colors not covered by the 147 named options, hex codes (or RGB/HSL) are necessary, since named colors can only ever represent that fixed, limited set. Professional and production codebases overwhelmingly favor explicit hex or RGB/HSL values over named colors specifically for this precision and flexibility.

A quirky historical example: rebeccapurple

"Rebeccapurple" (#663399) is a genuinely unusual named color, added to the CSS specification in 2014 as a tribute to Rebecca Meyer, the young daughter of a well-known web standards contributor, who passed away from cancer. It's one of very few named colors added long after the original list was standardized, and its origin as a personal tribute rather than a purely practical addition makes it a small, distinctive piece of CSS history.

Where named colors still show up in modern codebases

Even in professional projects that mostly avoid named colors for precision reasons, they still turn up occasionally for genuinely universal, unambiguous cases — "transparent" and "currentColor" (a special CSS keyword, not a named color itself, but often used alongside them) remain common even in otherwise strictly hex-based color systems.

Try the Color Convert tool yourself — free, instant, nothing sent anywhere.

Open the tool

Frequently asked questions

Are named colors less accurate than hex codes?

No, a named color is simply an alias for one specific, exact hex value, so using "tomato" instead of #FF6347 produces the identical rendered color; the difference is purely about which form is more convenient or readable in a given context.

Can I create a custom named color in CSS?

No, the list of 147 named colors is fixed by the CSS specification and can't be extended with custom names; any color outside that predefined list needs to be specified with a hex, RGB, or HSL value instead.

Why would a professional project avoid named colors?

Named colors only cover a fixed set of 147 specific values, which is far too limited for a defined brand palette or precise design system, so hex, RGB, or HSL values are used instead for the flexibility to specify any exact color needed.

What makes rebeccapurple different from other named colors?

It's one of the few named colors added long after CSS's original color list was standardized, included specifically as a tribute to a web standards contributor's late daughter, giving it a personal origin story that most of the other 146 names don't share. These specific exceptions persist because they solve a real, common need cleanly, not because named colors as a whole have become more precise or preferred over hex values.