Color & Design

How to Convert HEX Color to RGB

Turn HEX color codes into RGB and RGBA values for CSS, JavaScript, and design work.

Tool Used

HEX to RGB

Open tool
1

Open the HEX to RGB tool

Navigate to /tools/color/hex-to-rgb.

2

Type or paste a HEX value

Enter your HEX color, with or without the hash symbol. Both six digit (#FF5733) and three digit shorthand (#F73) formats are supported. The tool also accepts eight digit HEX values that include an alpha channel.

3

Read the RGB output

The corresponding RGB values appear instantly. The output looks like rgb(255, 87, 51), ready to paste into your CSS or JavaScript.

4

Add opacity if needed

Use the alpha slider to add transparency. The result becomes rgba(255, 87, 51, 0.5) where the last value is the alpha (0 is fully transparent, 1 is fully opaque).

5

Copy and use it

Click Copy to grab the RGB or RGBA value. Paste it into your stylesheet, JavaScript variable, design token, or any place where RGB notation is required.

All done!

You are ready to use HEX to RGB like a pro.

Try it now
All guides