Convert Hex to OKLCH CSS

Transform legacy Hex colors into perceptually uniform W3C oklch() strings with live gamut verification — 100% locally in your browser.

CSS Color 4
  • 100% browser-local
  • Zero server transfers
  • CSS Color 4 precision

or drop a color string, CSS/JSON snippet, or file here · Ctrl V to paste · Paste Hex, RGB, HSL, OKLCH or use Screen Eyedropper

Instant Before & After Specimen

Perceptual OKLCH + P3 Check
Input Samplebrand-primary.hex
#2563EB
Expected OutputOKLCH
oklch(0.5462 0.2152 262.88)

HEX vs OKLCH

Source vs. target format specification comparison
PropertySource: HEXTarget: OKLCH
Gamut scopesRGB (Standard Web)Wide Gamut (P3 / Unbounded)
Perceptual uniformityNoYes
Alpha channel supportYesYes
Human readabilityMediumHigh
Extension / Token.css / .txt.css / .json
Best forCompact copy-paste handoff in sRGB brand guidelines and legacy CSSPerceptually uniform UI palettes, Tailwind v4 design tokens, and wide-gamut CSS

How to use Hex to OKLCH

Hex to OKLCH — cleanly inside your local browser with zero server transfers.

  1. Enter or pick a colorType Hex, RGB, HSL, OKLCH, or Lab — or click Screen Eyedropper and live sliders.
  2. Inspect math & gamutReview exact CSS Color 4 readouts, sRGB vs Display P3 status, and profile options.
  3. Copy, chain, or exportCopy ready CSS/JSON snippets, download binary swatch files, or pipe directly to related Colr tools.

Frequently asked questions

Does converting Hex to OKLCH change how the color renders on sRGB screens?

No. The converted oklch() coordinate points to the exact same D65 sRGB color until you intentionally raise Chroma toward Display P3.

What decimal precision should I keep for Tailwind v4 or CSS tokens?

Three decimal places on Lightness and Chroma (plus 1 decimal on Hue) keeps round-trip error below 0.1 sRGB channel steps.