Color Converter
Convert colours between HEX, RGB, HSL and CMYK, with contrast ratios against white and black.
About the Color Converter
Enter a colour as HEX, RGB, HSL or CMYK. The calculator converts it to every other format and shows its contrast ratio with white and black text.
HEX is RGB written in hexadecimal. HSL describes hue (0–360°), saturation and lightness, which is easier for adjusting shades. The CMYK values here use the simple device-independent formula; real print colours depend on the printer's ICC profile. Contrast ratios follow WCAG 2.x relative luminance.
The formula
K = 1 − max(R, G, B); C = (1 − R − K) ÷ (1 − K)
Worked example
#3A7BD5
- RGB (58, 123, 213)
- Contrast with white 4.22:1, black 4.97:1
- Black text passes WCAG AA (4.5:1); white text needs large type
Questions people ask
Why doesn't my print match?
Screens are RGB light; print uses ink, with a smaller colour gamut and profile-specific conversion.
What contrast do I need?
4.5:1 for normal text and 3:1 for large text under WCAG AA.