CSS Color Level 4 Converter (HWB, LAB, LCH, OKLAB, Display P3)

Converts a colour written in any common CSS format into hex, rgb, hsl, hwb, lab, lch, oklab, oklch and display-p3.

Use the tool

Why this tool exists

Modern CSS accepts hwb(), lab(), lch(), oklab() and oklch(), but design tools still hand you hex. You need the same colour in both worlds.

Enter one colour per line. The output lists every format with alpha kept. If a colour is outside sRGB, the hex, rgb, hsl and hwb lines are clipped and the page says so. Values were compared with a browser engine for five colours and match to the shown digits; the last digit can still differ.

How to use it

  1. Paste one colour per line.
  2. Read all formats for each.
  3. Check the out-of-gamut note if shown.
  4. Copy the format you need.

Frequently asked questions

Which inputs work?

Hex with 3, 4, 6 or 8 digits, rgb(), hsl(), hwb(), lab(), lch(), oklab() and oklch(), with or without commas and alpha.

Why is a value clipped?

The colour lies outside sRGB. LAB, OKLAB and P3 keep the real colour.

Are colour names supported?

No. Use the colour names lookup.

Is it uploaded?

No.