Web Color Names and Color Codes: CSS Named Colors, Hex, and Web-Safe Colors
In CSS you can specify a color not only with a hex code like #ff0000 but also with color names such as "red" and "tomato." This article explains what web color names are, how they map to color codes, what web-safe colors are, the pros and cons of using names, and how to find the color name closest to what you want.
When choosing a color for a web page, most people picture a run of symbols like "#ff0000." But in CSS you can also specify a color with English words such as "red," "tomato," and "skyblue." These are called named colors, and because the browser already knows the matching color code, you can work with colors intuitively without memorizing any code. This article explains what web color names are, how they map to color codes, and how to find the color name closest to what you have in mind.
What Are Web Color Names
Web color names are predefined English words you can use to specify colors in CSS and HTML. Write color: red; and you get red; write color: blue; and you get blue. The big advantage is that you can specify colors with words instead of memorizing a string of digits.
These names are standardized in the CSS Color specification, and today's browsers commonly recognize about 140 or more named colors. They range from basics like red and green to unique names drawn from everyday things, such as tomato, salmon, khaki, and orchid.
A named color is, in fact, an alias attached to a specific color code. For example, red refers to exactly the same color as #ff0000. When you want to check which name maps to which code, it is easiest to enter a name or code in the Color Name Finder and see for yourself.
How Color Names Map to Hex Codes
The most common color notation on the web is the hex color code. After # you write six hexadecimal digits, with each pair representing the intensity (0-255) of red (R), green (G), and blue (B) light.
#ff6347 → R=255, G=99, B=71 (this is tomato)
In other words, a named color is simply a human-readable name attached to this six-digit code. Here are a few representative mappings.
| Color name | Hex code | RGB |
|---|---|---|
| red | #ff0000 | 255, 0, 0 |
| tomato | #ff6347 | 255, 99, 71 |
| skyblue | #87ceeb | 135, 206, 235 |
| gold | #ffd700 | 255, 215, 0 |
So a color name, a hex code, and an RGB value are just different ways of writing the same color. In design work, people often sketch a palette with easy-to-read color names first, then swap them for hex codes that are easier to fine-tune in the final implementation. To convert between names and codes, the Color Converter is handy, letting you check HEX, RGB, HSL, and other notations at once.
Types of Named Colors and Colors Like tomato
Named colors fall broadly into basic colors and extended colors. Everyone can picture basics like black, white, red, green, blue, and yellow. But CSS offers far more names than these.
- Food and nature: names taken straight from familiar things, like
tomato,salmon,chocolate, andwheat. - Plants and flowers: names for softer hues, like
orchid,plum, andlavender. - Many shades of gray: a wealth of subtly different grays centered on
gray, such asdimgray,slategray, andgainsboro.
For example, tomato corresponds to #ff6347, a soft red leaning slightly toward orange. It is useful when plain red is too harsh but you want something a bit warmer. For colors like these, whose hue is hard to imagine from the name alone, it is important to display and check them. You can preview how a name looks while you search in the Color Name Finder.
What Are Web-Safe Colors
Web-safe colors are the 216 colors chosen so they would look the same in any environment back when many displays could show only 256 colors. Each component (R, G, B) is limited to six levels (00, 33, 66, 99, cc, ff), and the combinations (6 × 6 × 6 = 216) make up the set.
At the time, specifying other colors risked shifting in different environments, so designing within the safe range was the standard practice. Codes where each pair repeats the same character, like #ffcc00 or #3366ff, are the hallmark of web-safe colors.
That said, since virtually all displays today can show over 16 million colors, there is almost no need to strictly follow web-safe colors. It is enough to understand them as historical background and as a rough guide when picking "easy-to-remember, easy-to-handle codes."
Pros and Cons of Using Color Names
Color names and hex codes can express the same color, but each has its strengths and weaknesses.
| Color name | Hex code | |
|---|---|---|
| Readability | Meaning is clear | Numeric, not intuitive |
| Color freedom | Limited to about 140 | Freely pick from 16 million |
| Fine-tuning | Hard to adjust | Adjust digit by digit |
| Memorability | Easy to remember | Hard to memorize |
The biggest advantage is readability. If the code says color: tomato;, you can imagine the rough color just by reading it. For prototypes and quick sample code, names convey intent faster.
The drawbacks are that you can choose from only about 140 colors and that you cannot make subtle adjustments. To reproduce a single exact color, such as a brand color, names are not enough and you need a hex code. Likewise, an adjustment like "the same hue but slightly brighter" can only be expressed numerically. In practice, it is realistic to use names for drafts and explanations, and hex codes for the final implementation. When you want the exact code for a name, convert it with the Color Converter.
How to Find the Closest Color Name
You often need to ask "is there a color name close to this code?" or "which named color is closest to the color I have in mind?" There are a few tricks for finding it.
1. Look up a name from a reference color
If you have a code like #ff6347, looking up the nearest named color turns up tomato. Even without an exact match, knowing the "almost identical color name" lets you handle the color without memorizing the code. The Color Name Finder lets you enter a code to find close names and check how a name looks, all at once.
2. Narrow down by family
For reds, compare red, tomato, crimson, and salmon; for blues, compare blue, skyblue, navy, and steelblue. Viewing names in the same family together makes it easier to pick the closest hue. The trick is to line up differences in brightness and saturation.
Color names, hex codes, RGB, and HSL are all just different words for the same color. First move between notations with the Color Converter, then confirm the actual appearance in the Color Name Finder. Seeing and touching how colors correspond is the shortcut to handling palettes freely.
Please note that this article is intended to provide general information. How color names and color codes are handled may change as browsers and specifications are updated. Use this together with the latest official specifications and documentation.
FAQ
What are web color names?
Web color names (named colors) are predefined English words you can use to specify colors in CSS and HTML, such as red, blue, and tomato, each mapping to a specific color code. Today's browsers commonly recognize about 140 or more named colors.
How do color names map to color codes?
A named color is an alias attached to a specific hex code. For example, red refers to exactly the same color as #ff0000, and tomato to #ff6347. A color name, a hex code, and an RGB value are just different ways of writing the same color, and you can convert between them.
What are web-safe colors, and should I still use them?
Web-safe colors are the 216 colors chosen to look the same in any environment back when displays could show only 256 colors. Since nearly all displays today show over 16 million colors, there is almost no need to follow them strictly. Understanding them as historical background is enough.
Should I use color names or hex codes?
It is not about superiority but use case. Names are readable and suit prototypes and explanations. But to reproduce one exact color, such as a brand color, or to fine-tune, names limited to about 140 colors are not enough and you need a hex code. Names for drafts, hex codes for final implementation is realistic.
Are the colors I enter in the Color Name Finder or Color Converter sent to a server?
WAZA TOOLS' Color Name Finder and Color Converter run entirely in your browser, so the names and codes you enter are never sent to or stored on a server. They work on smartphones too, and you can look up and convert colors as many times as you like, for free.