Color Code Converter (All Formats)

Enter a color in any common format, or pick one, and press Convert. You get the color in every other format, its closest CSS name, a contrast check, and a palette built from it.

Try an example

About this color code converter

Designers, developers, and printers describe the same color in different ways. HEX and RGB give the amounts of red, green, and blue; HSL and HSV describe hue, saturation, and lightness or brightness, which is easier to adjust by hand; and CMYK gives approximate ink percentages for print. This converter reads any of these formats, including the 148 named CSS colors and values with transparency, and writes the color in all the others at once. It also finds the nearest CSS color name, rates the contrast against white and black with the WCAG 2.1 formula, and builds complementary, analogous, and triadic colors plus tints and shades.

How to convert a color code

  1. Enter a color. Type a value such as #2563EB, rgb(37, 99, 235), hsl(221, 83%, 53%), or tomato, or choose one with the color picker.
  2. Press Convert. The color is shown in every format, with a preview and its closest CSS color name.
  3. Copy what you need. Each format has its own Copy button, and clicking any palette swatch copies its hex code.

Frequently asked questions

Which color formats can I enter?

Hex codes with 3, 4, 6, or 8 digits, rgb() and rgba(), hsl() and hsla(), hsv() or hsb(), cmyk(), and the 148 CSS color names. Commas or spaces both work between the numbers.

What is the difference between HSL and HSV?

Both use the same hue angle. In HSL, 50% lightness gives the purest color and 100% is always white. In HSV (also called HSB), 100% brightness gives the purest color, and white needs 0% saturation as well.

Why do some conversions change the color slightly?

HSL, HSV, and CMYK are rounded to whole numbers, so converting back to RGB can land one step away from the original. The difference is too small to see on screen.

What does the closest CSS name mean?

It is the named CSS color, such as steelblue or tomato, that is nearest to your color in RGB space. When your color matches a name exactly, that name can be used in CSS in place of the code.

Is the CMYK value good enough for printing?

It is a simple mathematical conversion, useful as a starting point. Exact print colors depend on the printer, ink, paper, and color profile, so check proofs for brand work.