Home › Converters › Colour Converter

Colour Converter

Convert colour codes between HEX, RGB, HSL and CMYK — and check text contrast.

HEX
–
RGB
–
HSL
–
CMYK
–

Colour codes explained

The same colour can be written in several ways. Web designers mostly use HEX or RGB, HSL is handy for creating lighter or darker shades, and CMYK is the language of print shops.

  • HEX: #2563eb — red, green and blue as two-digit hexadecimal numbers
  • RGB: rgb(37, 99, 235) — the same three channels from 0 to 255
  • HSL: hue (0–360°), saturation and lightness in percent
  • CMYK: cyan, magenta, yellow and black for print

Readable text

The converter also shows the contrast ratio against white and black text according to WCAG. For normal body text, at least 4.5:1 is recommended. Note that CMYK values here are a simple conversion — for professional print, use the colour profile of your print shop.

How to use the colour converter

  1. Choose a colour with the picker under Pick a colour.
  2. Or paste an existing value into Or enter HEX, RGB or HSL, for example from your CSS or a style guide.
  3. Read off HEX, RGB, HSL and CMYK and copy the format you need.

A practical example

The blue #2563eb equals rgb(37, 99, 235) and roughly hsl(221, 83%, 53%). If you need a darker shade for a hover state, simply lower the lightness in HSL, say to 45%. Hue and saturation stay the same, so the two colours clearly belong together.

Typical uses

  • Moving brand colours from a PDF style guide into CSS
  • Deriving palettes for buttons, hover and focus states
  • Getting a first CMYK estimate before printing
  • Checking whether text on a background colour is readable

Frequently asked questions

Can I paste values without # or rgb()?

Yes. “2563eb” or “37, 99, 235” are recognised as well.

What is the difference between RGB and HSL?

Both describe the same colours. RGB mixes red, green and blue, while HSL describes hue, saturation and lightness. HSL is handier when you want to make a colour lighter, darker or more muted.

Why does the colour look different in print?

Screens emit light in RGB, printers mix inks in CMYK. Some bright screen colours cannot be reproduced exactly on paper. For binding results, use your print shop's colour profile.

Is my data private?

Yes. Everything is calculated in your browser, nothing is stored or sent.