HEX to RGB Color Converter
Enter the hex color code to convert to RGB or RGB to Hex.
#FF5733
Hex Color → RGB Breakdown
Red
255
Green
87
Blue
51
What does this Hex to RGB converter do?
It takes a hexadecimal color code (like #FF5733) and converts it to its RGB equivalent — three separate values for Red, Green, and Blue channels, each ranging from 0 to 255. This is useful when you need to use a hex color in software that requires RGB input, or when you want to understand the color composition.
How to Convert Hex to RGB
- Get the 2 left digits of the hex color code and convert to decimal — this is the Red value
- Get the 2 middle digits and convert to decimal — this is the Green value
- Get the 2 right digits and convert to decimal — this is the Blue value
Formula
R = parseInt(hex[0..1], 16)
G = parseInt(hex[2..3], 16)
B = parseInt(hex[4..5], 16)
Example
Hex: #FF5733
R = FF₁₆ = 15×16 + 15 = 255
G = 57₁₆ = 5×16 + 7 = 87
B = 33₁₆ = 3×16 + 3 = 51
Result: rgb(255, 87, 51)
Hex to RGB Color Table
| Color | Hex | R | G | B | Preview |
|---|---|---|---|---|---|
| Black | #000000 | 0 | 0 | 0 | |
| White | #FFFFFF | 255 | 255 | 255 | |
| Red | #FF0000 | 255 | 0 | 0 | |
| Lime | #00FF00 | 0 | 255 | 0 | |
| Blue | #0000FF | 0 | 0 | 255 | |
| Yellow | #FFFF00 | 255 | 255 | 0 | |
| Cyan | #00FFFF | 0 | 255 | 255 | |
| Magenta | #FF00FF | 255 | 0 | 255 | |
| Orange | #FFA500 | 255 | 165 | 0 | |
| Coral | #FF7F50 | 255 | 127 | 80 | |
| Tomato | #FF6347 | 255 | 99 | 71 | |
| Gold | #FFD700 | 255 | 215 | 0 | |
| Silver | #C0C0C0 | 192 | 192 | 192 | |
| Gray | #808080 | 128 | 128 | 128 | |
| Maroon | #800000 | 128 | 0 | 0 | |
| Navy | #000080 | 0 | 0 | 128 |
Technical Details
Hex color codes use 24-bit color (8 bits per channel). The format is #RRGGBB where each pair represents a value from 00 to FF (0-255 in decimal). CSS also supports shorthand #RGB notation where each digit is doubled (#F00 = #FF0000). Modern CSS additionally supports rgba() for transparency and hsl() for hue-saturation-lightness color models.
Frequently Asked Questions
How do I convert a hex color code to RGB?
Split the 6-digit hex code into three pairs (RR, GG, BB) and convert each pair from hexadecimal to decimal. For example, #FF5733 becomes R=255, G=87, B=51.
What is the difference between hex and RGB color formats?
Both represent the same colors. Hex uses a compact 6-character string (#FF5733), while RGB uses three decimal numbers (255, 87, 51). Hex is common in CSS and design tools; RGB is used in programming and image editing.
What does #000000 mean in RGB?
#000000 is black — all three channels (red, green, blue) are at zero. Conversely, #FFFFFF is white with all channels at maximum (255, 255, 255).
Can I use shorthand hex codes like #F00?
Yes. In CSS, 3-digit hex codes are expanded by doubling each digit. So #F00 becomes #FF0000 (pure red), and #09C becomes #0099CC.
Why do designers use hex colors instead of RGB?
Hex codes are shorter to type in CSS and easier to copy/paste. They also make it simple to identify color relationships — similar hex values produce similar colors.