Essential cookies keep Huevex running. With your permission we also measure how the site is used. Nothing optional loads until you choose. Cookie Policy

HEX to RGB Converter

Paste a hex code and read the red, green and blue values it stands for, ready to drop into code.

#
RGB
rgb(91, 141, 239)
HEX
#5B8DEF
HSL
hsl(220, 82%, 65%)
CMYK
62%, 41%, 0%, 6%
LAB
59, 13, -54

How a hex code becomes RGB

A hex code is three numbers written in base 16, two characters each. Read each pair, convert it from base 16 to decimal, and you have the red, green and blue amounts. #5B8DEF splits into 5B, 8D and EF, which are 91, 141 and 239. Written the way code expects it, that is rgb(91, 141, 239).

Nothing is lost in the conversion: hex and RGB hold the same 16.7 million colors. The only difference is notation, which is why hex and RGB are interchangeable rather than two different color models.

Where the RGB form is the one you need

Canvas and WebGL drawing calls take three separate numbers. Many charting libraries, PDF generators and email builders take channel values rather than hex strings. Building a transparent overlay usually means writing rgba(91, 141, 239, 0.4), which needs the RGB channels plus an alpha value - a hex code alone cannot express that in older email clients.

RGB is also the form you need when you are computing rather than styling: averaging two colors, lightening a channel, checking luminance for a contrast ratio, or generating a gradient by stepping between two triples. All of those operations happen on the three channels, so start from RGB.

Two things worth knowing

Short hex codes expand before converting. #FC0 is #FFCC00, so its RGB is 255, 204, 0 - not 15, 12, 0. Huevex expands short codes for you, so pasting either form gives the same result.

Hex and RGB both describe sRGB light, not ink. If the value is going to print, convert to CMYK instead and expect to proof it, because the same number printed on coated and uncoated stock will not match the screen.

Frequently Asked Questions

What is the difference between RGB and hex?

Notation only. Hex writes the same three channels in base 16 for compactness; RGB writes them in base 10. Neither stores more colors than the other.

Why is my RGB value three numbers and not one?

A screen pixel is made of three light sources, so a color needs one amount for each. A single number cannot describe a color without also saying how it was encoded.

How do I add transparency to the result?

Use rgba() with a fourth value from 0 to 1, for example rgba(91, 141, 239, 0.4). The three channels stay as they are; only the fourth changes.

Can I convert a named CSS color?

Yes, any named color has a hex value - rebeccapurple is #663399. Paste the equivalent hex here and the channels follow.

Take these colors into the Color Engine and build a full palette, gradient set and interface system around them.

Open Color Engine