Free ToolsGuidesCase StudiesResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/frontend-tools/color-format-converter

Color Format Converter

ToolRuns in your browserNothing is uploadedFree · no sign-up

Enter a colour in any CSS format, or pick one, and get it in every other format at once: HEX, HEX with alpha, RGB, HSL, HWB, OKLCH and approximate CMYK. Click any value to copy it.

    Using the Color Format Converter

    Which format to use

    HEX is compact and universal. RGB and HSL are easy to read and support transparency. HSL is handy for making lighter or darker versions of a colour by changing one number. OKLCH, the newest, is perceptually uniform: changing lightness by the same amount looks like the same change across different hues, which makes it ideal for generating palettes.

    How parsing works

    The converter lets the browser itself read your input, so anything valid in CSS works, including named colours such as rebeccapurple, rgb() with or without commas, hsl() and oklch(). The conversions are then calculated from the resulting sRGB value.

    About CMYK

    CMYK describes ink on paper and depends on the printer and paper profile. The CMYK shown is a simple mathematical conversion, fine as a starting point for print briefs but not a substitute for a colour-managed proof.

    Wide-gamut colours

    OKLCH can describe colours outside the sRGB range that some modern screens can show. The converter works in sRGB, so very saturated OKLCH input is clipped to the nearest displayable sRGB colour.

    Working with transparency

    Every format except CMYK can carry an alpha channel for transparency. In modern CSS the slash syntax works for all of them, such as rgb(91 140 255 / 0.5) or oklch(68% 0.16 262 / 0.5). Eight-digit HEX stores alpha as the last two characters, so 80 means about 50 percent opacity.

    How do I convert HEX to RGB?

    Type or paste the HEX value, for example #3b82f6, and the RGB value appears at once. Each pair of hex digits is one channel: 3b is 59 red, 82 is 130 green and f6 is 246 blue.

    When is OKLCH better than HSL?

    In HSL, two colours with the same lightness can look very different in brightness, for example yellow and blue at 50%. OKLCH is designed so that equal lightness values look equally light, which makes it easier to build colour scales that stay readable.

    Frequently asked questions

    Can I convert colours with transparency?

    Yes. Alpha is kept in the HEX8, RGB, HSL, HWB and OKLCH outputs.

    Why is my OKLCH value slightly different from my input?

    Values are rounded for readability, and colours outside sRGB are clipped.

    Is there a palette tool?

    Yes. The CSS colour palette generator builds harmonies and a 50 to 900 scale from one colour.

    Which format should I put in my CSS?

    HEX is the most common and works everywhere. HSL or OKLCH is easier when you want to adjust lightness or build a scale. All modern browsers understand all of them.

    Is the CMYK value accurate for printing?

    No. It is a simple mathematical conversion, while real print colours depend on the printer, paper and colour profile. Ask your printer for a proof when colour matters.