Color Converter
Convert any colour between HEX, RGB, HSL, HSV, CMYK and OKLCH. Type in any box — hex to CMYK, CMYK to hex, HSL to hex, OKLCH to hex — and every other format updates.
Convert in any direction
Every box is an input. Type a hex code to get HEX to CMYK, HEX to RGB or HEX to HSL. Type four CMYK numbers for CMYK to HEX. Enter HSL or OKLCH values to get the hex code. You can also paste a colour in almost any format, such as #DC143C, rgb(220 20 60), hsl(348 83% 47%), cmyk(0, 91, 73, 14), oklch(55% 0.22 20) or a name like crimson, and every format updates at once. The tool also shows the nearest named colour, with a link to its page.
How HEX and RGB convert to CMYK
A hex code is just RGB written in base 16: #DC143C is red DC (220), green 14 (20) and blue 3C (60). To get CMYK, divide each channel by 255. Black (K) is 1 minus the largest of the three. Then cyan = (1 − R − K) ÷ (1 − K), and magenta and yellow work the same way with green and blue. For #DC143C that gives about C 0%, M 91%, Y 73%, K 14%. This is the standard device-independent formula. Real printing depends on the paper, ink and press profile, so always check a printed proof of brand colours.
HSL, HSV and OKLCH
HSL (hue, saturation, lightness) and HSV/HSB (hue, saturation, value or brightness) describe the same RGB colours in a way that’s easier to adjust by hand: turn the hue to shift colour, lower saturation to mute it. OKLCH is the modern CSS colour space. Its lightness matches how bright colours actually look, which makes it the best choice for even colour scales and smooth gradients. Some OKLCH colours lie outside what a normal screen can show; the converter brings those to the nearest displayable colour and tells you when it does.
Looking for a named colour? Browse every colour name with its hex code, see the shades of each colour, or turn your colours into a gradient with the Gradient Generator.
