Color Converter & Contrast Checker

Convert between HEX, RGB, HSL and OKLCH, and check text contrast against WCAG.

HEX
RGB
HSL
OKLCH

Contrast ratio

The color entered above is used as the background.

Large text sample

Normal-size text sample. Check how comfortable it is to read.

Everything you enter is processed inside this browser and is never sent to a server.

How to use it

The formats

FormatExampleNotes
HEX#1f6f5cThe most common web format. Two extra digits add transparency
RGBrgb(31, 111, 92)Red, green and blue from 0 to 255
HSLhsl(165.8, 56.3%, 27.8%)Hue, saturation and lightness, convenient for making a color lighter or darker
OKLCHoklch(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:

LevelNormal textLarge text
AA (the usual target)4.5 : 1 or more3 : 1 or more
AAA (enhanced)7 : 1 or more4.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.