• Free forever
  • No sign-up
  • Private — runs in your browser

HEX to RGB Color Converter

Type any color — HEX, RGB, HSL, HSV, CMYK or a CSS name — and get every format instantly, plus contrast ratings and shades.

HEX, RGB, HSL, HSV, CMYK or CSS color names.

Text contrast (WCAG 2.2)

Tints & shades — click to use

How to use the color converter

  1. Type or paste a color in any format: #1E90FF, 1e90ff, rgb(30, 144, 255), 30, 144, 255, hsl(210, 100%, 56%), hsv(210, 88%, 100%), cmyk(88%, 44%, 0%, 0%) or a CSS name such as dodgerblue.
  2. Or click the swatch on the left to pick a color visually.
  3. Every format updates instantly. Click Copy next to the one you need.
  4. Check the contrast boxes to see whether white or black text is readable on your color, and click any tint or shade to explore lighter and darker variations.

Color formats explained

FormatExampleWhere it is used
HEX#FF6347CSS, HTML, design tools, brand guides
RGB / RGBArgb(255, 99, 71)CSS, screens, image editors, programming
HSLhsl(9, 100%, 64%)CSS — easy to create lighter/darker variants
HSV / HSBhsv(9, 72%, 100%)Photoshop, Figma, Illustrator color pickers
CMYKcmyk(0%, 61%, 72%, 0%)Print design and professional printing

How HEX to RGB conversion works

A HEX color is three bytes written in base 16 (digits 0–9 and A–F). Each pair of characters is one channel — red, green and blue — from 00 (0) to FF (255).

To convert a pair, multiply the first digit by 16 and add the second. For #FF6347:

  • Red: FF = 15 × 16 + 15 = 255
  • Green: 63 = 6 × 16 + 3 = 99
  • Blue: 47 = 4 × 16 + 7 = 71

So #FF6347 = rgb(255, 99, 71) — the CSS color "tomato". Going from RGB to HEX is the reverse: divide each value by 16; the quotient is the first digit and the remainder the second.

An optional fourth pair (8-digit HEX, like #FF634780) stores transparency: 80 = 128 ≈ 50% opacity.

Common colors in every format

ColorHEXRGBHSL
White#FFFFFF255, 255, 2550, 0%, 100%
Black#0000000, 0, 00, 0%, 0%
Red#FF0000255, 0, 00, 100%, 50%
Green (lime)#00FF000, 255, 0120, 100%, 50%
Blue#0000FF0, 0, 255240, 100%, 50%
Yellow#FFFF00255, 255, 060, 100%, 50%
Orange#FFA500255, 165, 039, 100%, 50%
Purple#800080128, 0, 128300, 100%, 25%
Gray#808080128, 128, 1280, 0%, 50%
Navy#0000800, 0, 128240, 100%, 25%

Designing with accessible colors

About 1 in 12 men and 1 in 200 women have some form of color vision deficiency, and many more people read screens in bright sunlight. The WCAG contrast ratio compares the relative luminance of text and background, from 1:1 (no contrast) to 21:1 (black on white). Aim for at least 4.5:1 for body text. If your brand color fails with white text, use one of the darker shades from the palette for buttons and links.

Frequently asked questions

How do I convert HEX to RGB?

Split the 6-digit HEX code into three pairs (red, green, blue) and convert each pair from base 16 to base 10. For #1E90FF: 1E = 30, 90 = 144, FF = 255, so the color is rgb(30, 144, 255).

How do I convert RGB to HEX?

Convert each value (0–255) to a two-digit hexadecimal number and join them with a leading #. For example rgb(255, 99, 71) → FF, 63, 47 → #FF6347.

What is a 3-digit HEX code?

A shorthand where each digit is doubled: #F0C is the same as #FF00CC. It only works when both digits of every pair are identical.

What is the difference between HSL and HSV?

Both describe color by hue and saturation. In HSL, lightness 100% is always white and 50% is the pure color. In HSV/HSB (used by Photoshop and Figma pickers), value 100% is the brightest version of the color. HSL is what CSS uses.

Why does my CMYK print look different from the screen?

Screens mix light (RGB) while printers mix ink (CMYK), and many bright RGB colors cannot be reproduced with ink. The CMYK values here are a mathematical conversion; for professional print work use your printer's ICC color profile.

What contrast ratio do I need for accessible text?

WCAG 2.2 requires at least 4.5:1 for normal text and 3:1 for large text (24px, or 18.66px bold) to pass level AA. Level AAA requires 7:1 and 4.5:1.