About this calculator
Enter a HEX code or three RGB numbers. The calculator also checks whether white or black text on it is readable.
How to use it
- Enter a HEX or RGB colour.
- Read the other formats.
- Check the contrast results.
The formula
HEX = RGB in base 16; contrast = (L₁ + 0.05) ÷ (L₂ + 0.05)
- L
- relative luminance
- 4.5 : 1
- WCAG AA minimum for normal text
Worked example
Teal #0A8FA8
- RGB 10, 143, 168; HSL 189°, 89%, 35%.
- White text: 3.81 : 1 (too low for small text); black text: 5.51 : 1 (passes).
What the result means
Large text needs only 3 : 1 contrast; small text needs 4.5 : 1.
Assumptions
- sRGB colours.
Limitations
- CMYK here is a simple conversion; printers use colour profiles.
Frequently asked questions
How do I convert HEX to RGB?
Split into three pairs and convert each from base 16.
What contrast ratio is needed?
4.5 : 1 for normal text, 3 : 1 for large text (WCAG AA).
Why does CMYK print differently?
Printers and paper change colours; use your printer’s profile.
Last reviewed on 3 October 2026. Found a mistake? Tell us.

