Convert between OKLCH, OKLab, Lab, LCH, Display P3 and sRGB, and see what a colour outside sRGB costs when it is brought back in.
Waiting for a colour
Reads hex, rgb(), hsl(), oklch(), oklab(), lab(), lch() and color(), and says what each one costs.
Try
Nothing to convert yet
Enter a colour, or load the example to see a gold that no hex value can hold.
OKLCH Color Converter runs entirely on your device. Swatches are painted with the sRGB fallback on purpose — on a wide-gamut display the real colour would hide the difference this page is about.
You’re on the Free plan. Compare plans
`oklch()` is worth writing because it is perceptually uniform: change the lightness and only the lightness changes, which is what makes a palette built in it behave. The catch is that it can describe colours no sRGB screen can show, and a hex value for one of those does not exist.
Most converters return one anyway. Whatever comes back is a different colour, chosen by whichever rule that converter happened to implement, and nothing says so.
This does the conversion and shows the decision. When a colour fits, every notation is the same colour and the page says so. When it does not, you get both of the usual answers side by side: clip each channel into range, or hold lightness and hue and give up chroma the way CSS Color 4 specifies.
The error is broken into lightness, chroma and hue rather than rolled into one distance, and that breakdown is the point. Clipping often scores a *smaller* total error while putting almost all of it into hue — and hue is the component the eye reads as a different colour rather than a duller one. A saturated gold clipped into sRGB comes back orange-brown with a hue shift of about 25 degrees.
Swatches are painted with the sRGB fallback deliberately. On a wide-gamut display the real colour would render correctly and hide the difference this page exists to show.
Because for a colour outside sRGB there is no correct hex, only a choice. Converters that clip each channel and converters that gamut map give different answers, and most do not say which they did. Both are shown here so you can pick rather than inherit one.
Often it has a smaller number and is still the worse choice. Total distance adds lightness, chroma and hue together, and they are not interchangeable: losing chroma reads as a duller version of the same colour, while shifting hue reads as a different colour. Mapping concentrates the loss in the component people forgive.
A wider gamut that most recent phones and laptops can show. A colour outside sRGB but inside P3 displays correctly on those screens through color(display-p3 …), with the sRGB value as a fallback for everything else.
CIE Lab is defined against D50 and everything else here against D65, so a Bradford adaptation sits between them. Skipping it is the usual reason a hand-rolled Lab conversion is slightly wrong in a way that never looks wrong.
No. Every conversion is arithmetic in this page, following CSS Color 4, so the numbers are the same whatever your browser implements. Only the swatches depend on your screen.
If a tool here saved you some time, you can put something towards the hosting.Buy me a coffee, on Ko-fi, opens in a new tab