Colour converter: HEX, RGB, HSL, CMYK

Convert colours between HEX, RGB, HSL, HSV and CMYK, pick a colour and check its contrast with white and black text. Free and private.

Runs in your browser. Nothing you paste is uploaded. Type a colour in any format: #hex, rgb(), hsl() or 3 numbers.

HEX#1e90ff
RGBrgb(30, 144, 255)
HSLhsl(210, 100%, 56%)
HSV / HSBhsv(210, 88%, 100%)
CMYKcmyk(88%, 44%, 0%, 0%)
Android#1E90FF

Text contrast

White text
3.24 : 1 · AA large text only
Black text
6.49 : 1 · AA

How to use it

  1. Type a colour in any format: #1e90ff, #fff, rgb(30, 144, 255), hsl(210, 100%, 56%) or just 30 144 255.
  2. Or tap the colour box to pick one visually.
  3. Copy the value you need: HEX, RGB, HSL, HSV, CMYK, or an Android colour int.
  4. Check the contrast boxes to see whether white or black text is readable on that colour.

One colour, every format

Designers often hand over HEX codes, CSS can use any format, Android and Flutter want ARGB values, and print needs CMYK. This converter shows them all side by side. HSL (hue, saturation, lightness) is the most useful for building palettes: keep the hue, change the lightness, and you get lighter and darker shades of the same colour. Transparent colours (#rrggbbaa, rgba, hsla) are kept with their alpha value.

The CMYK values are a simple mathematical conversion. Real printing depends on the paper and the printer's colour profile, so ask your printer for a proof when exact colour matters.

Readable text

The contrast ratio follows the WCAG accessibility guidelines. 4.5:1 or more (AA) is needed for normal text, 3:1 for large text, and 7:1 (AAA) is ideal. Low contrast is one of the most common accessibility failures on websites and makes pages hard to read in sunlight on a phone.

Questions

How do I convert HEX to RGB?
Type the HEX code, such as #ff8800, and read the RGB line: rgb(255, 136, 0). Each pair of hex digits is one channel from 0 to 255.
What is the Android format?
#AARRGGBB in uppercase, with alpha first, as used in Android colour resources and Flutter's Color(0xAARRGGBB).
Can I pick a colour from an image?
Yes, with the Color Picker tool, which reads colours from any photo.
Is what I paste sent to a server?
No. The tool runs as JavaScript in your browser. Your text, files and keys stay on your device, so it is safe to use with internal data, tokens and customer records. It keeps working offline after the page has loaded once.

More free tools