Kadben

Colour converter: HEX, RGB, HSL, HWB, OKLCH

Type or pick one colour in any CSS form. The page writes it as HEX, rgb(), hsl(), hwb(), oklab() and oklch(), with its transparency, and tells you when an OKLCH colour lies outside what sRGB screens can show.

Runs in your browser. Nothing is uploaded.

Colour converter

Any CSS colour: #ff5733, rgb(255 87 51), hsl(11 100% 60%), hwb(11 20% 0%), oklch(0.68 0.21 34), a name such as “teal”; with transparency after “/”.

    How to use it

    1. Type a colour such as #ff5733, rgb(255 87 51) or oklch(0.68 0.21 34), or pick one with the colour button.
    2. Read it in every format; each line has a Copy button.
    3. Tick “Commas” for the older rgba(255, 87, 51, 0.5) style, or “Capital letters” for #FF5733.

    Rules and limits

    How colours are read and written

    Tested limits

    Questions and answers

    Why use OKLCH instead of HSL?

    HSL lightness is not what the eye sees: yellow and blue at 50% look very different. OKLCH is built to follow perceived lightness, so changing only the chroma or the hue keeps the colour about as light, which helps with palettes and contrast.

    Why does my OKLCH colour come back as a different HEX?

    Many OKLCH colours are brighter or more saturated than an sRGB screen can show. The page then limits each red, green and blue value to the screen’s range and says so; a browser may map such a colour differently, so pick a lower chroma if the exact look matters.

    Will the HEX value give back exactly my HSL numbers?

    Not always. HEX keeps 8 bits per channel, so an HSL value with decimals is rounded to the nearest of 16.7 million colours, and reading the HEX gives the HSL of that colour.

    Is anything sent anywhere?

    No. The conversion runs in your browser and the page sends nothing. The typed colour is kept only in this tab, like other tools’ options.

    Related tools