Color Converter

Type, paste or pick a color and instantly get its HEX, RGB, HSL, HSV and CMYK values, plus how readable it is as text on white and black.

HEX

#6366f1

RGB

rgb(99, 102, 241)

HSL

hsl(239, 84%, 67%)

HSV / HSB

hsv(239, 59%, 95%)

CMYK

cmyk(59%, 58%, 0%, 5%)

RGB 0–1

0.388, 0.400, 0.945

Text contrast (WCAG)

On white — Aa4.47:1 · AA large
On black — Aa4.70:1 · AA

HEX vs RGB vs HSL

HEX (like #6366f1) is the most common format in CSS and design tools. RGB expresses the same color as red, green and blue channels from 0–255, which is easier to reason about when blending colors in code. HSL (hue, saturation, lightness) is often the most intuitive for adjusting a color — increase lightness to make it paler, or change hue to shift it around the color wheel, without recalculating RGB values by hand.

HSV (also called HSB, hue–saturation–brightness) is what the color pickers in Photoshop, Figma and most design apps use. CMYK (cyan, magenta, yellow, black) is the ink model used in print. The CMYK values here use the standard formula that design tools display; real printed color also depends on the printer's color profile, so treat them as a starting point for print work.

How to convert HEX to RGB by hand

A six-digit HEX code is three pairs of base-16 numbers: red, green and blue. Convert each pair to decimal by multiplying the first digit by 16 and adding the second (A=10, B=11 … F=15). For #3366FF:

  • 33 → 3 × 16 + 3 = 51 (red)
  • 66 → 6 × 16 + 6 = 102 (green)
  • FF → 15 × 16 + 15 = 255 (blue)

So #3366FF is rgb(51, 102, 255). A three-digit code like #36F is shorthand where each digit is doubled: #3366FF. Going the other way, divide each channel by 16: the whole part is the first digit and the remainder is the second.

Common colors in every format

ColorHEXRGBHSLCMYK
Black#000000rgb(0, 0, 0)hsl(0, 0%, 0%)cmyk(0%, 0%, 0%, 100%)
White#ffffffrgb(255, 255, 255)hsl(0, 0%, 100%)cmyk(0%, 0%, 0%, 0%)
Red#ff0000rgb(255, 0, 0)hsl(0, 100%, 50%)cmyk(0%, 100%, 100%, 0%)
Green#008000rgb(0, 128, 0)hsl(120, 100%, 25%)cmyk(100%, 0%, 100%, 50%)
Lime#00ff00rgb(0, 255, 0)hsl(120, 100%, 50%)cmyk(100%, 0%, 100%, 0%)
Blue#0000ffrgb(0, 0, 255)hsl(240, 100%, 50%)cmyk(100%, 100%, 0%, 0%)
Yellow#ffff00rgb(255, 255, 0)hsl(60, 100%, 50%)cmyk(0%, 0%, 100%, 0%)
Orange#ffa500rgb(255, 165, 0)hsl(39, 100%, 50%)cmyk(0%, 35%, 100%, 0%)
Purple#800080rgb(128, 0, 128)hsl(300, 100%, 25%)cmyk(0%, 100%, 0%, 50%)
Navy#000080rgb(0, 0, 128)hsl(240, 100%, 25%)cmyk(100%, 100%, 0%, 50%)
Teal#008080rgb(0, 128, 128)hsl(180, 100%, 25%)cmyk(100%, 0%, 0%, 50%)
Gray#808080rgb(128, 128, 128)hsl(0, 0%, 50%)cmyk(0%, 0%, 0%, 50%)
Silver#c0c0c0rgb(192, 192, 192)hsl(0, 0%, 75%)cmyk(0%, 0%, 0%, 25%)
Maroon#800000rgb(128, 0, 0)hsl(0, 100%, 25%)cmyk(0%, 100%, 100%, 50%)
Pink#ffc0cbrgb(255, 192, 203)hsl(350, 100%, 88%)cmyk(0%, 25%, 20%, 0%)
Gold#ffd700rgb(255, 215, 0)hsl(51, 100%, 50%)cmyk(0%, 16%, 100%, 0%)

What the contrast check means

The WCAG 2 accessibility guidelines ask for a contrast ratio of at least 4.5:1 between normal text and its background (level AA), 3:1 for large text, and 7:1 for the stricter AAA level. The tool shows the ratio of your color against pure white and pure black so you can see straight away whether it works as text or button color.

Frequently asked questions

What formats can I paste in?
HEX with or without # (#fff, 3366ff), rgb()/rgba(), plain numbers like 51, 102, 255, hsl()/hsla() including the modern space-separated syntax, and cmyk(c%, m%, y%, k%).
Can I paste a 3-digit HEX code like #fff?
Yes, shorthand 3-digit HEX codes are automatically expanded to their 6-digit equivalent.
Does this support alpha/opacity values?
The tool accepts rgba() and hsla() input but converts based on the color channels only — alpha isn't carried into the outputs.
Why does converting HSL back to HEX sometimes change the last digit?
HSL values are rounded to whole numbers, and a whole-number HSL can't always land on the exact same RGB value. The difference is at most one step per channel and is invisible on screen.
Is the CMYK value exact for printing?
No converter can give exact print CMYK without your printer's ICC profile. These are the device-independent values that design tools show, which are fine for mock-ups and briefs.

Related tools