HEX to RGB Converter
Convert colours between HEX, RGB, HSL and CMYK, pick a colour, and check its WCAG contrast on white and black backgrounds. Free colour converter.
#1877F2- RGB
rgb(24, 119, 242)- HSL
hsl(214, 89%, 52%)- CMYK
90%, 51%, 0%, 5%- Contrast on white
- 4.23:1 · AA large text only
- Contrast on black
- 4.96:1 · AA
One colour, every format
Web designers write colours as hex codes (#1877F2), CSS also accepts rgb() and hsl(), and print uses CMYK percentages. Type or pick a colour in any of these formats to get all the others. The tool also shows the contrast ratio against white and black text backgrounds, graded by the WCAG accessibility guidelines: 4.5:1 is the minimum (AA) for body text, 3:1 for large text, and 7:1 is the enhanced AAA level. Note that CMYK here is a simple conversion; for print, use your printer's colour profile.
How to use it
- 1
Enter a colour
A hex code, rgb() or hsl() value, or use the picker.
- 2
Copy the format you need
HEX, RGB, HSL or CMYK.
- 3
Check the contrast
See if text in this colour is readable on white or black.
Frequently asked questions
How do I convert hex to RGB?
Split the six digits into three pairs and convert each from hexadecimal: #1877F2 → 18, 77, F2 → 24, 119, 242.
What does a 3-digit hex code mean?
Each digit is doubled: #0AF is the same as #00AAFF.
What contrast ratio do I need?
At least 4.5:1 for normal text and 3:1 for large text (18 pt, or 14 pt bold) to meet WCAG AA.
Is anything sent to a server?
No. Everything is calculated in your browser.