HTML Color Codes

All 148 CSS color names with HEX, RGB, HSL and OKLCH values. Search, filter by family and click any value to copy it.

148 of 148 colors · Click a value to copy it.

The 148 CSS color names with HEX, RGB, HSL, OKLCH and text contrast
ColorHEXRGBHSLOKLCHText
black · 19.58:1
black · 17.93:1
same as cyan
black · 16.75:1
black · 17.16:1
black · 20.45:1
black · 18.98:1
black · 17.15:1
white · 21.00:1
black · 18.02:1
white · 8.59:1
white · 5.96:1
white · 7.08:1
black · 11.31:1
black · 6.88:1
black · 16.21:1
black · 5.78:1
black · 8.40:1
black · 7.06:1
black · 19.71:1
white · 4.99:1
same as aqua
black · 16.75:1
white · 15.30:1
black · 5.07:1
black · 6.45:1
same as darkgrey
black · 8.94:1
white · 7.44:1
same as darkgray
black · 8.94:1
black · 10.15:1
white · 8.50:1
white · 5.95:1
black · 9.00:1
white · 5.70:1
white · 10.01:1
black · 9.11:1
black · 9.76:1
white · 9.07:1
same as darkslategrey
white · 8.93:1
same as darkslategray
white · 8.93:1
black · 10.75:1
white · 6.56:1
black · 5.77:1
black · 9.90:1
same as dimgrey
white · 5.49:1
same as dimgray
white · 5.49:1
black · 6.49:1
white · 6.68:1
black · 20.18:1
black · 4.78:1
same as magenta
black · 6.70:1
black · 15.31:1
black · 19.86:1
black · 14.97:1
black · 9.38:1
same as grey
black · 5.32:1
white · 5.14:1
black · 17.12:1
same as gray
black · 5.32:1
black · 20.27:1
black · 7.93:1
black · 5.28:1
white · 12.95:1
black · 20.81:1
black · 16.40:1
black · 17.06:1
black · 19.03:1
black · 15.78:1
black · 19.81:1
black · 13.74:1
black · 8.10:1
black · 19.92:1
black · 19.67:1
same as lightgrey
black · 14.03:1
black · 14.82:1
same as lightgray
black · 14.03:1
black · 12.71:1
black · 10.56:1
black · 8.01:1
black · 12.24:1
same as lightslategrey
black · 5.77:1
same as lightslategray
black · 5.77:1
black · 11.80:1
black · 20.63:1
black · 15.30:1
black · 9.91:1
black · 18.67:1
same as fuchsia
black · 6.70:1
white · 10.95:1
black · 10.88:1
white · 11.16:1
black · 5.33:1
black · 5.58:1
black · 7.88:1
black · 5.06:1
black · 15.14:1
black · 11.27:1
white · 5.42:1
white · 14.85:1
black · 20.57:1
black · 17.44:1
black · 17.02:1
black · 16.30:1
white · 16.01:1
black · 19.38:1
black · 5.01:1
black · 5.52:1
black · 10.63:1
black · 6.10:1
black · 7.27:1
black · 16.76:1
black · 16.59:1
black · 16.29:1
black · 6.75:1
black · 18.56:1
black · 15.98:1
black · 7.02:1
black · 13.65:1
black · 10.15:1
black · 14.65:1
white · 9.42:1
white · 8.41:1
black · 5.25:1
black · 7.46:1
white · 4.85:1
white · 7.10:1
black · 8.40:1
black · 10.33:1
black · 4.95:1
black · 19.55:1
white · 5.62:1
black · 11.54:1
black · 12.06:1
white · 5.31:1
same as slategrey
black · 5.18:1
same as slategray
black · 5.18:1
black · 20.31:1
black · 15.61:1
black · 5.11:1
black · 10.65:1
white · 4.77:1
black · 12.36:1
black · 7.13:1
black · 12.79:1
black · 9.06:1
black · 15.98:1
black · 21.00:1
black · 19.26:1
black · 19.56:1
black · 11.15:1

How to use a color name in CSS

Any CSS property that takes a color also takes one of these 148 names, in upper or lower case. The three lines below paint the same red.

A name is easy to read, but you can't always guess it: gainsboro, peru and moccasin are real colors. For your brand color, use HEX or rgb().

color: tomato;
color: #ff6347;
color: rgb(255 99 71);

HEX, RGB, HSL and OKLCH

The table shows each color in four CSS notations. HEX is the shortest and the most common. RGB gives the amount of red, green and blue, from 0 to 255. HSL describes hue, saturation and lightness, which helps when you need a lighter or darker version of the same color.

OKLCH also uses hue, but its lightness (the first number) follows what the eye perceives: two colors with the same value look equally light. HSL does not do that, and yellow looks much lighter than blue even though both have the same nominal lightness. White, black and the grays have no chroma, so their hue is shown as 0.

To convert a color that is not on the list, use one of the converters below.

Different names, same color

Nine pairs of names share a value: aqua and cyan, fuchsia and magenta, and the gray and grey spellings of gray, darkgray, darkslategray, dimgray, lightgray, lightslategray and slategray. That is why the list has 148 names and 139 different colors. In the table, the other name appears under the row's name.

Older lists mention 140 names. They count only one spelling of each gray and leave out rebeccapurple (#663399), which arrived in CSS Color Level 4.

transparent, currentColor and system colors

Two keywords work as colors but stay out of the table because they have no fixed value. transparent is black with zero alpha. currentColor repeats the element's color value, which is handy for a border or an SVG icon that should follow the text color.

CSS also defines 19 system colors, such as Canvas, CanvasText, LinkText, Highlight and AccentColor. Their value depends on the browser, the operating system and the light or dark theme, so there is no HEX for them. They let a component follow the reader's theme.

Text contrast

The last column shows whether white or black text is easier to read on each color, using the WCAG 2 contrast ratio formula. WCAG asks for at least 4.5 to 1 for normal text and 3 to 1 for large text. White text on yellow gives only 1.07 to 1, while black text reaches 19.56 to 1.

Check the contrast of any pair of colors

Sources

Checked on November 5, 2026: