What Is HEX Color?
HEX color notation uses hexadecimal (base-16) numbers to express RGB values. Each pair of characters represents one channel (R, G, B) from 00 (0) to FF (255). Example: #FF5733 = R:255, G:87, B:51.
How to Convert HEX to RGB
- Split the HEX code into three pairs: FF, 57, 33
- Convert each pair from base-16 to base-10:
- FF = 15×16 + 15 = 255
- 57 = 5×16 + 7 = 87
- 33 = 3×16 + 3 = 51
- Result: rgb(255, 87, 51)
How to Convert RGB to HEX
- Convert each channel value from decimal to hex:
- Concatenate with # prefix: #FF5733
Shorthand HEX
When each pair is the same digit (e.g., #FFAABB), you can write a 3-digit shorthand: #FAB. Browsers expand this to #FFAABB. Only works when each channel pair is a doubled digit.
Skip the math — use the Color Picker for instant conversion.