Hex to RGB Converter
Convert hex colour codes to RGB values and back with live colour preview swatch and copy buttons for both formats
HEX Format
#FF5733
RGB Format
255, 87, 51
Hex Color to RGB
Web colour codes use 6 hex digits: first 2 = red (00-FF = 0-255), next 2 = green, last 2 = blue. So #FF0000 = RGB(255, 0, 0) = pure red. #00FF00 = pure green. #0000FF = pure blue. Convert each hex pair to decimal: FF = 255, 80 = 128, 00 = 0.
Common color codes: white #FFFFFF = RGB(255,255,255). Black #000000 = RGB(0,0,0). Grey #808080 = RGB(128,128,128). Bootstrap blue #007BFF = RGB(0,123,255). Many design tools display both formats; HTML/CSS uses both interchangeably (though hex is more compact). Modern CSS supports rgb() function: 'color: rgb(255, 0, 0)'.
Common Hex to RGB Examples
| Hex | RGB | Color |
|---|---|---|
| #FFFFFF | (255, 255, 255) | White |
| #000000 | (0, 0, 0) | Black |
| #FF0000 | (255, 0, 0) | Red |
| #00FF00 | (0, 255, 0) | Green |
| #0000FF | (0, 0, 255) | Blue |
| #FFFF00 | (255, 255, 0) | Yellow |
| #FF00FF | (255, 0, 255) | Magenta |
| #808080 | (128, 128, 128) | Grey |
Frequently Asked Questions
What's the # for?
Just a marker indicating 'hexadecimal color' in CSS. Some contexts allow hex without #; CSS requires it. The digits themselves (FFFFFF) are the hex value; the # is a CSS syntax convention.
Is RGB the same as RGBA?
RGBA adds alpha (transparency): rgba(255, 0, 0, 0.5) = red at 50% opacity. Modern CSS also supports 8-digit hex (#RRGGBBAA) where last 2 hex = alpha. So #FF0000FF = fully opaque red; #FF000080 = 50% transparent red.