CSS to Tailwind Converter
Turn a stylesheet into Tailwind utility classes, with variants for hover and breakpoints.
HEX and RGB to the OKLCH colour space for modern CSS — and back, gamut-mapped.
Paste an oklch() value to convert the other way — out-of-gamut colours are mapped into sRGB the way CSS does it.
The HEX to OKLCH Converter turns HEX, RGB and named colours into CSS oklch() values and converts oklch() back to HEX with CSS Color 4 gamut mapping, showing lightness, chroma and hue and a fallback rule.
OKLCH is the colour space modern CSS is moving to. Its lightness is perceptual — two colours with the same L really do look equally light — which makes it far better than HSL for building palettes, hover states and accessible contrast, and it can describe the wider colours of P3 displays. Tailwind CSS v4 defines its whole palette in it.
Paste a HEX, RGB or named colour and get the oklch() value, at CSS-friendly or full precision, with its lightness, chroma and hue broken out and a ready-made CSS rule with a HEX fallback. Paste an oklch() value to go the other way: colours outside the sRGB gamut are mapped the way the CSS specification describes, by reducing chroma while keeping lightness and hue.
Uses the OKLab definition adopted by CSS, verified against the specification’s red.
Out-of-gamut OKLCH colours are brought into sRGB by reducing chroma, as browsers do.
A CSS rule with a HEX fallback followed by the oklch() value, ready to paste.
Short values for stylesheets or full precision for design tokens.
Lightness, chroma and hue are shown separately with a gamut check.
HEX, rgb(), a name, or an oklch() value to convert back.
CSS-friendly rounding or full precision for design tokens.
Lightness, chroma and hue are shown separately, with a gamut check.
Take the oklch() value alone or the rule with a HEX fallback.
A cylindrical form of the OKLab colour space: L is perceived lightness, C is chroma (colourfulness) and h is the hue angle. It was designed by Björn Ottosson in 2020.
Yes, all current browsers — Chrome and Edge 111+, Safari 15.4+ and Firefox 113+. The fallback snippet covers anything older.
HSL lightness is not perceptual: a yellow and a blue with the same HSL lightness look very different in brightness. OKLCH fixes that, so generated shades are consistent.
An OKLCH colour sRGB cannot show is mapped by lowering its chroma until it fits, keeping lightness and hue — the method in the CSS Color 4 specification.
What people who use the HEX to OKLCH Converter think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the HEX to OKLCH Converter. It takes half a minute and no account.
Write the first reviewTurn a stylesheet into Tailwind utility classes, with variants for hover and breakpoints.
Make a real .xlsx from CSV — typed columns, frozen header, filters, no import wizard.
Move between kilo, mega, milli, micro, nano and every SI prefix — exactly.
Turn forum BBCode into safe, escaped HTML — lists, quotes, code and colours.
Read an EPUB as plain text — chapter by chapter, in reading order.
Lakh and crore to million and billion, and back — exactly.
Read Unicode braille back as ordinary text, capitals and numbers included.
See the real CSS behind any Tailwind class, generated by Tailwind itself.