All the Tools You Need

Hex to RGB Converter – Hexadecimal to RGB Color Converter

🎨 Hex to RGB Converter

Hex → RGB
RGB → Hex
RGB values
rgb(255, 87, 51)
Hex: #FF5733
Red
255
Green
87
Blue
51
Decimal: rgb(255,87,51) · Hex: #FF5733
Conversion formulas
Hex → RGB: #RRGGBB → (0xRR, 0xGG, 0xBB)
RGB → Hex: (R,G,B) → #RRGGBB (each component 0‑255)
Short hex: #RGB expands to #RRGGBB (e.g., #F80 → #FF8800)
People Also Ask
🔢 What is a hex color code?
A hex color code represents colors in hexadecimal format: #RRGGBB. Each pair (RR, GG, BB) ranges from 00 to FF (0‑255 decimal).
🔄 How do I convert hex to RGB manually?
Split the 6‑digit hex into three 2‑digit parts, convert each from hexadecimal to decimal. Example: #FF5733 → FF=255, 57=87, 33=51 → rgb(255,87,51).
🎨 What are web‑safe colors?
216 colors that display consistently on old 8‑bit screens. Each RGB component is limited to 00,33,66,99,CC,FF (0,51,102,153,204,255).
📐 What about 3‑digit hex codes?
Shorthand like #F80 expands to #FF8800 by doubling each digit. Used in CSS for brevity.
Web‑safe color cube (partial)
HexRGBColor
#000000(0,0,0)
#333333(51,51,51)
#666666(102,102,102)
#993333(153,51,51)
#CC3333(204,51,51)
#FF3333(255,51,51)
#33FF33(51,255,51)
#3333FF(51,51,255)
Each component in web‑safe colors is one of 00,33,66,99,CC,FF.
Frequently Asked Questions
Can I use 3‑digit hex codes like #F80?
Yes, in CSS you can use shorthand: #F80 expands to #FF8800. Our converter handles 3‑digit codes as well (they are automatically expanded).
What about lowercase hex letters?
Hex codes are case‑insensitive. #ff5733 is the same as #FF5733. Our converter accepts both.
How do I convert RGB to hex without a calculator?
Divide each component by 16 to get the first hex digit, remainder is the second digit. For example, 87/16 = 5 remainder 7 → 0x57.
Scroll to Top