Color Converter

Designers and developers move between colour formats: HEX in CSS, RGB in code, HSL for adjusting shades and CMYK for print.

For example #0A8FA8, 0A8FA8, or 10 143 168.
Results update as you type.

HEX

#0A8FA8

rgb(10, 143, 168)

RGB
rgb(10, 143, 168)
HSL
hsl(189, 89%, 35%)
CMYK
94%, 15%, 0%, 34%
Contrast with white text
3.81 : 1below 4.5 : 1
Contrast with black text
5.51 : 1passes WCAG AA for normal text

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

  1. Enter a HEX or RGB colour.
  2. Read the other formats.
  3. 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

  1. RGB 10, 143, 168; HSL 189°, 89%, 35%.
  2. 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.