HomeDevWeb color codes
Color tools

Web color codes

Web colors for HTML and CSS: browse the basic 16 names, jump to hue family shade pages, and convert #RGB shorthand to #RRGGBB. No account needed.

Loading tool…

Loading Preparing tool…

How to use

Follow these steps for a clear answer.

1

Explore a section

Switch between the basic 16 colors, hue family links, and HEX shorthand conversion.

2

Copy a code

Click a basic swatch or convert #RGB ↔ #RRGGBB, then copy HEX or use the CSS keyword.

3

Open a family page

Use family cards for deeper shade tables (red, blue, gray, and more).

Color formulas

Core relationships used by this color tool.

Hex triplet#RRGGBB
Shorthand hex#RGB → #RRGGBB (e.g. #0AF → #00AAFF)
Named colorcolor: tomato;
RGB functionrgb(R, G, B)
iShorthand works only when each channel pair repeats (F0A → FF00AA). Named colors map to fixed sRGB values shared by HTML and CSS.

Example colors

Common picks with formula and result.

ϟ

Shorthand sky

3-digit expand

#0AF
#00AAFF
ϟ

Basic navy

VGA keyword

color: navy;
#000080
ϟ

Full white

Max channels

#FFF or #FFFFFF
rgb(255, 255, 255)
ϟ

CSS custom property

Theme token

--primary: #2563EB;
Reusable in var(--primary)

Web color codes specification

Version 1.0.0

Definition
Web colors are the colors used in HTML and CSS—hex triplets (#RRGGBB or shorthand #RGB), CSS named keywords, and functional notations such as rgb() and hsl(). Modern browsers support the full 24-bit sRGB gamut (16,777,216 colors) plus about 148 named colors.
What it calculates
Reference lookup for basic named colors, family navigation, and HEX shorthand expansion/contraction.
Inputs
  • Section mode (basic 16, families, or HEX shorthand)
  • Optional 3- or 6-digit hex for shorthand conversion
Outputs
  • HEX codes for basic colors
  • Links to hue family shade pages
  • Expanded or shortened hex forms
Formula
#RGB → #RRGGBB by doubling each digit; named colors → fixed sRGB

Web colors combine three ideas: hex triplets for exact channel values, named keywords for common presets, and family shade pages when you need related tones for UI systems.

Accessibility tip: do not rely on color alone. Check contrast between text and background (black vs white on a swatch is a quick start). For the full keyword chart, use HTML color codes; for channel math, use the RGB color chart.

:root {
  --primary: #2563EB;
  --secondary: #F97316;
  --bg: #FFFFFF;
  --text: #1F2937;
}

body {
  background-color: var(--bg);
  color: var(--text);
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
Primary & secondary (additive)
ColorHEXRGBHSL
Red#FF0000255, 0, 00°, 100%, 50%
Lime (green)#00FF000, 255, 0120°, 100%, 50%
Blue#0000FF0, 0, 255240°, 100%, 50%
Yellow#FFFF00255, 255, 060°, 100%, 50%
Cyan / Aqua#00FFFF0, 255, 255180°, 100%, 50%
Magenta / Fuchsia#FF00FF255, 0, 255300°, 100%, 50%
i These six are the additive primaries and secondaries on screens. Lime is pure green (#00FF00); the keyword green is the darker #008000.
Assumptions
  • Named colors follow CSS Color Module mappings.
  • Tool runs locally; nothing is uploaded.
  • Shorthand exists only when each channel’s two hex digits are identical.
Units
  • HEX: #RGB or #RRGGBB
  • RGB implied 0–255 per channel
Boundary conditions
  • Invalid hex input leaves conversion unchanged until valid digits are entered.
  • Non-pairable 6-digit hex cannot shorten to #RGB.
Example
#0AF → #00AAFF
Validation cases
  • #F00 → #FF0000
  • #FFFFFF → shortens to #FFF
  • navy → #000080
  • #123456 → no 3-digit shorthand
Sources
  • CSS Color Module / HTML named colors
  • sRGB hex triplet notation (including CSS shorthand)
Calculation version
1.0.0

Frequently asked questions

Key distinctions behind the tool.

What are web colors?

Colors specified for HTML and CSS using hex codes, named keywords, or functions like rgb() and hsl(). They style text, backgrounds, borders, and other visual properties.

What is a hex triplet?

A six-digit hex value #RRGGBB giving red, green, and blue from 00 to FF. Shorthand #RGB expands each digit (for example #F0A becomes #FF00AA).

How many web colors can I use?

Modern browsers support all 16.7 million 24-bit RGB colors, plus about 148 CSS named colors. The old 216 “web-safe” palette is optional history, not a hard limit.

What are the basic 16 HTML colors?

The original named set: black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, and aqua.

Where do I find shade tables?

Open a family page from the Families tab (for example Blue or Gray), or browse the full named list on HTML color codes.