Free tool

Hex to RGB, and every other format.

Type or paste a colour in any form, like #7c52ff, rgb(124, 82, 255), hsl(), oklch(), a CSS name or CMYK, and see it in every format at once: HEX, RGB, HSL, HSV, HWB, OKLCH and CMYK, plus 0 to 1 values and ready code for Swift, Android and Flutter. Click to copy. Got a whole palette? Paste the list and convert it in one go.

    Convert a list

    Reads hex (3, 4, 6 or 8 digits, with or without #), rgb(), hsl(), hwb(), lab(), lch(), oklch(), CSS names like rebeccapurple, three numbers like 124 82 255, and cmyk(51, 68, 0, 0).

    CMYK here is the plain formula. A print shop converts with its own colour profile, so printed colours can differ.

    Colours are converted in your browser. Nothing is uploaded.

    How it converts

    One colour, many spellings.

    01 / HEX and RGB

    The same numbers

    Hex is red, green and blue written in base 16: #7c52ff is 124, 82, 255. Two digits each, 00 to ff.

    02 / OKLCH

    For modern CSS

    Lightness, chroma and hue in a space that matches how we see, so changing the lightness keeps the hue steady.

    03 / Code

    Ready to paste

    Values for Swift, Android (0xAARRGGBB) and Flutter, and 0 to 1 floats for shaders and design tools.

    Questions

    Good to know.

    How do I convert hex to RGB?

    Split the six digits into three pairs and read each pair as a number from 0 to 255: #ff8000 is ff = 255, 80 = 128, 00 = 0, so rgb(255, 128, 0). Or paste it above.

    What about 8-digit hex?

    The last two digits are the alpha (opacity): #7c52ff80 is about 50 percent see-through. The converter shows it as rgba() too.

    Is the CMYK value exact for print?

    No converter can be without your printer's profile. This is the plain formula; ask the print shop for their conversion for critical colours.

    What is OKLCH?

    A newer CSS colour form: lightness, chroma and hue. It is good for making shades of a colour, because the hue stays put as the lightness changes.

    Can I convert many colours at once?

    Yes. Paste them one per line under Convert a list and choose the format.