Reference
Hex Color Chart
Named CSS colors with their hex and RGB values, arranged so you can find one by eye.
Primary and secondary colors
Screens mix light rather than pigment, so the secondaries are not the ones you learned with paint. Each is two channels at full strength.
Greyscale
Any color with three equal pairs is grey. The first digit of the pair is what moves.
Named CSS colors
CSS defines around 140 color names. These are the ones that see real use, grouped by family so you can scan for the shade you want rather than guessing at a code.
The same list as values
Sortable by eye, copyable by hand. Every hex code here is the exact value CSS assigns to the name.
| Name | Hex | RGB |
|---|---|---|
| black | #000000 | 0, 0, 0 |
| dimgray | #696969 | 105, 105, 105 |
| gray | #808080 | 128, 128, 128 |
| darkgray | #A9A9A9 | 169, 169, 169 |
| silver | #C0C0C0 | 192, 192, 192 |
| lightgray | #D3D3D3 | 211, 211, 211 |
| gainsboro | #DCDCDC | 220, 220, 220 |
| white | #FFFFFF | 255, 255, 255 |
| maroon | #800000 | 128, 0, 0 |
| darkred | #8B0000 | 139, 0, 0 |
| firebrick | #B22222 | 178, 34, 34 |
| red | #FF0000 | 255, 0, 0 |
| crimson | #DC143C | 220, 20, 60 |
| tomato | #FF6347 | 255, 99, 71 |
| coral | #FF7F50 | 255, 127, 80 |
| salmon | #FA8072 | 250, 128, 114 |
| orangered | #FF4500 | 255, 69, 0 |
| darkorange | #FF8C00 | 255, 140, 0 |
| orange | #FFA500 | 255, 165, 0 |
| gold | #FFD700 | 255, 215, 0 |
| olive | #808000 | 128, 128, 0 |
| darkkhaki | #BDB76B | 189, 183, 107 |
| khaki | #F0E68C | 240, 230, 140 |
| yellow | #FFFF00 | 255, 255, 0 |
| darkgreen | #006400 | 0, 100, 0 |
| green | #008000 | 0, 128, 0 |
| forestgreen | #228B22 | 34, 139, 34 |
| seagreen | #2E8B57 | 46, 139, 87 |
| olivedrab | #6B8E23 | 107, 142, 35 |
| limegreen | #32CD32 | 50, 205, 50 |
| lime | #00FF00 | 0, 255, 0 |
| springgreen | #00FF7F | 0, 255, 127 |
| teal | #008080 | 0, 128, 128 |
| darkcyan | #008B8B | 0, 139, 139 |
| lightseagreen | #20B2AA | 32, 178, 170 |
| turquoise | #40E0D0 | 64, 224, 208 |
| aqua | #00FFFF | 0, 255, 255 |
| cadetblue | #5F9EA0 | 95, 158, 160 |
| steelblue | #4682B4 | 70, 130, 180 |
| skyblue | #87CEEB | 135, 206, 235 |
| navy | #000080 | 0, 0, 128 |
| darkblue | #00008B | 0, 0, 139 |
| mediumblue | #0000CD | 0, 0, 205 |
| blue | #0000FF | 0, 0, 255 |
| royalblue | #4169E1 | 65, 105, 225 |
| cornflowerblue | #6495ED | 100, 149, 237 |
| dodgerblue | #1E90FF | 30, 144, 255 |
| slateblue | #6A5ACD | 106, 90, 205 |
| indigo | #4B0082 | 75, 0, 130 |
| purple | #800080 | 128, 0, 128 |
| darkmagenta | #8B008B | 139, 0, 139 |
| magenta | #FF00FF | 255, 0, 255 |
| orchid | #DA70D6 | 218, 112, 214 |
| violet | #EE82EE | 238, 130, 238 |
| plum | #DDA0DD | 221, 160, 221 |
| thistle | #D8BFD8 | 216, 191, 216 |
| brown | #A52A2A | 165, 42, 42 |
| sienna | #A0522D | 160, 82, 45 |
| chocolate | #D2691E | 210, 105, 30 |
| peru | #CD853F | 205, 133, 63 |
| tan | #D2B48C | 210, 180, 140 |
| wheat | #F5DEB3 | 245, 222, 179 |
| beige | #F5F5DC | 245, 245, 220 |
| ivory | #FFFFF0 | 255, 255, 240 |
Two names that trip everyone up
- green is not #00FF00. CSS
greenis#008000, a mid-dark green. The full-brightness one is calledlime. This dates back to the original sixteen HTML colors and was kept for compatibility. - gray and grey both work, as do all their compounds. CSS accepts either spelling throughout.
Named colors are convenient for quick prototypes and awful for design systems. They are a fixed, arbitrary set with no internal consistency — there is no way to say “the same red, slightly darker”. Once a project is real, define your own palette in hex or HSL.
Web-safe colors
You may still see references to a 216-color "web-safe" palette, built from the six values
00, 33, 66, 99, CC and
FF per channel. It existed because 1990s displays could only show 256 colors at once.
Every display made this century handles 16.7 million colors, so the restriction is obsolete. The palette is worth knowing about only so you can recognise the constraint when you meet it in old documentation and ignore it.
Frequently asked questions
How many named colors does CSS have?
Around 140, including several duplicate spellings such as gray and grey, and aqua and cyan which are the same color.
What is the hex code for red?
#FF0000 for pure red. The named color red maps to exactly that value.
Why is CSS green #008000 rather than #00FF00?
The name was defined that way in the original HTML color set and kept for compatibility. The full-brightness version is named lime.
What is a web-safe color?
One of 216 colors that displayed reliably on 256-color monitors in the 1990s. Modern displays make the restriction meaningless.
Should I use color names in production CSS?
For prototypes they are fine. For a design system define your own palette, because named colors have no consistent relationships to build on.
Are gray and grey both valid?
Yes, and so are both spellings of every compound such as darkgray and darkgrey.