Tool 05 / 08 · Color utilities · instant

Color Code Converter

Convert any color between HEX, RGB, HSL, CMYK, and OKLCH — instantly, with one-click copy for every format.

Paste HEX, rgb(91, 91, 214) or hsl(240, 60%, 60%)
HEX
RGB
HSL
CMYK
OKLCH
Recent colors

Colors you convert will appear here — saved in this browser only.

Example

One color, every format

The rose pink of a macaron shell — here's the exact same color in all five formats this converter outputs.

Pink macarons on a powder blue background

Macaron rose

HEX#D17180
RGBrgb(209, 113, 128)
HSLhsl(351, 51%, 63%)
CMYKcmyk(0%, 46%, 39%, 18%)
OKLCHoklch(66.1% 0.121 11.0)
Check it yourself

How each value is calculated and rounded

Every input is first turned into whole sRGB values from 0 to 255. The other four formats are calculated from those three numbers, so the RGB row is the reference for the rest.

Paste this

Input#336699

A web-safe blue with round RGB numbers

Expected output

HEX#336699
RGBrgb(51, 102, 153)
HSLhsl(210, 50%, 40%)
CMYKcmyk(67%, 33%, 0%, 40%)
OKLCHoklch(49.9% 0.099 250.4)

Now paste hsl(240, 60%, 60%). The HEX row shows #5C5CD6, not the default #5B5BD6, even though the default color is displayed as hsl(240, 60%, 60%). The displayed HSL is rounded; converting it back lands on a slightly different RGB value. This is expected behavior, not an error.

Input rules

What you can paste, and what the field rejects

The text field updates all five rows as you type. An input it cannot read gets a red outline, and the rows keep the last valid color.

About this tool

Why five color formats?

Every environment speaks a different color language. HEX rules the web and design handoffs, RGB is what screens actually emit, HSL is the easiest to reason about when you want "the same hue, a bit lighter", CMYK approximates ink for print work, and OKLCH is the modern CSS color space where equal steps finally look equal to the human eye. This converter keeps all five in sync from a single input, so you can grab whichever notation the job needs.

Choosing

Which format should you actually use?

All five describe the same color — they differ in what they make easy.

Gotchas

Small print of color conversion

Three things that surprise people the first time they convert colors seriously.

Keep going

Related tools & guides

FAQ

Frequently asked questions

What input formats are accepted?

HEX with or without the hash (#5B5BD6, 5B5BD6, or short #5BD), rgb(91, 91, 214), and hsl(240, 60%, 60%). You can also click the swatch and pick visually. Alpha values, rgba(), color names, and CMYK or OKLCH input are not accepted.

What is OKLCH and why should I care?

OKLCH is a color space designed to be close to perceptually uniform, and it is supported in modern CSS. Changing only its lightness gives steps that look much more even than HSL steps, which makes it useful for color scales. Note that this site’s Shades generator steps HSL lightness, not OKLCH; paste its steps here to compare their OKLCH lightness.

Is the CMYK value print-accurate?

It's the standard formula conversion, which is a good starting point — but real print color depends on the printer's ICC profile, paper, and inks. For critical brand work, always confirm with your print shop's profile.