How to use it
- Convert: type a color or pick one with the color picker to see it as HEX, RGB, HSL and OKLCH. Inputs such as
#ff5733,rgb(255 87 51),hsl(11 100% 60%)and CSS names liketomatoall work. - Contrast: the color above is used as the background and “Text color” as the foreground. The tool reports the contrast ratio and which WCAG levels it meets.
The formats
| Format | Example | Notes |
|---|---|---|
| HEX | #1f6f5c | The most common web format. Two extra digits add transparency |
| RGB | rgb(31, 111, 92) | Red, green and blue from 0 to 255 |
| HSL | hsl(165.8, 56.3%, 27.8%) | Hue, saturation and lightness, convenient for making a color lighter or darker |
| OKLCH | oklch(48.88% 0.0819 173.48) | A modern format whose lightness matches human perception, great for consistent palettes. Supported in CSS by all major browsers |
Contrast ratio and WCAG
The contrast ratio compares the brightness of text and background, from 1:1 (no difference) to 21:1 (black on white). WCAG 2, the international web accessibility standard, asks for:
| Level | Normal text | Large text |
|---|---|---|
| AA (the usual target) | 4.5 : 1 or more | 3 : 1 or more |
| AAA (enhanced) | 7 : 1 or more | 4.5 : 1 or more |
“Large text” means roughly 18 point (24px) or larger, or 14 point (about 18.7px) bold or larger.
The check uses the unrounded value, so 4.499… is shown as 4.49 and does not meet AA.
Frequently asked questions
Why does my OKLCH color change slightly?
OKLCH can describe colors more vivid than a standard (sRGB) screen can show. The tool then displays the nearest color it can show and tells you so.
Can it check semi-transparent colors?
Not reliably, because the result depends on what is underneath. Check the final, opaque color instead.