Colour Code Converter

Pick a colour or type a HEX, RGB or HSL value; the other formats fill in on their own.

How it works

Whichever of the HEX, RGB or HSL fields you change, the others are computed from it; HSV and CMYK are display only. The CMYK value is a plain conversion and varies with the print profile. The contrast ratio follows the WCAG 2 formula; 4.5:1 or more is recommended for text.

Frequently asked questions

How is a HEX code converted to RGB?

The six digits are read in pairs and each pair is converted from base 16 to base 10: #a3421c gives 163, 66, 28.

Is a three-digit HEX code valid?

Yes, #abc is shorthand for #aabbcc; the tool accepts both.

What is the contrast ratio for?

It shows how well text stands out from its background. WCAG asks for at least 4.5:1 for normal text and 3:1 for large text.

Will the CMYK value print exactly?

No. The conversion here is mathematical; the printed colour depends on the paper and the colour profile.