Convert Hex to OKLab Color Space

Convert Hex colors to Cartesian perceptual oklab(L a b) coordinates for muddy-free CSS gradients and color-mix() interpolation.

0 bytes sent
  • 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

Rectangular L-a-b Interpolation Space
Input Samplecobalt.hex
#2563EB
Expected OutputOKLab
oklab(0.5462 -0.0267 -0.2135)

HEX vs OKLab

Source vs. target format specification comparison
PropertySource: HEXTarget: OKLab
Gamut scopesRGB (Standard Web)Wide Gamut (P3 / Unbounded)
Perceptual uniformityNoYes
Alpha channel supportYesYes
Human readabilityMediumMedium
Extension / Token.css / .txt.css
Best forCompact copy-paste handoff in sRGB brand guidelines and legacy CSSSmooth CSS gradients without gray dead zones, color mixing, and image shaders

How to use Hex to OKLab

Hex to OKLab — 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

When is oklab() preferable to oklch()?

Use oklab() for linear gradient interpolation or color-mix() because straight lines avoid hue-wrapping artifacts.

How do OKLab a and b relate to OKLCH Chroma and Hue?

C equals sqrt(a^2 + b^2) and Hue H equals atan2(b, a) in degrees around the same Lightness L.