HEX to RGB Converter: HEX, RGB, HSL and CMYK

Use this hex to rgb converter to switch color codes in a click. Type a HEX code like #1e90ff to get RGB, HSL and CMYK, or type RGB to get HEX. A live swatch shows the color, and every code is ready to copy.

HEX to RGB Converter

HEX, RGB, HSL, HSV and CMYK.

Everything runs in your browser. Nothing you enter or upload is sent to a server.

How to use the HEX to RGB Converter

  1. Type a color: #1e90ff, 1e90ff, rgb(30,144,255), hsl(210,100%,56%) or a name like tomato.
  2. Or pick a color with the color picker.
  3. Read every format in the list.
  4. Check the contrast ratio before using the color for text.

How it works

Each pair of HEX digits is one channel from 00 to FF, which is 0 to 255 in decimal: red, green and blue. HSL and HSV are calculated from the RGB values, CMYK from the ratio to the brightest channel, and contrast with the WCAG 2 relative luminance formula (4.5:1 passes AA for normal text).

Example

#1E90FF is rgb(30, 144, 255): 1E = 30, 90 = 144, FF = 255. In HSL it is hsl(210, 100%, 56%).

Frequently asked questions

How do I convert HEX to RGB by hand?

Split the code into three pairs and convert each from base 16 to base 10.

What does a 3-digit HEX mean?

Each digit is doubled: #f80 is #ff8800.

What contrast ratio do I need?

At least 4.5:1 for normal text and 3:1 for large text under WCAG AA.

See also: Color Picker.

Convert color codes

How to use it

  1. Type a HEX or RGB code.
  2. See the other formats.
  3. Check the swatch.
  4. Copy the code.

More questions

What is #FFFFFF in RGB?

#FFFFFF is 255, 255, 255 in RGB, which is pure white.

Does it handle 3-digit HEX?

Yes. It handles 3-digit HEX codes like #fff.

Is CMYK exact for print?

It is a close guide; printers may vary.

Related tools: Color Picker, Color Contrast Checker, Color Palette Generator.