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;
}
Who this tool is for:

Best for: Converting a hex from a brand guide into the RGB a design tool needs, and translating between hex, RGB, HSL and CMYK in one step

Limitations: Converts colour values and does not check contrast or accessibility, so legibility still needs testing separately

Best suited for: Developers translating brand documentation into the format their tooling expects

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.

Advertisement

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

When You Need the RGB Value

Hex is compact and dominates stylesheets, but RGB is what you need whenever a value must be manipulated rather than just declared. Anything that adjusts opacity, animates between two colours, or feeds a canvas or SVG operation works in numeric channels. Design software, print workflows and most charting libraries also expect separate red, green and blue values.

A typical case: you have a brand hex code and need it as rgba with 40 percent opacity for an overlay. Converting first gives you the three channel numbers to drop into the alpha syntax. Both notations and how they relate are documented in the MDN colour value reference.

Get fresh reads straight to your inbox

Get notified when we publish new articles. Unsubscribe anytime.