How to convert HEX to RGB
- Type or paste a hex code such as
#5B2B82— or use the color picker. - The RGB, HEX and HSL values update instantly, with a live preview.
- Click Copy next to the format you need.
How HEX colors work
A hex color is three pairs of hexadecimal digits for red, green and blue, each from 00 (0) to FF (255).
| HEX | RGB | Color |
|---|---|---|
#000000 |
rgb(0, 0, 0) | Black |
#FFFFFF |
rgb(255, 255, 255) | White |
#FF0000 |
rgb(255, 0, 0) | Red |
#5B2B82 |
rgb(91, 43, 130) | Figtray plum |
Why convert to RGB?
- CSS transparency:
rgba()makes it easy to adjust opacity. - Design tools and code that expect separate red, green and blue values.
- Image processing and canvas code, which work with numeric channels.
Frequently asked questions
How do I convert HEX to RGB manually?
Split the six digits into three pairs and convert each from hexadecimal to decimal. #5B2B82 → 5B = 91, 2B = 43, 82 = 130, so rgb(91, 43, 130).
What do 3-digit and 8-digit hex codes mean?
#RGB is shorthand where each digit is doubled (#F80 = #FF8800). An 8-digit code #RRGGBBAA adds an alpha (opacity) channel; #FF000080 is red at about 50% opacity.
Do I need the # symbol?
No. 5B2B82 and #5B2B82 both work, in upper or lower case.