Color conversion tool

HEX to RGB Converter

Enter a HEX color to read its red, green, and blue channels. Four- and eight-digit values also return the embedded alpha transparency.

Enter a HEX color

Use #RGB, #RGBA, #RRGGBB, or #RRGGBBAA notation. The # sign is optional when typing.

Try an example

RGB result

Copy the CSS value or inspect every decoded channel.

CSS RGBrgb(79, 70, 229)
Normalized HEX
#4F46E5
RGB channels
79, 70, 229
CSS color
rgb(79, 70, 229)
HSL
hsl(243, 75%, 59%)
HSV / HSB
hsv(243, 69%, 90%)
Alpha
Not included

Decode HEX into RGB channels

A HEX color writes the red, green, and blue channels as base-16 pairs. This converter expands shorthand when needed, decodes each pair to a decimal value from 0 to 255, and returns a CSS-ready rgb() or rgba() value.

The conversion happens locally in this browser. Alongside RGB, the result shows normalized HEX, HSL, HSV, and a live preview so you can verify the color before using it.

How HEX becomes RGB

The first pair is red, the second is green, and the third is blue. Each pair is read as a base-16 number: 4F becomes 79, 46 becomes 70, and E5 becomes 229.

Three-digit shorthand duplicates each character before decoding, so #F08 expands to #FF0088.

#4F46E5 -> 4F, 46, E5 -> rgb(79, 70, 229)

Read alpha from 4- and 8-digit HEX

CSS places the alpha pair last. #RGBA expands to #RRGGBBAA, while a six-digit value has no embedded alpha and returns a standard rgb() result.

The alpha byte is divided by 255 and shown to three decimal places when necessary. For example, the final 80 in #0FA0FF80 becomes an alpha value of about 0.502.

Useful HEX to RGB workflows

HEX and rgb() syntax on this page follows the CSS Color Module Level 4.

HEX to RGB Converter FAQ

How do I convert HEX to RGB?

Enter a valid 3- or 6-digit HEX color. The converter expands shorthand, reads each red, green, and blue pair as a base-16 number, and returns decimal channels from 0 to 255.

Can I convert 8-digit HEX to RGBA?

Yes. Enter #RRGGBBAA or #RGBA. The final pair is decoded as alpha and the result is returned as an rgba() value.

What is #FFFFFF in RGB?

#FFFFFF is rgb(255, 255, 255). FF is the maximum two-digit hexadecimal value for each color channel.

What is the difference between #RGB and #RRGGBB?

#RGB is shorthand. Each character is duplicated, so #F08 means #FF0088. Both forms describe the same three RGB channels.

Does this converter change the color profile?

No. It decodes the numeric color notation as an sRGB web color and does not perform monitor, print, or ICC profile conversion.