HEX to OKLCH converter
Enter a HEX value such as #3A86FF to convert it to OKLCH. Every other format is shown too, and the result updates as you type.
Detected HEX.
Examples: #1e90ff, rgb(30 144 255 / 50%), hsl(210 100% 56%), oklch(0.65 0.18 255), cmyk(88% 44% 0% 0%), tomato
- Name
- Blue(descriptive)
- Alpha
- 100%
- Relative luminance
- 0.2517
- Perceived lightness (OKLCH L)
- 63.7%
- Contrast on white
- 3.48:1
- Contrast on black
- 6.03:1
Converted values
- HEX
#3a86ff - RGB
rgb(58 134 255) - HSL
hsl(216.9 100% 61.4%) - HSV / HSB
hsv(216.9 77.3% 100%) - HWB
hwb(216.9 22.7% 0%) - OKLCH
oklch(63.71% 0.1953 259.51) - OKLAB
oklab(63.71% -0.0356 -0.192) - CIELAB
lab(56.18% 9.11 -68.23) - CMYK
cmyk(77% 47% 0% 0%)
CMYK is a naive, device-independent approximation. Real print colours depend on the ink, paper and ICC profile your printer uses, so ask your printer for a proofed conversion. HSV/HSB is not a CSS format and is shown for design apps. CIELAB uses the D50 white point, as in CSS lab().
How to convert HEX to OKLCH
- Convert HEX to RGB and linearise each channel (undo the sRGB gamma curve).
- Multiply by the OKLab matrix to get cone-like responses, then take the cube root.
- A second matrix gives OKLab L, a and b.
- Chroma is √(a² + b²) and hue is atan2(b, a) in degrees, giving oklch(L C H).
About HEX
A HEX code writes the red, green and blue channels of an sRGB colour as two hexadecimal digits each (00–FF), so #FF5733 means red 255, green 87, blue 51. An optional fourth pair adds transparency, and three-digit shorthand such as #F53 doubles each digit.
About OKLCH
OKLCH is a perceptual colour space: L is perceived lightness (0–100%), C is chroma (colourfulness) and H is hue. Equal steps look roughly equal to the eye, which makes it the best choice for building colour scales and accessible palettes. Supported natively in CSS.