HEX to RGB Converter
Convert HEX color codes to RGB values instantly. Enter a HEX code like #FF5733 and get the RGB equivalent (255, 87, 51). See a live color preview as you type.
How HEX to RGB conversion works
A HEX color code like #FF5733 contains three pairs of hexadecimal digits: FF (red = 255), 57 (green = 87), 33 (blue = 51). Each pair converts from base-16 to a decimal value between 0–255. The conversion formula: R = parseInt(hex.substr(0,2), 16), G = parseInt(hex.substr(2,2), 16), B = parseInt(hex.substr(4,2), 16).
When to use RGB vs HEX
HEX codes are compact (#FF5733) and standard in web design. RGB notation — rgb(255, 87, 51) — is more readable and supports an alpha channel as rgba(255, 87, 51, 0.5). Use HEX in CSS shorthand and design tools; use RGB/RGBA when you need transparency or programmatic color manipulation.
Frequently Asked Questions
What is the RGB equivalent of #000000?
rgb(0, 0, 0) — pure black. Each hex pair (00) converts to decimal 0.
Can HEX codes have transparency?
Yes. 8-digit HEX codes include alpha: #FF573380 where 80 (hex) = 128 (decimal) = 50% opacity. Not all tools support 8-digit HEX; RGBA is more widely compatible.