Why it matters
Design files, frameworks and browsers all speak different colour formats. Figma hands you hex, a design system wants HSL or OKLCH, and a client sends 'that blue, rgb(88, 101, 242)'. Converting by hand is slow and easy to get wrong, especially with opacity.
OKLCH is now supported in every major browser and is the best format for building palettes, because equal steps in lightness look equal to the eye. This converter gives you OKLCH alongside the formats you already use, so you can move a design system over gradually.
How it works
- InputA colour in hex, rgb(), hsl(), oklch() or a name
- In your browserParsed by the browser, converted with OKLab maths
- OutputHEX, RGB, HSL, HWB, OKLCH, OKLab and P3, plus CSS variables
Where it fits in a designer's workflow
- Plan
- Design
- Build
- Test
- Launch
By the numbers
Show the numbers as a table
| Format | Value |
|---|---|
| HEX | #5865f2 |
| HEX with alpha | #5865f2ff |
| RGB | rgb(88 101 242) |
| RGB (legacy) | rgb(88, 101, 242) |
| HSL | hsl(235 85.6% 64.7%) |
| HWB | hwb(235 34.5% 5.1%) |
| OKLCH | oklch(57.74% 0.2091 273.85) |
| OKLab | oklab(57.74% 0.014 -0.2086) |
| Display P3 | color(display-p3 0.3548 0.3945 0.9161) |
How to use it
- Type or paste a colour, or use the colour picker.
- Set the opacity if you need transparency.
- Copy the format you need from the list.
- Download every format as CSS variables or JSON.
FAQ
Which colour formats can I paste?
Anything a browser understands: hex (3, 4, 6 or 8 digits), rgb(), hsl(), hwb(), named colours like rebeccapurple, and the newer lab(), oklch() and color() syntax in up-to-date browsers.
Why use OKLCH?
Its lightness matches how bright colours look to people, so shades and tints made by changing L look evenly spaced. HSL lightness doesn't: yellow at 50% looks far brighter than blue at 50%.
Is the Display P3 value more vivid?
No, it's the same colour written in the P3 colour space, so the numbers differ. To use colours outside sRGB you'd choose them in P3 or OKLCH directly.
Are the values rounded?
Slightly, to keep them readable: RGB to whole numbers and the others to sensible decimals. Converting back gives the same hex.