HomeDevWeb Safe Colors Chart
Color tools

Web Safe Colors Chart

Browse the classic 216 web-safe colors (RGB steps 0, 51, 102, 153, 204, 255). Filter by channel, check any HEX for nearest safe color, and copy codes locally.

Loading tool…

Loading Preparing tool…

How to use

Follow these steps for a clear answer.

1

Browse the palette

Scan all 216 swatches built from the six channel steps.

2

Filter or check a HEX

Narrow by red, green, or blue step, or paste any HEX to see if it is safe and the nearest match.

3

Copy the code

Select a swatch and copy HEX, rgb(), or a CSS name when one exists.

Color formulas

Core relationships used by this color tool.

Channel stepsR, G, B ∈ {0, 51, 102, 153, 204, 255}
Palette size6 × 6 × 6 = 216
Hex form#RRGGBB with each pair in {00,33,66,99,CC,FF}
Nearest saferound each channel to the closest of the six steps
iA color is web-safe only when all three channels land on those steps. Nearest-safe snaps arbitrary HEX by rounding each channel independently.

Example colors

Common picks with formula and result.

ϟ

Pure red

Max red, others off

#FF0000
rgb(255, 0, 0) · web-safe
ϟ

Mid gray

Equal mid steps

#999999
rgb(153, 153, 153) · web-safe
ϟ

Not safe

Arbitrary hex

#1A2B3C
Nearest #333333
ϟ

Lime

Named + safe

#00FF00
lime · rgb(0, 255, 0)

Web-safe colors specification

Version 1.0.0

Definition
Web-safe colors are the historical 216-color palette where each RGB channel uses only six values—0, 51, 102, 153, 204, and 255 (hex 00, 33, 66, 99, CC, FF). That is 6×6×6 = 216 colors. Early 256-color displays used this set to reduce dithering; modern browsers support the full 24-bit gamut without requiring it.
What it calculates
Interactive chart of the 216 web-safe colors, channel filters, and nearest-safe HEX snapping.
Inputs
  • Optional RGB channel filter and step value
  • Optional HEX string to check
  • Selected swatch from the 216-color grid
Outputs
  • HEX (#RRGGBB) and rgb() for the selection
  • CSS keyword when the HEX matches a named color
  • Whether an arbitrary HEX is web-safe, plus nearest safe color
Formula
Safe iff R,G,B ∈ {0,51,102,153,204,255}; nearest = round each channel to closest step

Early sites limited artwork and UI chrome to this cube so pages would look predictable on 256-color monitors. Today the chart is mainly a reference and teaching tool—useful when you want evenly stepped hues, retro aesthetics, or to understand older design constraints.

For unrestricted colors use the HTML color picker or RGB color chart. For CSS keywords see HTML color codes; for basic names and #RGB shorthand see web color codes.

/* Web-safe examples */
.banner {
  background-color: #336699;
  color: #ffffff;
}
.accent {
  color: #ff6600; /* also web-safe */
}
Allowed channel values
DecimalHexFraction of 255
0000%
513320%
1026640%
1539960%
204CC80%
255FF100%
i Any combination of three values from this list is a web-safe color. Examples: #336699, #FFCC00, #00FFCC.
Assumptions
  • Palette is the classic Netscape/Microsoft 6×6×6 cube (not the full 256 VGA system palette).
  • Tool runs locally; nothing is uploaded.
  • Named labels come from exact HEX matches in the CSS named-color list.
Units
  • HEX: #RRGGBB
  • RGB: 0–255
Boundary conditions
  • Invalid HEX check input shows an error and does not change the selection.
  • Channel filter with value “Any” shows all 216 colors.
  • Ties when snapping a channel use the first closest step in ascending order.
Example
#1A2B3C → nearest #333333
Validation cases
  • #FF0000 → web-safe · rgb(255, 0, 0)
  • #999999 → web-safe · rgb(153, 153, 153)
  • #808080 → not safe · nearest #999999
  • #00FF00 → web-safe · lime
Sources
  • Classic 216-color web-safe / browser-safe palette (6×6×6 RGB cube)
  • sRGB channel quantization to six levels
Calculation version
1.0.0

Frequently asked questions

Key distinctions behind the tool.

What are web-safe colors?

The 216 colors formed when red, green, and blue each use only 0, 51, 102, 153, 204, or 255. They were designed for early 8-bit (256-color) displays so pages looked similar without heavy dithering.

Do I still need to use only 216 colors?

No. Modern screens and browsers handle millions of colors. Prefer any HEX, rgb(), or CSS named color that fits your design and contrast needs.

How do I tell if a HEX is web-safe?

Each pair of hex digits must be 00, 33, 66, 99, CC, or FF. Use the Check HEX field above to test a value and jump to the nearest safe color.

Why 51 and not 50?

255 ÷ 5 = 51, so six evenly spaced steps from 0 to 255 are 0, 51, 102, 153, 204, and 255.

Are named CSS colors all web-safe?

No. Only those whose channels fall on the six steps (for example lime #00FF00 or aqua #00FFFF). Many names like navy #000080 are not web-safe.