Developer tools

Color converter and contrast checker

Convert any CSS color to hex, RGB, HSL and OKLCH, and check a color pair against the WCAG contrast levels.

Runs in your browser. Nothing you enter is uploaded.

Any CSS color: a name, hex, rgb(), hsl(), oklch().

Contrast

The quick brown fox jumps over the lazy dog.

Contrast ratio
AA, normal text
AA, large text
AAA, normal text
AAA, large text

About this tool

The color converter turns any CSS color into hex, RGB, HSL and OKLCH, and checks the contrast of a text and background pair against WCAG 2. The browser parses the input, so named colors and functions like hsl() or oklch() work. Alpha is ignored.

Which contrast ratios count as a pass?
AA needs 4.5:1 for normal text and 3:1 for large text. AAA needs 7:1 for normal text and 4.5:1 for large text.
How is the OKLCH value calculated?
The sRGB color is linearized and converted with Björn Ottosson’s OKLab matrices, then written as lightness in percent, chroma and hue in degrees.