Back to Home

Color Code Converter

Convert between HEX, RGB, HSL, and CMYK color formats

🎨 Color Preview

#FFFFFF

Format Inputs

🎨 Common Colors

📖 Color Format Guide

  • HEX: 6-digit hexadecimal (#RRGGBB) - Web standard
  • RGB: Red, Green, Blue (0-255) - Digital displays
  • HSL: Hue (0-360°), Saturation, Lightness (%) - Intuitive
  • CMYK: Cyan, Magenta, Yellow, Black (%) - Print colors

💡 Use Cases

  • • Web design and CSS styling
  • • Graphic design projects
  • • Print media preparation (CMYK)
  • • Brand color consistency
  • • Accessibility testing

Overview

The Color Code Converter translates a color between the four formats designers and developers use most: HEX, RGB, HSL and CMYK. Type a value into any one of them, pick a color with the visual picker, or click one of the common color swatches, and the other three formats update instantly.

Under the hood every conversion goes through RGB. A HEX code is just the red, green and blue values (0–255) written as two hexadecimal digits each. HSL re-expresses those values as a hue angle (0–360°), saturation and lightness in percent, which makes it easier to create lighter, darker or muted variations. CMYK is calculated with the standard naive formula: K = 1 − the largest RGB channel, and each ink = (1 − channel − K) ÷ (1 − K).

One important caveat: the CMYK values here are a mathematical conversion, not a color-managed one. Real print output depends on the ink, paper and ICC profile your printer uses, so always proof important print colors with your print provider.

How to Use

  1. Enter a 6-digit HEX code such as #FF5733 in the HEX field (the # is optional), or click the large color picker to choose a color visually.
  2. Alternatively, type values into the RGB fields (0–255 each), the HSL fields (H 0–360, S and L 0–100) or the four CMYK fields (0–100 each). All fields in a group must be filled before the other formats update.
  3. Click any swatch under Common Colors, such as Orange or Purple, to load it as a starting point.
  4. Read the converted values in the other fields, and click the copy icon next to the HEX value under the preview to copy it to your clipboard.
  5. If a value is out of range, a red message explains the allowed range; fix the field and the conversion resumes.

Frequently Asked Questions

How do I convert a HEX color code to RGB?

Split the six digits into three pairs and convert each pair from base 16 to base 10. For #FF5733, FF = 255, 57 = 87 and 33 = 51, so the RGB value is rgb(255, 87, 51). The same color in this converter shows as HSL 11°, 100%, 60% and CMYK 0%, 66%, 80%, 0%. Each hex pair can range from 00 (0) to FF (255).

What is the difference between RGB and CMYK?

RGB is an additive model used by screens: red, green and blue light combine, and all three at full strength make white. CMYK is a subtractive model used in printing: cyan, magenta, yellow and black inks absorb light, and more ink makes a color darker. Screens can show some bright colors that ink cannot reproduce, so vivid RGB colors often look duller in print.

Why use HSL instead of HEX or RGB?

HSL describes a color the way people think about it. Hue is the position on the color wheel (0° red, 120° green, 240° blue), saturation is how intense the color is, and lightness runs from black (0%) to white (100%). To make a lighter tint of a brand color, you only change L, which is much easier than adjusting three RGB channels. CSS supports HSL directly with hsl().

Are the CMYK values accurate for printing?

They are a good starting point, but not a print-ready specification. This tool uses the common device-independent formula with no color profile, so it cannot account for paper type, ink limits or press settings. Professional workflows convert using an ICC profile such as one supplied by the printer. For brand-critical work, ask your printer for a proof or use a spot color system.

Does the converter support 3-digit or 8-digit HEX codes?

No. The HEX field accepts the standard 6-digit #RRGGBB form only. A shorthand code like #F53 must be expanded to #FF5533 by doubling each digit, and 8-digit codes that include an alpha (transparency) channel are not supported. Transparency is also not part of the RGB, HSL or CMYK fields on this page.

Why does converting back and forth sometimes change a value slightly?

HSL and CMYK values are rounded to whole numbers on this page, while RGB uses whole numbers from 0 to 255. Converting HSL or CMYK back to RGB can therefore land one step away from the original channel value. For example, #FF5733 is rgb(255, 87, 51) and shows as HSL 11°, 100%, 60%; typing that HSL value back in gives rgb(255, 88, 51), or #FF5833. The difference is invisible to the eye, but use the original HEX or RGB value when you need an exact match.