ColorToolkits
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

  1. Enter or paste your HEX value or choose one of the curated preset swatches.
  2. Copy the formatted OKLab value directly, or inspect the secondary HEX, RGB, HSL, and OKLCH chips below.
  3. 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

More Color Tools

View all tools →