Color Picker & Converter
Choose a color and read it as HEX, RGB or HSL. Contrast ratios are calculated against black and white text.
Preview text
—
HEX, RGB and HSL explained
- HEX — three pairs of hexadecimal digits for red, green and blue.
#4F46E5means 79 red, 70 green, 229 blue. A shorthand such as#f0aexpands to#ff00aa. - RGB — the same three channels as decimal numbers from 0 to 255, sometimes with a fourth alpha channel.
- HSL — hue (0–360°), saturation (%), lightness (%). Easier to reason about when you want a lighter or more muted version of the same color: keep the hue, adjust the other two.
Why contrast matters
Text needs enough contrast against its background to be readable, especially for people with low vision. The WCAG standard requires a ratio of at least 4.5:1 for normal body text and 3:1 for large text; the stricter AAA level asks for 7:1. This tool computes the ratio using the official relative-luminance formula, so you can check a palette before shipping it.
A note about "perceptual" color
HEX and RGB are how screens mix light, not how humans perceive it. Two colors with the same numeric difference in RGB can feel very different in brightness — which is exactly why contrast should be measured with luminance rather than by eye.