WCAG 2 ratio with AA and AAA results, plus a suggested fix
Color Picker and Converter
Type or pick one colour and get it in every CSS format, with a clear warning when a format cannot hold it.
Loading tool…
How to use color picker and converter
Type a colour in any CSS syntax, open the colour picker, or use Pick from screen in Chrome and Edge.
Read it in eleven formats at once; each row has its own copy button.
Nudge lightness, chroma and hue with the OKLCH sliders to get a related colour.
If a warning appears, the colour is outside sRGB and the rows marked mapped show the nearest colour that fits.
What this tool does
- Reads HEX with 3, 4, 6 or 8 digits, rgb(), hsl(), hwb(), lab(), lch(), oklab(), oklch(), color() in srgb, srgb-linear, display-p3 and xyz, and every CSS colour name.
- Uses the matrices and transfer functions published in CSS Color 4, so OKLCH and Lab values match what browsers compute.
- Detects colours outside sRGB and outside Display P3, and maps them back with the CSS Color 4 chroma reduction method instead of clipping.
- Keeps alpha through every conversion and shows the colour next to its sRGB version so you can see what mapping changed.
How the result is verified
Every CSS string the tool prints is parsed again and compared with the input in OKLab; the page says so when all of them land within 0.0005 of the original.
Frequently asked questions
Why does my OKLCH colour show a different HEX value?
Your OKLCH colour is more saturated than sRGB can show. HEX, RGB and HSL can only describe sRGB, so the tool lowers chroma at the same lightness and hue until it fits, as the CSS Color 4 specification recommends. The OKLCH value itself is unchanged.
Should I write colours in OKLCH?
It is a good choice for design systems: equal steps in lightness look equal, and hue does not drift when you change lightness. Every current major browser supports oklch(). Keep a HEX fallback only if you must support browsers from before 2023.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
50 to 950 scales, harmonies and tints from one colour
Pick exact HEX, RGB and HSL colours from any image
Linear, radial and conic gradients with OKLCH blending, CSS and PNG
Simulate a palette for four colour blindness types and flag clashing pairs