Colour Converter (HEX, RGB, HSL)
Convert a colour between hex, RGB, HSL and CMYK, see a swatch, and check whether white or black text is easier to read on it.
A hex code (#1d64a8 or #abc) or RGB values (29, 100, 168).
Hex
#1D64A8
- RGB
- rgb(29, 100, 168)
- HSL
- hsl(209, 71%, 39%)
- CMYK (approximate)
- 83%, 40%, 0%, 34%
- Best text colour on it
- White (contrast 6.1:1)
#1D64A8 is rgb(29, 100, 168) and hsl(209, 71%, 39%). White text reads best on it.
How it's worked out
- Hex to RGB
1d 64 a8 in base 1629, 100, 168 - Contrast (WCAG)
4.5:1 or more is readable for normal textwhite 6.1:1, black 3.44:1
Accepted formats
#1d64a8, 1d64a8, the short form #abc, rgb(29, 100, 168) or just 29, 100, 168.
Example
#1D64A8 is rgb(29, 100, 168), hsl(209, 71%, 39%) and roughly CMYK 83%, 40%, 0%, 34%. White text on it has a contrast of about 6.1:1, so white reads best.
Questions people ask
How do I convert hex to RGB?
Split the six digits into three pairs and read each pair in base 16. #1D64A8 is 1D = 29, 64 = 100 and A8 = 168, so rgb(29, 100, 168).
What is HSL?
Hue (the colour, 0° to 360°), saturation (how strong it is) and lightness. #1D64A8 is hsl(209, 71%, 39%).
Why is CMYK approximate?
Print colours depend on the inks and paper. This is the simple formula; printers use colour profiles for exact matches.
What contrast do I need for text?
WCAG asks for at least 4.5:1 for normal text and 3:1 for large text.
About this calculator
Formula and rules last checked 25 October 2026Written and tested by the CalculatorDex teamReport a problem
