HEX to RGB Converter
Paste a HEX code to get its RGB value instantly. Works with 6-digit codes like #4F46E5, 3-digit shorthand like #FFF, and 8-digit codes with transparency.
How the conversion works
A HEX code is three pairs of base-16 digits: one pair each for red, green and blue. Converting each pair to a number from 0 to 255 gives you the RGB value.
#4F46E5 → 4F = 79, 46 = 70, E5 = 229 → rgb(79, 70, 229)
Common colours
| Colour | HEX | RGB |
|---|---|---|
| White | #FFFFFF | rgb(255, 255, 255) |
| Black | #000000 | rgb(0, 0, 0) |
| Red | #FF0000 | rgb(255, 0, 0) |
| Lime | #00FF00 | rgb(0, 255, 0) |
| Blue | #0000FF | rgb(0, 0, 255) |
| Yellow | #FFFF00 | rgb(255, 255, 0) |
| Cyan | #00FFFF | rgb(0, 255, 255) |
| Magenta | #FF00FF | rgb(255, 0, 255) |
| Grey | #808080 | rgb(128, 128, 128) |
| Silver | #C0C0C0 | rgb(192, 192, 192) |
| Orange | #FFA500 | rgb(255, 165, 0) |
| Purple | #800080 | rgb(128, 0, 128) |
| Navy | #000080 | rgb(0, 0, 128) |
| Teal | #008080 | rgb(0, 128, 128) |
| Maroon | #800000 | rgb(128, 0, 0) |
| Olive | #808000 | rgb(128, 128, 0) |
| Green | #008000 | rgb(0, 128, 0) |
| Pink | #FFC0CB | rgb(255, 192, 203) |
| Brown | #A52A2A | rgb(165, 42, 42) |
| Gold | #FFD700 | rgb(255, 215, 0) |
Common questions
How do I convert HEX to RGB?
Split the six digits into three pairs and convert each pair from base 16 to a number from 0 to 255. Or paste the code into the box above and Galham does it for you.
What does a 3-digit HEX code mean?
It's shorthand where each digit is doubled. #F0A is the same as #FF00AA, which is rgb(255, 0, 170).
Can HEX include transparency?
Yes. An 8-digit code adds a fourth pair for alpha (opacity). #4F46E580 is the indigo above at about 50% opacity, which is rgba(79, 70, 229, 0.5). All modern browsers support it in CSS.