HEX to RGB Converter

Convert between HEX, RGB, HSL, and CMYK in any direction. Type into any field.

Current Color
#7C3AED
HEX
RGB
HSL
CMYK
CSS Snippet
.element {
  color: #7C3AED;
  color: rgb(124, 58, 237);
  background-color: #7C3AED;
}

How to Use the Color Converter

Type into any input field -- HEX, RGB, HSL, or CMYK -- and all other formats update instantly. You can work in any direction. Paste a HEX code, type RGB values, or enter HSL numbers and the converter handles everything automatically.

HEX is the standard format for web design CSS. RGB is useful when you need to add transparency using rgba(). HSL is the most intuitive for design systems -- adjusting lightness alone lets you create tints and shades while keeping the same hue. CMYK is required for print design work.

A shorthand 3-digit HEX like #7CE (equivalent to #77CCEE) is also accepted. The converter expands it automatically. Both uppercase and lowercase HEX codes are recognized.

For RGB input, enter three numbers separated by commas: 124, 58, 237. Values must be between 0 and 255. For HSL, enter hue (0-360), saturation (0-100), and lightness (0-100). The % symbols are optional. For CMYK, enter four numbers from 0 to 100.

Frequently Asked Questions

Split the HEX code into three pairs of characters, then convert each pair from hexadecimal to decimal. For #FF8800: FF = 255 (red), 88 = 136 (green), 00 = 0 (blue), giving rgb(255, 136, 0). This converter does it instantly for any color.
#FFFFFF is white, which is rgb(255, 255, 255) in RGB format. All three channels at full intensity produce white. #000000 (black) is rgb(0, 0, 0) with all channels at zero.
Converting RGB to HSL involves normalizing the R, G, B values to 0-1, finding the max and min, computing lightness as (max + min) / 2, then calculating saturation and hue from the difference between max and min. This tool handles the conversion automatically.
The # symbol indicates that the following string is a hexadecimal color code. It is required in CSS (color: #FF0000) but some design tools accept the code without it. The six characters after # represent three pairs: two for red, two for green, two for blue.
CSS accepts HEX (#RRGGBB), RGB (rgb(r, g, b)), RGBA (rgba(r, g, b, a)), HSL (hsl(h, s%, l%)), and HSLA. Copy any format from this converter and paste it directly into your CSS file. All formats are equally valid in modern browsers.
Related Tools