Hex to OKLCH Converter
Convert legacy HEX strings into modern perceptual CSS OKLCH coordinates with Display-P3 awareness and Tailwind v4 variable formatting.
How to Use This Tool
- Enter or paste your HEX value or choose one of the curated preset swatches.
- Copy the formatted OKLCH value directly, or inspect the secondary HEX, RGB, HSL, and OKLCH chips below.
- Click into Tailwind Scale Generator or Contrast Checker to validate accessibility on the converted shade.
Key Features
- Bidirectional parsing supporting CSS Color Level 4 syntax cleanly
- Hex decodes from gamma sRGB to linear light, transforms via a 3x3 cone-response matrix into cube-root OKLab coordinates (L, a, b), then converts cartesian (a, b) into Chroma C and Hue angle H.
- Instant clipboard feedback with live OKLCH and Display-P3 gamut safety
- Zero server round-trips—every calculation executes immediately in browser memory
Linear sRGB -> OKLab -> Cylindrical OKLCH
Hex decodes from gamma sRGB to linear light, transforms via a 3x3 cone-response matrix into cube-root OKLab coordinates (L, a, b), then converts cartesian (a, b) into Chroma C and Hue angle H.
Reference Snippet (CSS Color 4)
.button-primary {
background: oklch(0.585 0.233 277.1);
}Frequently Asked Questions
OKLCH models human lightness and chroma accurately, letting design systems maintain predictable contrast and smooth wide-gamut Display-P3 vibrant colors.
Yes—Chrome 111+, Firefox 113+, Safari 15.4+, and Edge 111+ support oklch() natively.
More Color Tools
View all tools →Color Converter
Convert single or bulk colors across HEX, RGB, HSL, OKLCH, P3, CMYK, and mobile formats.
Color Picker & Eyedropper
Pick exact colors in HEX, RGB, HSL, or OKLCH and sample pixels directly from your screen.
Tailwind Color Scale
Turn any brand color into a balanced 50–950 Tailwind scale with live contrast checks.
Contrast Checker
Check text and UI contrast against WCAG AA/AAA and APCA standards, with 1-click fixes.