Color Converter
Hex ↔ RGB ↔ HSL with a live preview and WCAG contrast against a chosen background.
Conversions
Preview
Hex
—
RGB
—
HSL
—
Contrast ratio
—
WCAG AA (normal text)
—
WCAG AAA (normal text)
—
The color spaces
- Hex — #RRGGBB, two hex digits per channel. CSS-friendly, ubiquitous.
- RGB — rgb(r, g, b), three values 0–255. What pixels actually emit.
- HSL — hue (0–360°), saturation (0–100%), lightness (0–100%). The format closest to how humans describe colors.
WCAG contrast
WCAG (Web Content Accessibility Guidelines) measures readability as the ratio between a foreground and background's relative luminance:
- AA Normal: needs 4.5:1 — body text.
- AA Large (18pt+): needs 3:1 — headings.
- AAA Normal: needs 7:1 — the higher accessibility tier.
Pure black on white is 21:1 (the maximum). Anything below 3:1 is unreadable for many people.