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

 

Color Picker Background

#
R H
G S
B V

 
Hex
RGB
HSL
HSV
HWB
CMYK

Choose Multiple Colors

Compare up to 3 colors. Click in a field below, then select a color from the color picker... Try it!

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.

#FFFFFF #FFFFCC #FFFF99 #FFFF66 #FFFF33 #FFFF00
#FFCCFF #FFCCCC #FFCC99 #FFCC66 #FFCC33 #FFCC00
#FF99FF #FF99CC #FF9999 #FF9966 #FF9933 #FF9900
#FF66FF #FF66CC #FF6699 #FF6666 #FF6633 #FF6600
#FF33FF #FF33CC #FF3399 #FF3366 #FF3333 #FF3300
#FF00FF #FF00CC #FF0099 #FF0066 #FF0033 #FF0000
#CCFFFF #CCFFCC #CCFF99 #CCFF66 #CCFF33 #CCFF00
#CCCCFF #CCCCCC #CCCC99 #CCCC66 #CCCC33 #CCCC00
#CC99FF #CC99CC #CC9999 #CC9966 #CC9933 #CC9900
#CC66FF #CC66CC #CC6699 #CC6666 #CC6633 #CC6600
#CC33FF #CC33CC #CC3399 #CC3366 #CC3333 #CC3300
#CC00FF #CC00CC #CC0099 #CC0066 #CC0033 #CC0000
#99FFFF #99FFCC #99FF99 #99FF66 #99FF33 #99FF00
#99CCFF #99CCCC #99CC99 #99CC66 #99CC33 #99CC00
#9999FF #9999CC #999999 #999966 #999933 #999900
#9966FF #9966CC #996699 #996666 #996633 #996600
#9933FF #9933CC #993399 #993366 #993333 #993300
#9900FF #9900CC #990099 #990066 #990033 #990000
#66FFFF #66FFCC #66FF99 #66FF66 #66FF33 #66FF00
#66CCFF #66CCCC #66CC99 #66CC66 #66CC33 #66CC00
#6699FF #6699CC #669999 #669966 #669933 #669900
#6666FF #6666CC #666699 #666666 #666633 #666600
#6633FF #6633CC #663399 #663366 #663333 #663300
#6600FF #6600CC #660099 #660066 #660033 #660000
#33FFFF #33FFCC #33FF99 #33FF66 #33FF33 #33FF00
#33CCFF #33CCCC #33CC99 #33CC66 #33CC33 #33CC00
#3399FF #3399CC #339999 #339966 #339933 #339900
#3366FF #3366CC #336699 #336666 #336633 #336600
#3333FF #3333CC #333399 #333366 #333333 #333300
#3300FF #3300CC #330099 #330066 #330033 #330000
#00FFFF #00FFCC #00FF99 #00FF66 #00FF33 #00FF00
#00CCFF #00CCCC #00CC99 #00CC66 #00CC33 #00CC00
#0099FF #0099CC #009999 #009966 #009933 #009900
#0066FF #0066CC #006699 #006666 #006633 #006600
#0033FF #0033CC #003399 #003366 #003333 #003300
#0000FF #0000CC #000099 #000066 #000033 #000000

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.

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.

maroon #800000 red #ff0000 orange #ffA500 yellow #ffff00 olive #808000
purple #800080 fuchsia #ff00ff white #ffffff lime #00ff00 green #008000
navy #000080 blue #0000ff aqua #00ffff teal #008080
black #000000 silver #c0c0c0 gray #808080

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.