Legacy Web-Safe Colors

Web-safe colors are a historical palette of 216 colors that was developed when computer displays could show far fewer colors than modern screens.

Using colors from this limited palette helped websites display more consistently on older computers. Modern displays can reproduce millions of colors, so web-safe colors are no longer required for web design.

Why Web-Safe Colors Were Used

Early personal computers often used displays limited to 256 colors. The exact colors available could differ between computer systems, which meant a color selected by a web designer might not be available on a visitor's display.

When a requested color was unavailable, the computer could approximate it by combining available colors in a process known as dithering. This could produce visible patterns instead of the solid color the designer intended.

The web-safe palette provided a common set of colors that could be displayed without relying on dithering on the systems for which the palette was designed.

The 216 Web-Safe Colors

The web-safe palette contains 216 colors. Although 256-color displays could theoretically provide 256 colors, the web-safe palette used a smaller set of colors that could be reproduced consistently across common computer platforms of the time.

The palette is based on six possible values for each of the red, green, and blue color channels. Combining six red values, six green values, and six blue values produces 216 colors.

6 × 6 × 6 = 216 colors

Web-Safe Color Values

Each RGB channel in a web-safe color uses one of six hexadecimal values: 00, 33, 66, 99, CC, or FF.

Hexadecimal Decimal RGB Value
00 0
33 51
66 102
99 153
CC 204
FF 255

Because every red, green, and blue channel must use one of these six values, web-safe colors can be recognized by their hexadecimal patterns.

Web-Safe Color Examples

The following colors are examples from the web-safe palette:

HEX RGB Example
#000000 rgb(0 0 0) Black
#ff0000 rgb(255 0 0) Red
#00ff00 rgb(0 255 0) Green
#0000ff rgb(0 0 255) Blue
#ffcc00 rgb(255 204 0) Yellow-Orange
#0099cc rgb(0 153 204) Blue
#ffffff rgb(255 255 255) White

For example, #0099cc is web-safe because its three channel values are 00, 99, and CC, which are all part of the six-value web-safe scale.

.example {
  color: #0099cc;
}

Web-Safe Colors and Modern CSS

Modern computers, phones, tablets, and other displays support far more colors than the 256-color displays that made the web-safe palette useful. There is no need to limit modern CSS designs to the original 216 web-safe colors.

CSS provides several ways to specify colors, including HEX, RGB, HSL, HWB, named colors, and colors with alpha transparency. Designers can choose colors based on the needs of the design rather than whether they belong to the historical web-safe palette.

The web-safe palette is still useful to understand because it is part of the history of web design and explains why certain color values and color charts were common on early websites.