HTML color codes

HTML and CSS understand 148 color names, from aliceblue to yellowgreen, and any other color as a hex, RGB or HSL code. Below is every named color with its codes, grouped by color and ordered light to dark, and a short guide to writing color codes.

How HTML color codes work

A color code tells the browser how much red, green and blue light to mix. The same color can be written in several ways, and every modern browser accepts all of them in HTML style attributes and in CSS.

One color, tomato, written five ways.
FormatExampleHow it works
Hex#FF6347Two hex digits (00 to FF) each for red, green and blue.
Short hex#F00One digit per channel, doubled: #F00 is #FF0000. Only works for colors like that.
RGBrgb(255, 99, 71)Red, green and blue from 0 to 255, the same numbers as hex in decimal.
HSLhsl(9, 100%, 64%)Hue as an angle on the color wheel, then saturation and lightness.
NametomatoOne of the 148 keywords below. Not case-sensitive.

Add transparency with an eight-digit hex (#FF634780 is tomato at about 50% opacity) or with a slash in the function, rgb(255 99 71 / 50%). To convert between formats, use the hex to RGB converter or the color picker, which also shows HSL, OKLCH and CMYK.

Using color codes in HTML and CSS

  • In CSS: color: #FF6347; sets text color, and background-color: tomato; sets the background.
  • In an HTML attribute: <p style="color: #FF6347"> colors one element. A stylesheet is easier to maintain for anything larger.
  • As a variable: define --brand: #FF6347; once on :root and use color: var(--brand); everywhere, so the color changes in one place.
  • Check readability: text needs enough contrast with its background. Test pairs in the contrast checker before you ship them.

The named colors are handy for quick tests, but most brands use exact hex codes. To find the name of any hex code, use the color name finder, which searches 923 named colors, or browse the color chart.

Reds: HTML color names

ColorCSS keywordHexRGB
Dark Salmondarksalmon#E9967Argb(233, 150, 122)
Salmonsalmon#FA8072rgb(250, 128, 114)
Light Corallightcoral#F08080rgb(240, 128, 128)
Tomatotomato#FF6347rgb(255, 99, 71)
Rosy Brownrosybrown#BC8F8Frgb(188, 143, 143)
Orange Redorangered#FF4500rgb(255, 69, 0)
Redred#FF0000rgb(255, 0, 0)
Indian Redindianred#CD5C5Crgb(205, 92, 92)
Crimsoncrimson#DC143Crgb(220, 20, 60)
Firebrickfirebrick#B22222rgb(178, 34, 34)
Brownbrown#A52A2Argb(165, 42, 42)
Dark Reddarkred#8B0000rgb(139, 0, 0)
Maroonmaroon#800000rgb(128, 0, 0)

Oranges: HTML color names

ColorCSS keywordHexRGB
Blanched Almondblanchedalmond#FFEBCDrgb(255, 235, 205)
Bisquebisque#FFE4C4rgb(255, 228, 196)
Navajo Whitenavajowhite#FFDEADrgb(255, 222, 173)
Peach Puffpeachpuff#FFDAB9rgb(255, 218, 185)
Burlywoodburlywood#DEB887rgb(222, 184, 135)
Light Salmonlightsalmon#FFA07Argb(255, 160, 122)
Orangeorange#FFA500rgb(255, 165, 0)
Tantan#D2B48Crgb(210, 180, 140)
Sandy Brownsandybrown#F4A460rgb(244, 164, 96)
Dark Orangedarkorange#FF8C00rgb(255, 140, 0)
Coralcoral#FF7F50rgb(255, 127, 80)
Peruperu#CD853Frgb(205, 133, 63)
Chocolatechocolate#D2691Ergb(210, 105, 30)

Yellows: HTML color names

ColorCSS keywordHexRGB
Light Yellowlightyellow#FFFFE0rgb(255, 255, 224)
Lemon Chiffonlemonchiffon#FFFACDrgb(255, 250, 205)
Light Goldenrod Yellowlightgoldenrodyellow#FAFAD2rgb(250, 250, 210)
Yellowyellow#FFFF00rgb(255, 255, 0)
Moccasinmoccasin#FFE4B5rgb(255, 228, 181)
Pale Goldenrodpalegoldenrod#EEE8AArgb(238, 232, 170)
Khakikhaki#F0E68Crgb(240, 230, 140)
Wheatwheat#F5DEB3rgb(245, 222, 179)
Goldgold#FFD700rgb(255, 215, 0)
Dark Khakidarkkhaki#BDB76Brgb(189, 183, 107)
Goldenrodgoldenrod#DAA520rgb(218, 165, 32)
Dark Goldenroddarkgoldenrod#B8860Brgb(184, 134, 11)

Greens: HTML color names

ColorCSS keywordHexRGB
Aquamarineaquamarine#7FFFD4rgb(127, 255, 212)
Green Yellowgreenyellow#ADFF2Frgb(173, 255, 47)
Pale Greenpalegreen#98FB98rgb(152, 251, 152)
Chartreusechartreuse#7FFF00rgb(127, 255, 0)
Lawn Greenlawngreen#7CFC00rgb(124, 252, 0)
Spring Greenspringgreen#00FF7Frgb(0, 255, 127)
Light Greenlightgreen#90EE90rgb(144, 238, 144)
Medium Spring Greenmediumspringgreen#00FA9Argb(0, 250, 154)
Limelime#00FF00rgb(0, 255, 0)
Yellow Greenyellowgreen#9ACD32rgb(154, 205, 50)
Medium Aquamarinemediumaquamarine#66CDAArgb(102, 205, 170)
Dark Sea Greendarkseagreen#8FBC8Frgb(143, 188, 143)
Lime Greenlimegreen#32CD32rgb(50, 205, 50)
Medium Sea Greenmediumseagreen#3CB371rgb(60, 179, 113)
Olive Drabolivedrab#6B8E23rgb(107, 142, 35)
Sea Greenseagreen#2E8B57rgb(46, 139, 87)
Forest Greenforestgreen#228B22rgb(34, 139, 34)
Greengreen#008000rgb(0, 128, 0)
Dark Olive Greendarkolivegreen#556B2Frgb(85, 107, 47)
Dark Greendarkgreen#006400rgb(0, 100, 0)

Teals and cyans: HTML color names

ColorCSS keywordHexRGB
Pale Turquoisepaleturquoise#AFEEEErgb(175, 238, 238)
Cyanaqua / cyan#00FFFFrgb(0, 255, 255)
Powder Bluepowderblue#B0E0E6rgb(176, 224, 230)
Turquoiseturquoise#40E0D0rgb(64, 224, 208)
Medium Turquoisemediumturquoise#48D1CCrgb(72, 209, 204)
Dark Turquoisedarkturquoise#00CED1rgb(0, 206, 209)
Light Sea Greenlightseagreen#20B2AArgb(32, 178, 170)
Cadet Bluecadetblue#5F9EA0rgb(95, 158, 160)
Dark Cyandarkcyan#008B8Brgb(0, 139, 139)
Tealteal#008080rgb(0, 128, 128)

Blues: HTML color names

ColorCSS keywordHexRGB
Light Bluelightblue#ADD8E6rgb(173, 216, 230)
Light Sky Bluelightskyblue#87CEFArgb(135, 206, 250)
Sky Blueskyblue#87CEEBrgb(135, 206, 235)
Light Steel Bluelightsteelblue#B0C4DErgb(176, 196, 222)
Deep Sky Bluedeepskyblue#00BFFFrgb(0, 191, 255)
Cornflower Bluecornflowerblue#6495EDrgb(100, 149, 237)
Dodger Bluedodgerblue#1E90FFrgb(30, 144, 255)
Steel Bluesteelblue#4682B4rgb(70, 130, 180)
Royal Blueroyalblue#4169E1rgb(65, 105, 225)
Blueblue#0000FFrgb(0, 0, 255)
Medium Bluemediumblue#0000CDrgb(0, 0, 205)
Midnight Bluemidnightblue#191970rgb(25, 25, 112)
Dark Bluedarkblue#00008Brgb(0, 0, 139)
Navynavy#000080rgb(0, 0, 128)

Purples: HTML color names

ColorCSS keywordHexRGB
Thistlethistle#D8BFD8rgb(216, 191, 216)
Plumplum#DDA0DDrgb(221, 160, 221)
Violetviolet#EE82EErgb(238, 130, 238)
Orchidorchid#DA70D6rgb(218, 112, 214)
Magentafuchsia / magenta#FF00FFrgb(255, 0, 255)
Medium Purplemediumpurple#9370DBrgb(147, 112, 219)
Medium Orchidmediumorchid#BA55D3rgb(186, 85, 211)
Medium Slate Bluemediumslateblue#7B68EErgb(123, 104, 238)
Slate Blueslateblue#6A5ACDrgb(106, 90, 205)
Dark Orchiddarkorchid#9932CCrgb(153, 50, 204)
Blue Violetblueviolet#8A2BE2rgb(138, 43, 226)
Dark Violetdarkviolet#9400D3rgb(148, 0, 211)
Dark Magentadarkmagenta#8B008Brgb(139, 0, 139)
Rebecca Purplerebeccapurple#663399rgb(102, 51, 153)
Purplepurple#800080rgb(128, 0, 128)
Dark Slate Bluedarkslateblue#483D8Brgb(72, 61, 139)
Indigoindigo#4B0082rgb(75, 0, 130)

Pinks: HTML color names

ColorCSS keywordHexRGB
Pinkpink#FFC0CBrgb(255, 192, 203)
Light Pinklightpink#FFB6C1rgb(255, 182, 193)
Hot Pinkhotpink#FF69B4rgb(255, 105, 180)
Pale Violet Redpalevioletred#DB7093rgb(219, 112, 147)
Deep Pinkdeeppink#FF1493rgb(255, 20, 147)
Medium Violet Redmediumvioletred#C71585rgb(199, 21, 133)

Browns: HTML color names

ColorCSS keywordHexRGB
Oliveolive#808000rgb(128, 128, 0)
Siennasienna#A0522Drgb(160, 82, 45)
Saddle Brownsaddlebrown#8B4513rgb(139, 69, 19)

Whites, grays and blacks: HTML color names

ColorCSS keywordHexRGB
Whitewhite#FFFFFFrgb(255, 255, 255)
Ivoryivory#FFFFF0rgb(255, 255, 240)
Mint Creammintcream#F5FFFArgb(245, 255, 250)
Azureazure#F0FFFFrgb(240, 255, 255)
Snowsnow#FFFAFArgb(255, 250, 250)
Floral Whitefloralwhite#FFFAF0rgb(255, 250, 240)
Honeydewhoneydew#F0FFF0rgb(240, 255, 240)
Ghost Whiteghostwhite#F8F8FFrgb(248, 248, 255)
Light Cyanlightcyan#E0FFFFrgb(224, 255, 255)
Cornsilkcornsilk#FFF8DCrgb(255, 248, 220)
Seashellseashell#FFF5EErgb(255, 245, 238)
Alice Bluealiceblue#F0F8FFrgb(240, 248, 255)
Old Laceoldlace#FDF5E6rgb(253, 245, 230)
White Smokewhitesmoke#F5F5F5rgb(245, 245, 245)
Lavender Blushlavenderblush#FFF0F5rgb(255, 240, 245)
Beigebeige#F5F5DCrgb(245, 245, 220)
Linenlinen#FAF0E6rgb(250, 240, 230)
Papaya Whippapayawhip#FFEFD5rgb(255, 239, 213)
Antique Whiteantiquewhite#FAEBD7rgb(250, 235, 215)
Misty Rosemistyrose#FFE4E1rgb(255, 228, 225)
Lavenderlavender#E6E6FArgb(230, 230, 250)
Gainsborogainsboro#DCDCDCrgb(220, 220, 220)
Light Graylightgray / lightgrey#D3D3D3rgb(211, 211, 211)
Silversilver#C0C0C0rgb(192, 192, 192)
Dark Graydarkgray / darkgrey#A9A9A9rgb(169, 169, 169)
Light Slate Graylightslategray / lightslategrey#778899rgb(119, 136, 153)
Graygray / grey#808080rgb(128, 128, 128)
Slate Grayslategray / slategrey#708090rgb(112, 128, 144)
Dim Graydimgray / dimgrey#696969rgb(105, 105, 105)
Dark Slate Graydarkslategray / darkslategrey#2F4F4Frgb(47, 79, 79)
Blackblack#000000rgb(0, 0, 0)

Frequently asked questions

How many HTML color names are there?

There are 148 named colors in CSS Color Level 4, counting spelling pairs such as gray and grey separately. Some share a color: aqua and cyan are both #00FFFF, and fuchsia and magenta are both #FF00FF.

What is the hex code for white and black?

White is #FFFFFF, or rgb(255, 255, 255). Black is #000000, or rgb(0, 0, 0). In short hex they are #FFF and #000.

Are HTML color names case-sensitive?

No. Tomato, tomato and TOMATO all give the same color. Hex codes are not case-sensitive either, so #ff6347 and #FF6347 are the same.

Should I use color names or hex codes?

Use hex, RGB or HSL codes for real designs, because the 148 names cover only a small set of colors. Names are fine for prototypes and examples.

What is rebeccapurple?

Rebeccapurple, #663399, was added to CSS in 2014 in memory of Rebecca Meyer, the daughter of CSS expert Eric Meyer. It is the newest named color.