How to convert RGB to HEX
Convert each of the three numbers (0–255) to a two-digit base-16 value and join them after a #. For example, rgb(59, 130, 246) → 3B, 82, F6 → #3B82F6.
RGB to HEX examples
| RGB | HEX |
|---|---|
rgb(255, 0, 0) | #FF0000 |
rgb(0, 128, 0) | #008000 |
rgb(255, 215, 0) | #FFD700 |
Frequently asked questions
- How do I convert RGB to hex?
- Convert each of the three numbers (0–255) to a two-digit base-16 value and join them after a
#. For example,rgb(59, 130, 246)→ 3B, 82, F6 →#3B82F6. - What is rgb(0,0,0) in hex?
#000000.