Color converter

Paste a color in any format or pick one, and get it in HEX, RGB, HSL, HSV and CMYK at once, plus the closest CSS color name. It is free and runs entirely in your browser.

How to use it

  1. Type or paste a color in Color value, or leave it empty and use the Color picker.
  2. Check the table to see the same color in every format.
  3. Click Copy on the table or the color to use the value in your code.

Complete guide to converting colors

Why colors come in so many formats

A designer hands you #3b82f6, your stylesheet uses hsl() to build lighter and darker shades, a graphics library wants separate red, green and blue numbers, and the print shop asks for CMYK. All of them describe the same color; each format simply suits a different job. This converter reads a color in any of these forms and shows it in all the others at once, so you can copy the exact value you need without opening an image editor.

What each format means

FormatExampleHow it describes the color
HEX#3b82f6Red, green and blue as three pairs of base-16 digits, 00 to ff
RGBrgb(59, 130, 246)The same three channels as numbers from 0 to 255
HSLhsl(217, 91%, 60%)Hue as an angle on the color wheel (0 to 360), then saturation and lightness in percent
HSVhsv(217, 76%, 96%)Same hue, with saturation and brightness (value), as used by many color pickers
CMYKcmyk(76%, 47%, 0%, 4%)Cyan, magenta, yellow and black ink percentages

What you can type

The Color value (any format) field accepts HEX with 3, 4, 6 or 8 digits (the # is optional), rgb() and rgba() with numbers or percentages, hsl() and hsla(), hsv(), cmyk(), three bare numbers read as RGB, and the 140-plus CSS color names such as tomato or royalblue ("grey" is read as "gray"). Commas, spaces and a slash before the alpha are all fine. If the field is empty the tool uses the Color picker. The color is first reduced to red, green and blue integers and every other format is calculated from them, using the standard formulas. Nothing is sent anywhere.

Worked example

  1. Type #3b82f6. The table shows HEX #3b82f6, RGB rgb(59, 130, 246), HSL hsl(217, 91%, 60%), HSV hsv(217, 76%, 96%) and CMYK cmyk(76%, 47%, 0%, 4%). With Show the closest CSS color name ticked it also says royalblue (closest match, #4169e1).
  2. Type tomato. The result is #ff6347, rgb(255, 99, 71), hsl(9, 100%, 64%), and the name line says just tomato because the match is exact.
  3. Type #ff000080. Because the last two digits set transparency, extra rows appear: HEX8 #ff000080, RGBA rgba(255, 0, 0, 0.502) and HSLA hsla(0, 100%, 50%, 0.502). 80 in hex is 128, and 128 / 255 is about 0.502.

Rounding, CMYK and other limits

  • HSL, HSV and CMYK values are rounded to whole numbers. Converting them back can land one step away: hsl(217 91% 60%) gives #3c83f6, not #3b82f6. Keep the original HEX or RGB as the master value.
  • The CMYK shown is a plain mathematical conversion from RGB with no ink limits or ICC profile. Use it as a starting point, and let the printer proof the final color.
  • The closest name is the CSS color with the smallest distance in RGB space. It is a hint, not a perceptual match.
  • An unreadable value shows an error instead of a guess.

Tips

  • Prefer HSL when you want to build a scale: keep the hue, change only the lightness.
  • The standard HEX row never carries transparency. Use HEX8 or RGBA when you need an alpha.

Related tools

Build a harmonious scheme from your color with the color palette generator, check legibility with the contrast checker, or sample a color from a picture with the image color picker.

Questions

Which formats can I type?

HEX with 3, 4, 6 or 8 digits (with or without #), rgb() and rgba(), hsl() and hsla(), hsv(), cmyk(), and any of the 140+ CSS color names such as tomato or royalblue.

Why does CMYK look different when printed?

The CMYK shown here is a plain mathematical conversion from RGB. Real printers use ICC color profiles, so printed colors can differ a little.

Why can the HSL value be off by one?

Values are rounded to whole numbers for readability, so converting back may differ from the original by 1 in rare cases.

Is my data sent anywhere?

No. Everything is calculated in your browser.