Advertisement
Namecheap VPS hosting

Colour converter

Paste a colour in any format and get it in every other: HEX, RGB, HSL, HSV and CMYK, plus the ARGB code used in Android apps. You can also type a colour name such as teal, or pick one with the colour picker. The converter shows whether white or black text is readable on the colour under WCAG rules, and gives ten lighter and darker shades to build a palette.

For example #026AA8, rgb(2, 106, 168), hsl(202 98% 33%), cmyk(99, 37, 0, 34) or a name like teal.

Contrast for text (WCAG)

Lighter and darker shades

Advertisement
Namecheap VPS hosting

How to use the colour converter

  1. Type or paste a colour in any format, or click the colour box to pick one.
  2. Copy the code you need from the table.
  3. Check the contrast cards before using the colour behind text.
  4. Click a shade to switch to it.

How it works

All the formats describe the same colour in different ways:

FormatExampleUsed in
HEX#026AA8Websites, design apps
RGBrgb(2, 106, 168)CSS, screens
HSLhsl(202, 98%, 33%)CSS; easy to adjust by hand
HSV / HSBhsv(202, 99%, 66%)Photoshop and colour pickers
CMYKcmyk(99%, 37%, 0%, 34%)Printing

HEX is the RGB values written in base 16: 02 = 2, 6A = 106, A8 = 168. An optional fourth pair sets the opacity.

CMYK here is a simple mathematical conversion. A printer's real colours depend on its inks and paper, so ask your printer for their colour profile for exact matches.

Contrast uses the WCAG 2 formula, which compares how bright two colours look. Normal text needs at least 4.5 : 1 (level AA) and large text at least 3 : 1. 7 : 1 meets the stricter AAA level.

Shades keep the same hue and saturation and change only the lightness.

Example

#026AA8 (the WebCanary blue) converts to:

  • RGB: rgb(2, 106, 168)
  • HSL: hsl(202, 98%, 33%)
  • CMYK: cmyk(99%, 37%, 0%, 34%)

White text on it has a contrast of 5.79 : 1, which passes AA. Black text has only 3.63 : 1, so it's fine for large headings but not for body text.

Frequently asked questions

How do I convert HEX to RGB?

Split the HEX code into three pairs and convert each from base 16 to a number. For #026AA8: 02 = 2, 6A = 106 and A8 = 168, so it's rgb(2, 106, 168). Or paste it above.

What is the difference between HSL and HSV?

Both use hue and saturation. HSL's lightness goes from black at 0% through the pure colour at 50% to white at 100%. HSV's value goes from black at 0% to the pure colour at 100%.

Can I use RGB colours for printing?

Printers use CMYK inks, which can't show every bright screen colour. Convert to CMYK here for a starting point, and ask your printer for a proof before a big print run.

What contrast ratio do I need for text?

WCAG AA asks for at least 4.5 : 1 for normal text and 3 : 1 for large text (about 24 px, or 19 px bold). AAA asks for 7 : 1.

Last updated: 29 October 2026