List of HTML & CSS Color Codes with Examples of Their Use

HTML Color Codes are an important part that you need to know when doing the web design and development process. Using these codes, you can define colors for various visual elements more precisely and consistently.

For web developers, designers, and anyone who creates digital content, this code is almost inseparable from everyday work. Whether it’s creating an HTML website, designing images, or working on a presentation, your work can be more professional by understanding this color code.

No need to look far, because we have prepared a list of HTML color codes in this article that you can use as a guide. We will also explain the types of digital colors that exist today, as well as share examples of their use.

HTML and CSS Color Codes List

Below is a complete table listing all HTML color codes along with their associated HEX and RGB colors:

ResultsHTML Color CodesHex CodesRGB Codes
Black#000000rgb(0, 0, 0)
White#FFFFFFrgb(255, 255, 255)
Red#FF0000rgb(255, 0, 0)
Lime#00FF00rgb(0, 255, 0)
Blue#0000FFrgb(0, 0, 255)
AliceBlue#F0F8FFrgb(240, 248, 255)
AntiqueWhite#FAEBD7rgb(250, 235, 215)
Aqua#00FFFFrgb(0, 255, 255)
Aquamarine#7FFFD4rgb(127, 255, 212)
Azure#F0FFFFrgb(240, 255, 255)
Beige#F5F5DCrgb(245, 245, 220)
Bisque#FFE4C4rgb(255, 228, 196)
BlanchedAlmond#FFEBCDrgb(255, 235, 205)
BlueViolet#8A2BE2rgb(138, 43, 226)
Brown#A52A2Argb(165, 42, 42)
BurlyWood#DEB887rgb(222, 184, 135)
CadetBlue#5F9EA0rgb(95, 158, 160)
Chartreuse#7FFF00rgb(127, 255, 0)
Chocolate#D2691Ergb(210, 105, 30)
Coral#FF7F50rgb(255, 127, 80)
CornflowerBlue#6495EDrgb(100, 149, 237)
Cornsilk#FFF8DCrgb(255, 248, 220)
Crimson#DC143Crgb(220, 20, 60)
Cyan#00FFFFrgb(0, 255, 255)
DarkBlue#00008Brgb(0, 0, 139)
DarkCyan#008B8Brgb(0, 139, 139)
DarkGoldenRod#B8860Brgb(184, 134, 11)
DarkGray#A9A9A9rgb(169, 169, 169)
DarkGreen#006400rgb(0, 100, 0)
DarkKhaki#BDB76Brgb(189, 183, 107)
DarkMagenta#8B008Brgb(139, 0, 139)
DarkOliveGreen#556B2Frgb(85, 107, 47)
DarkOrange#FF8C00rgb(255, 140, 0)
DarkOrchid#9932CCrgb(153, 50, 204)
DarkRed#8B0000rgb(139, 0, 0)
DarkSalmon#E9967Argb(233, 150, 122)
DarkSeaGreen#8FBC8Frgb(143, 188, 143)
DarkSlateBlue#483D8Brgb(72, 61, 139)
DarkSlateGray#2F4F4Frgb(47, 79, 79)
DarkTurquoise#00CED1rgb(0, 206, 209)
DarkViolet#9400D3rgb(148, 0, 211)
DeepPink#FF1493rgb(255, 20, 147)
DeepSkyBlue#00BFFFrgb(0, 191, 255)
DimGray#696969rgb(105, 105, 105)
DodgerBlue#1E90FFrgb(30, 144, 255)
FireBrick#B22222rgb(178, 34, 34)
FloralWhite#FFFAF0rgb(255, 250, 240)
ForestGreen#228B22rgb(34, 139, 34)
Fuchsia#FF00FFrgb(255, 0, 255)
Gainsboro#DCDCDCrgb(220, 220, 220)
GhostWhite#F8F8FFrgb(248, 248, 255)
Gold#FFD700rgb(255, 215, 0)
GoldenRod#DAA520rgb(218, 165, 32)
Gray#808080rgb(128, 128, 128)
Green#008000rgb(0, 128, 0)
GreenYellow#ADFF2Frgb(173, 255, 47)
HoneyDew#F0FFF0rgb(240, 255, 240)
HotPink#FF69B4rgb(255, 105, 180)
IndianRed#CD5C5Crgb(205, 92, 92)
Indigo#4B0082rgb(75, 0, 130)
Ivory#FFFFF0rgb(255, 255, 240)
Khaki#F0E68Crgb(240, 230, 140)
Lavender#E6E6FArgb(230, 230, 250)
LavenderBlush#FFF0F5rgb(255, 240, 245)
LawnGreen#7CFC00rgb(124, 252, 0)
LemonChiffon#FFFACDrgb(255, 250, 205)
LightBlue#ADD8E6rgb(173, 216, 230)
LightCoral#F08080rgb(240, 128, 128)
LightCyan#E0FFFFrgb(224, 255, 255)
LightGoldenRodYellow#FAFAD2rgb(250, 250, 210)
LightGray#D3D3D3rgb(211, 211, 211)
LightGreen#90EE90rgb(144, 238, 144)
LightPink#FFB6C1rgb(255, 182, 193)
LightSalmon#FFA07Argb(255, 160, 122)
LightSeaGreen#20B2AArgb(32, 178, 170)
LightSkyBlue#87CEFArgb(135, 206, 250)
LightSlateGray#778899rgb(119, 136, 153)
LightSteelBlue#B0C4DErgb(176, 196, 222)
LightYellow#FFFFE0rgb(255, 255, 224)
LimeGreen#32CD32rgb(50, 205, 50)
Linen#FAF0E6rgb(250, 240, 230)
Magenta#FF00FFrgb(255, 0, 255)
Maroon#800000rgb(128, 0, 0)
MediumAquamarine#66CDAArgb(102, 205, 170)
MediumBlue#0000CDrgb(0, 0, 205)
MediumOrchid#BA55D3rgb(186, 85, 211)
MediumPurple#9370DBrgb(147, 112, 219)
MediumSeaGreen#3CB371rgb(60, 179, 113)
MediumSlateBlue#7B68EErgb(123, 104, 238)
MediumSpringGreen#00FA9Argb(0, 250, 154)
MediumTurquoise#48D1CCrgb(72, 209, 204)
MediumVioletRed#C71585rgb(199, 21, 133)
MidnightBlue#191970rgb(25, 25, 112)
MintCream#F5FFFArgb(245, 255, 250)
MistyRose#FFE4E1rgb(255, 228, 225)
Moccasin#FFE4B5rgb(255, 228, 181)
NavajoWhite#FFDEADrgb(255, 222, 173)
Navy#000080rgb(0, 0, 128)
OldLace#FDF5E6rgb(253, 245, 230)
Olive#808000rgb(128, 128, 0)
OliveDrab#6B8E23rgb(107, 142, 35)
Orange#FFA500rgb(255, 165, 0)
OrangeRed#FF4500rgb(255, 69, 0)
Orchid#DA70D6rgb(218, 112, 214)
PaleGoldenRod#EEE8AArgb(238, 232, 170)
PaleGreen#98FB98rgb(152, 251, 152)
PaleTurquoise#AFEEEErgb(175, 238, 238)
PaleVioletRed#DB7093rgb(219, 112, 147)
PapayaWhip#FFEFD5rgb(255, 239, 213)
PeachPuff#FFDAB9rgb(255, 218, 185)
Peru#CD853Frgb(205, 133, 63)
Pink#FFC0CBrgb(255, 192, 203)
Plum#DDA0DDrgb(221, 160, 221)
PowderBlue#B0E0E6rgb(176, 224, 230)
Purple#800080rgb(128, 0, 128)
RosyBrown#BC8F8Frgb(188, 143, 143)
RoyalBlue#4169E1rgb(65, 105, 225)
SaddleBrown#8B4513rgb(139, 69, 19)
Salmon#FA8072rgb(250, 128, 114)
SandyBrown#F4A460rgb(244, 164, 96)
SeaGreen#2E8B57rgb(46, 139, 87)
SeaShell#FFF5EErgb(255, 245, 238)
Sienna#A0522Drgb(160, 82, 45)
Silver#C0C0C0rgb(192, 192, 192)
SkyBlue#87CEEBrgb(135, 206, 235)
SlateBlue#6A5ACDrgb(106, 90, 205)
SlateGray#708090rgb(112, 128, 144)
Snow#FFFAFArgb(255, 250, 250)
SpringGreen#00FF7Frgb(0, 255, 127)
SteelBlue#4682B4rgb(70, 130, 180)
Tan#D2B48Crgb(210, 180, 140)
Teal#008080rgb(0, 128, 128)
Thistle#D8BFD8rgb(216, 191, 216)
Tomato#FF6347rgb(255, 99, 71)
Turquoise#40E0D0rgb(64, 224, 208)
Violet#EE82EErgb(238, 130, 238)
Wheat#F5DEB3rgb(245, 222, 179)
WhiteSmoke#F5F5F5rgb(245, 245, 245)
Yellow#FFFF00rgb(255, 255, 0)
YellowGreen#9ACD32rgb(154, 205, 50)

Red and Pink Color Variations

Here are some variations of the HTML red color that you can use:

ResultsHTML Color CodesHex CodesRGB Codes
IndianRed#CD5C5C205, 92, 92
LightCoral#F08080240, 128, 128
Salmon#FA8072250, 128, 114
DarkSalmon#E9967A233, 150, 122
LightSalmon#FFA07A255, 160, 122
Crimson#DC143C220, 20, 60
Red#FF0000255, 0, 0
Firebrick#B22222178, 34, 34
DarkRed#8B0000139, 0, 0
Maroon#800000128, 0, 0
Pink#FFC0CB255, 192, 203
LightPink#FFB6C1255, 182, 193
HotPink#FF69B4255, 105, 180
DeepPink#FF1493255, 20, 147
MediumVioletRed#C71585199, 21, 133
PaleVioletRed#DB7093219, 112, 147

Yellow and Orange Color Variations

If you need the yellow color variations, here are the codes you can use:

ResultsHTML Color CodesHex CodesRGB Codes
Gold#FFD700255, 215, 0
Yellow#FFFF00255, 255, 0
LightYellow#FFFFE0255, 255, 224
LemonChiffon#FFFACD255, 250, 205
LightGoldenrodYellow#FAFAD2250, 250, 210
PapayaWhip#FFEFD5255, 239, 213
Moccasin#FFE4B5255, 228, 181
PeachPuff#FFDAB9255, 218, 185
PaleGoldenrod#EEE8AA238, 232, 170
Khaki#F0E68C240, 230, 140
DarkKhaki#BDB76B189, 183, 107
Coral#FF7F50255, 127, 80
Tomato#FF6347255, 99, 71
OrangeRed#FF4500255, 69, 0
DarkOrange#FF8C00255, 140, 0
Orange#FFA500255, 165, 0

Green Color Variations

For green color variations, here are the codes:

ResultsHTML Color CodesHex CodesRGB Codes
GreenYellow#ADFF2F173, 255, 47
Chartreuse#7FFF00127, 255, 0
LawnGreen#7CFC00124, 252, 0
Lime#00FF000, 255, 0
LimeGreen#32CD3250, 205, 50
PaleGreen#98FB98152, 251, 152
LightGreen#90EE90144, 238, 144
MediumSpringGreen#00FA9A0, 250, 154
SpringGreen#00FF7F0, 255, 127
MediumSeaGreen#3CB37160, 179, 113
SeaGreen#2E8B5746, 139, 87
ForestGreen#228B2234, 139, 34
Green#0080000, 128, 0
DarkGreen#0064000, 100, 0
YellowGreen#9ACD32154, 205, 50
OliveDrab#6B8E23107, 142, 35
Olive#808000128, 128, 0
DarkOliveGreen#556B2F85, 107, 47
MediumAquamarine#66CDAA102, 205, 170
DarkSeaGreen#8FBC8F143, 188, 143
LightSeaGreen#20B2AA32, 178, 170
Aquamarine#7FFFD4127, 255, 212

Blue Color Variations

Here is a list of blue color variations and the HTML codes you can use:

ResultsHTML Color CodesHex CodesRGB Codes
DarkCyan#008B8B0, 139, 139
Teal#0080800, 128, 128
Aqua#00FFFF0, 255, 255
LightCyan#E0FFFF224, 255, 255
PaleTurquoise#AFEEEE175, 238, 238
Turquoise#40E0D064, 224, 208
MediumTurquoise#48D1CC72, 209, 204
DarkTurquoise#00CED10, 206, 209
CadetBlue#5F9EA095, 158, 160
SteelBlue#4682B470, 130, 180
LightSteelBlue#B0C4DE176, 196, 222
PowderBlue#B0E0E6176, 224, 230
LightBlue#ADD8E6173, 216, 230
SkyBlue#87CEEB135, 206, 235
LightSkyBlue#87CEFA135, 206, 250
DeepSkyBlue#00BFFF0, 191, 255
DodgerBlue#1E90FF30, 144, 255
CornflowerBlue#6495ED100, 149, 237
MediumSlateBlue#7B68EE123, 104, 238
RoyalBlue#4169E165, 105, 225
Blue#0000FF0, 0, 255
MediumBlue#0000CD0, 0, 205
DarkBlue#00008B0, 0, 139
Navy#0000800, 0, 128
MidnightBlue#19197025, 25, 112

Purple Color Variations

Here are the purple color variations and their codes:

ResultsHTML Color CodesHex CodesRGB Codes
Lavender#E6E6FA230, 230, 250
Thistle#D8BFD8216, 191, 216
Plum#DDA0DD221, 160, 221
Violet#EE82EE238, 130, 238
Orchid#DA70D6218, 112, 214
Fuchsia#FF00FF255, 0, 255
Magenta#FF00FF255, 0, 255
MediumOrchid#BA55D3186, 85, 211
MediumPurple#9370DB147, 112, 219
BlueViolet#8A2BE2138, 43, 226
DarkViolet#9400D3148, 0, 211
DarkOrchid#9932CC153, 50, 204
DarkMagenta#8B008B139, 0, 139
Purple#800080128, 0, 128
Indigo#4B008275, 0, 130
SlateBlue#6A5ACD106, 90, 205
DarkSlateBlue#483D8B72, 61, 139

Brown Color Variations

For brown color variations, here is the HTML code that can be used:

ResultsHTML Color CodesHex CodesRGB Codes
Cornsilk#FFF8DC255, 248, 220
BlanchedAlmond#FFEBBD255, 235, 205
Bisque#FFE4C4255, 228, 196
NavajoWhite#FFDEAD255, 222, 173
Wheat#F5DEB3245, 222, 179
BurlyWood#DEB887222, 184, 135
Tan#D2B48C210, 180, 140
RosyBrown#BC8F8F188, 143, 143
SandyBrown#F4A460244, 164, 96
Goldenrod#DAA520218, 165, 32
DarkGoldenrod#B8860B184, 134, 11
Peru#CD853F205, 133, 63
Chocolate#D2691E210, 105, 30
SaddleBrown#8B4513139, 69, 19
Sienna#A0522D160, 82, 45
Brown#A52A2A165, 42, 42

Bright White Color Variations

Below is the HTML code for the white color variations:

ResultsHTML Color CodesHex CodesRGB Codes
White#FFFFFF255, 255, 255
Snow#FFFAFA255, 250, 250
Honeydew#F0FFF0240, 255, 240
MintCream#F5FFFA245, 255, 250
Azure#F0FFFF240, 255, 255
AliceBlue#F0F8FF240, 248, 255
GhostWhite#F8F8FF248, 248, 255
WhiteSmoke#F5F5F5245, 245, 245
Seashell#FFF5EE255, 245, 238
Beige#F5F5DC245, 245, 220
OldLace#FDF5E6253, 245, 230
FloralWhite#FFFAF0255, 250, 240
Ivory#FFFFF0255, 255, 240
AntiqueWhite#FAEBD7250, 235, 215
Linen#FAF0E6250, 240, 230
LavenderBlush#FFF0F5255, 240, 245
MistyRose#FFE4E1255, 228, 225

Black, Gray, and Dark Color Variations

Here is the HTML code for the gray color variations:

ResultsHTML Color CodesHex CodesRGB Codes
Gainsboro#DCDCDC220, 220, 220
LightGray#D3D3D3211, 211, 211
Silver#C0C0C0192, 192, 192
DarkGray#A9A9A9169, 169, 169
Gray#808080128, 128, 128
DimGray#696969105, 105, 105
LightSlateGray#778899119, 136, 153
SlateGray#708090112, 128, 144
DarkSlateGray#2F4F4F47, 79, 79
Black#0000000, 0, 0

In addition to the above options, you can also combine various other colors to produce the right combination. Because, there are so many possible colors that can be selected using HEX or RGB codes.

Here are examples of colors that do not have HTML color codes but can be produced using HEX and RGB codes:

ResultsHEX CodesRGB Codes
#A2A832rgb(162, 168, 50)
#3259A8rgb(50, 89, 168)
#7C3F55rgb(124, 63, 85)
#8A7342rgb(138, 115, 66)
#B1849Frgb(177, 132, 159)
#52619Frgb(82, 97, 159)
#9C754Drgb(156, 117, 77)
#5F7E68rgb(95, 126, 104)
#AC6F95rgb(172, 111, 149)
#5D6D8Ergb(93, 109, 142)

Current Digital Color Representations

Currently, there are several digital color models used in visual design, each with its own ideal use cases.

For example, HTML color codes are easier and more practical because they directly write their names, HEX guarantees more precise colors, and RGB can be used for advanced color manipulation.

By learning these color codes, you can also create an attractive visual experience, ensuring that your designs can be displayed smoothly on various devices and platforms.

Here are some of the most popular digital color models today:

    • HTML Color Codes. Implemented using the color name, not the code. For example: red, antiquewhite, darkorange. The number of possibilities is more limited than other color models.
    • Hexadecimal (Hex) Color Codes. Uses a combination of 6 digits and letters to represent a color. For example, #FFFFFF represents white.
    • RGB Color Codes. Stands for Red, Green, Blue. Colors are displayed by specifying the intensity of the three primary colors, red, green, and blue. For example, rgb(255, 255, 255) for white. RGB has a variation, RGBA, which includes an Alpha value for opacity. For example, rgba(255, 255, 255, 1) represents opaque white.
    • CMYK Color Codes. Stands for Cyan, Magenta, Yellow, Key (Black). This model is mainly used in color printing. In its implementation, colors are mixed based on the percentage of the four colors. For example, a deep blue color can be represented as cmyk(100%, 80%, 0%, 20%).
    • HSV Color Codes. Stands for Hue, Saturation, Value. With this model, color properties are controlled intuitively based on hue, saturation, and value. For example, a bright yellow color can be represented using the code hsv(60°, 100%, 100%).
    • HSL Color Codes. Stands for Hue, Saturation, Lightness. This format represents colors in a way that is easier for humans to understand. For example, hsl(0, 0%, 100%) is white. HSL also has a variation that determines opacity, namely HSLA. For example, hsla(0, 0%, 100%, 1) will produce an opaque white color.

Example of How to Use HTML Color Codes

Okay, after understanding the colors that exist, you also need to know how to apply them to create a visually appealing and consistent design.

Below, we will share some practical examples of using HTML color codes using Hex. If you prefer to use HTML or RGB color codes, simply replace the Hex code with the appropriate value.

For example, to use HTML or RGB color codes for red, simply replace the code in the format #FF0000 with red or rgb(255, 0, 0), according to the list in the table.

Change Text Color

Below, we will show you how to change text color using Hex color codes to get the results as below:

This text example uses Hex color codes: #FF0000

This text example uses Hex color codes: #00FF00

This text example uses Hex color codes: #0000FF

To apply the color customization above, you can write code like this:

<p style="color: #FF0000; margin-bottom: 10px;">This text example uses Hex color codes: #FF0000</p>
<p style="color: #00FF00; margin-bottom: 10px;">This text example uses Hex color codes: #00FF00</p>
<p style="color: #0000FF; margin-bottom: 10px;">This text example uses Hex color codes: #0000FF</p>

Coloring Table Borders

The following example shows how to apply color to table borders using Hex code, which will produce an output like the following:

Table Border Color Example 1
Table Border Color Example 2
Table Border Color Example 3

The codes you can use are:

<table style="border: 2px solid #FF0000; margin-bottom: 10px;">
    <tr>
        <td>Table Border Color Example 1</td>
    </tr>
</table>
<table style="border: 2px solid #00FF00; margin-bottom: 10px;">
    <tr>
        <td>Table Border Color Example 2</td>
    </tr>
</table>
<table style="border: 2px solid #0000FF; margin-bottom: 10px;">
    <tr>
        <td>Table Border Color Example 3</td>
    </tr>
</table>

Adding Background Color to Text

The example below shows how to add background color to text using Hex code. As a result, you will see text like below:

This example text is given a background color using the Hex color code: #F08080 (Light Coral)

This example text is given a background color using the Hex color code: #98FB98 (Pale Green)

This example text is given a background color using the Hex color code: #87CEFA (Light Sky Blue)

To make adjustments like the above, you can use the following code:

<p style="background-color: #F08080; color: #000000; margin-bottom: 10px;">This example text is given a background color using the Hex color code: #F08080 (Light Coral)</p>
<p style="background-color: #98FB98; color: #000000; margin-bottom: 10px;">This example text is given a background color using the Hex color code: #98FB98 (Pale Green)</p>
<p style="background-color: #87CEFA; color: #000000; margin-bottom: 10px;">This example text is given a background color using the Hex color code: #87CEFA (Light Sky Blue)</p>

Changing HTML Button Color

You can also change the color of buttons created using HTML code, as in the following example.

The codes you can write to get the above results are:

<button style="background-color: #FF0000; color: #ffffff; padding: 10px 20px; border: none; margin-bottom: 10px;">Hex Button Color Example 1</button>
<button style="background-color: #00FF00; color: #000000; padding: 10px 20px; border: none; margin-bottom: 10px;">Hex Button Color Example 2</button>
<button style="background-color: #0000FF; color: #ffffff; padding: 10px 20px; border: none; margin-bottom: 10px;">Hex Button Color Example 3</button>

In addition to setting the color, you can also space each button by setting the padding number (for example 10px, 20px, and so on).

Set the Color of a Div Element

This example will show you how to set the background color of a div element that can contain multiple elements, including text, images, or other HTML elements. The result will look like this:

Div with Hex background color: #F08080 (Light Coral)
Div with Hex background color: #98FB98 (Pale Green)
Div with Hex background color: #87CEFA (Light Sky Blue)

Unlike the text background element, the <div> element is used to set the background color of a container or larger division on a web page.

Following are the codes used to produce the above output:

<div style="background-color: #F08080; color: #000000; padding: 20px; margin-bottom: 10px;">Div with Hex background color: #F08080 (Light Coral)</div>
<div style="background-color: #98FB98; color: #000000; padding: 20px; margin-bottom: 10px;">Div with Hex background color: #98FB98 (Pale Green)</div>
<div style="background-color: #87CEFA; color: #000000; padding: 20px; margin-bottom: 10px;">Div with Hex background color: #87CEFA (Light Sky Blue)</div>

How to Find Color Codes Easily

To find the HEX or RGB code of a particular color, there are various tools that you can use. Some of these tools are provided by default on the device you are using, and some are available online.

For example, Microsoft Paint, in the Windows system, has a color picker tool that also displays the code in HEX, RGB, and HSV. You can access it from the Colors section, then simply hover over the desired color, the Hex color code will appear on the right.

How to Find Color Codes Easily on Microsoft Paint

In addition, there are also various online tools that you can use. It is not difficult to find them, because Google provides a color picker that you can directly access from the search engine results page (SERP).

Just type “HTML color picker” in the Google search field, then you can access this tool, with HEX, RGB, CMYK, HSV, and HSL code options. Select a color by hovering over it, then see the preview on the left. After that, you can copy the code as needed.

HTML color picker

Using this tool, designers and developers can easily choose and determine the right colors so they can apply them consistently to projects that require a creative process.

Conclusion

HTML color codes play a very important role if you often handle things related to design and web development. Using these codes, you can adjust the visual elements and appearance of the website precisely to create a design that is according to plan.

By understanding the different types of color codes and their uses, you can create attractive and accessible web pages. You can then use this tutorial as a reference to refine your designs and ensure color consistency across your projects.