HTML Color Codes
Use this page to get HTML color codes for your website. The colors are represented by various color models, such as hexadecimal, RGB, HSL, etc.
To learn about HTML colors and how to apply them to your website, check out the HTML colors section of the HTML tutorial.
Color Picker
CSS Color Names
Here is a table of the CSS color names. These are based on the X11 colors, and are supported by all major browsers.
Try clicking on a value. This will open a color tester where you can test different colors against the page background.
More Color Charts
Here's a quick glimpse back in time to see how colors used to be done on the web.
Web Safe Colors
This chart displays the 216 "web safe" colors. Click on a color to display it in a new page.
Are the Web Safe Colors Still Relevant?
The "web safe color palette" was used heavily in the early days of the web, especially in the late 1990s.
Being "web safe" meant that the color would be displayed consistently across different computer systems. Back then, most computer monitors had an 8-bit color depth, which means they could display only 256 colors. Also, some of those colors weren't displayed consistently between different systems.
If a website specified a color that wasn't available on the monitor, it would either display another color that was available, or attempt to make up the color by using a dithering process.
Nowadays, there's usually no need to limit yourself to the web safe colors, as most computers (and even mobile devices) can display millions of colors, so the issue is no longer prevalent.
However, there's nothing to stop you continuing to use this color palette today. Using web safe colors can provide a bright and bold look, and could bring a fresh new look to your website!
HTML3 and HTML4 Color Names
There was a time where the HTML specification defined the color names that could be used within HTML documents. This is no longer the case — CSS has taken over the responsibility for defining colors within HTML documents.
The following color code chart contains the 16 official HTML color names from the HTML 3.2 specification, which became an official recommendation on 14 January 1997.
The same color names were included in the HTML 4.01 specification, which became an official recommendation on 24 December 1999.
These colors were originally picked as being the standard 16 colors supported with the Windows VGA palette.
Color Name | Hex Code RGB |
Decimal Code RGB |
---|---|---|
Black | 000000 | 0,0,0 |
Silver | C0C0C0 | 192,192,192 |
Gray | 808080 | 128,128,128 |
White | FFFFFF | 255,255,255 |
Maroon | 800000 | 128,0,0 |
Red | FF0000 | 255,0,0 |
Color Name | Hex Code RGB |
Decimal Code RGB |
---|---|---|
Purple | 800080 | 128,0,128 |
Fuchsia | FF00FF | 255,0,255 |
Green | 008000 | 0,128,0 |
Lime | 00FF00 | 0,255,0 |
Olive | 808000 | 128,128,0 |
Yellow | FFFF00 | 255,255,0 |
Color Name | Hex Code RGB |
Decimal Code RGB |
---|---|---|
Navy | 000080 | 0,0,128 |
Blue | 0000FF | 0,0,255 |
Teal | 008080 | 0,128,128 |
Aqua | 00FFFF | 0,255,255 |
RGB & Hexadecimal
Despite the limited number of color names, both specifications allowed the use of hexadecimal notation. For example #FF000
to represent red
. So it was still possible to use a wide range of colors outside of the color names.
However, due to the limitations of computer monitors at the time, web designers often limited themselves to just the web safe colors.
CSS1 & CSS2
Both the CSS1 specification (17 Dec 1996) and the CSS2 specification (12 May 1998) included the same 16 color names that were defined in HTML 3.2 and HTML 4.0.
As with the HTML specifications, CSS supported the use of hexadecimal notation to specify colors outside this range.
But CSS also introduced the rgb()
function, which allows colors to be specified as a comma-separated list of three digits, with each set of digits in the 0-255 range. For example, rgb(255,0,0)
represents the same color as #FF000
and the color name red
.
System Colors
In addition to being able to assign color keyword values (color names, hex values, RGB), CSS2 allowed authors to specify colors in a manner that integrated them into the user's graphic environment.
The following lists additional values for color-related CSS values and their general meaning.
- ActiveBorder
- Active window border.
- ActiveCaption
- Active window caption.
- AppWorkspace
- Background color of multiple document interface.
- Background
- Desktop background.
- ButtonFace
- Face color for three-dimensional display elements.
- ButtonHighlight
- Dark shadow for three-dimensional display elements (for edges facing away from the light source).
- ButtonShadow
- Shadow color for three-dimensional display elements.
- ButtonText
- Text on push buttons.
- CaptionText
- Text in caption, size box, and scrollbar arrow box.
- GrayText
- Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.
- Highlight
- Item(s) selected in a control.
- HighlightText
- Text of item(s) selected in a control.
- InactiveBorder
- Inactive window border.
- InactiveCaption
- Inactive window caption.
- InactiveCaptionText
- Color of text in an inactive caption.
- InfoBackground
- Background color for tooltip controls.
- InfoText
- Text color for tooltip controls.
- Menu
- Menu background.
- MenuText
- Text in menus.
- Scrollbar
- Scroll bar gray area.
- ThreeDDarkShadow
- Dark shadow for three-dimensional display elements.
- ThreeDFace
- Face color for three-dimensional display elements.
- ThreeDHighlight
- Highlight color for three-dimensional display elements.
- ThreeDLightShadow
- Light color for three-dimensional display elements (for edges facing the light source).
- ThreeDShadow
- Dark shadow for three-dimensional display elements.
- Window
- Window background.
- WindowFrame
- Window frame.
- WindowText
- Text in windows.
These system colors have been deprecated in CSS3. They were initially replaced by the appearance
property, but that was subsequently dropped from the CSS3 specification.
CSS 2.1
The CSS 2.1 specification (07 June 2011) added orange to the list of color names, bringing the total to 17 color names.
Interestingly, CSS Color Module Level 3 became an official recommendation on the same day, and provided 147 color names. More on that below.
System Colors
CSS 2.1 also included the various system colors that were specified in CSS2 (above).
CSS3
CSS3 changed the way that CSS is defined.
CSS3 consists of many different modules, each with a specific focus. For example, there's a module for backgrounds and borders, another for text, a module for grid layouts, another for colors, etc.
This is in contrast to previous specs, where, CSS was released as a whole specification. For example, CSS2, CSS 2.1, etc. All aspects of CSS were included in each specification.
So now, colors are defined in the "CSS Color Module". CSS3 started with CSS Color Module Level 3, which became an official recommendation on 07 June 2011 (the same date that CSS 2.1 became an official recommendation!). It then proceded to CSS Color Module Level 4. But it's all considered to be CSS3. Only the specific module number changes now.
So the colors in the chart at the top of this page can all be considered "CSS3 colors".
CSS3 also introduced the currentColor
keyword, as well as new color functions, such as hsl()
and hsla()
. At the time of writing, CSS Color Module Level 4 proposes hwb()
, gray()
, color()
, and other features.