How HEX becomes RGB
A six-digit HEX color uses three hexadecimal pairs in the order red, green and blue: #RRGGBB. Each pair ranges from 00 (decimal 0) to FF (decimal 255).
- Remove the optional
#. - Split the code into red, green and blue pairs.
- Convert each pair from base 16 to base 10.
For #FF5733: FF = 15 × 16 + 15 = 255, 57 = 5 × 16 + 7 = 87, and 33 = 3 × 16 + 3 = 51. The result is rgb(255, 87, 51).
What is three-digit shorthand HEX?
CSS allows #RGB when each channel repeats the same digit. Expand each digit before converting: #F53 becomes #FF5533. It does not mean #0F0503. Not every six-digit color can be shortened—only codes such as #AABBCC where both digits in every pair match.
Common HEX to RGB colors
| Color | HEX | RGB |
|---|---|---|
| Black | #000000 | rgb(0, 0, 0) |
| White | #FFFFFF | rgb(255, 255, 255) |
| Red | #FF0000 | rgb(255, 0, 0) |
| Lime | #00FF00 | rgb(0, 255, 0) |
| Blue | #0000FF | rgb(0, 0, 255) |
| Gold | #FFD700 | rgb(255, 215, 0) |
| Slate blue | #6A5ACD | rgb(106, 90, 205) |
HEX to RGB questions
Do I need to type the hash symbol?
No. Both FF5733 and #FF5733 are accepted and normalized to the same result.
Does this converter support transparency?
This page converts solid three- and six-digit HEX colors. Four- and eight-digit alpha codes are intentionally rejected so the RGB result is unambiguous.
Can I use the RGB result in CSS?
Yes. Paste the complete output, such as background-color: rgb(255, 87, 51);.