Format Converter
Hex to OKLab Converter
Convert HEX codes to CSS Color 4 oklab(L a b) coordinates for smooth non-muddy UI gradients and animations.
Converted (OKLab)
oklab(0.585 0.025 -0.202)
#6366F1
Try presets:
How to Use This Tool
- Enter or paste your HEX value or choose one of the curated preset swatches.
- Copy the formatted OKLab 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
- OKLab applies Bjorn Ottosson calibrated M1/M2 cone matrices with cube-root compression so linear midpoint interpolation never loses perceptual saturation.
- Instant clipboard feedback with live OKLCH and Display-P3 gamut safety
- Zero server round-trips—every calculation executes immediately in browser memory
Linear sRGB → Cone LMS → OKLab (L, a, b)
OKLab applies Bjorn Ottosson calibrated M1/M2 cone matrices with cube-root compression so linear midpoint interpolation never loses perceptual saturation.
Reference Snippet (CSS Color 4)
.gradient {
background: linear-gradient(to right in oklab, #6366f1, #ec4899);
}Frequently Asked Questions
Use OKLab for color-to-color fades when crossing neutral gray (straight path), and OKLCH for colorful hue sweeps.
More Color Tools
View all tools →Color Converter
Convert single or bulk colors across HEX, RGB, HSL, OKLCH, P3, CMYK, and mobile formats.
Open tool
Color Picker & Eyedropper
Pick exact colors in HEX, RGB, HSL, or OKLCH and sample pixels directly from your screen.
Open tool
Tailwind Color Scale
Turn any brand color into a balanced 50–950 Tailwind scale with live contrast checks.
Open tool
Contrast Checker
Check text and UI contrast against WCAG AA/AAA and APCA standards, with 1-click fixes.
Open tool