Skip to content
Dev Utilities

Color converter

Convert between hex, RGB, HSL and OKLCH

1.00

#663399

Read as a hex value · matches the named colour rebeccapurple

Hex

#663399

Short form: #639

RGB

rgb(102 51 153)

HSL

hsl(270 50% 40%)

OKLCH

oklch(44.027% 0.1603 303.373)

Lightness, chroma, hue. Digits are deliberate: fewer and this value does not return the same hex when pasted back

OKLab

oklab(44.027% 0.08818 -0.13386)

CSS colour name

rebeccapurple

An exact match, not the nearest one — this tool never guesses a name

About the conversion

OKLCH is computed in this tab: sRGB → linear sRGB through the piecewise IEC 61966-2-1 transfer function (not a 2.2 power) → CIE XYZ D65 → OKLab, following Björn Ottosson's A perceptual color space for image processing (2020). Nothing is read back out of the browser with getComputedStyle, so the answer does not shift between engines.

Deliberately out of scope: lab(), lch(), hwb(), color() and color-mix(). Each needs either a second gamut such as Display P3 or a resolution context a static page does not have, and a half-right answer about a wide-gamut colour is worse than none.