How to Convert HEX Colors to RGB: Examples Included
2026-08-13
How to Convert HEX Colors to RGB: Examples Included
In web design, colors can be written in several formats: HEX (#FF5733), RGB (rgb(255, 87, 51)), and HSL. Converting between them keeps your colors consistent everywhere.
What Is a HEX Color?
HEX is a base-16 6-digit code (#RRGGBB):
- First 2 digits = Red
- Middle 2 digits = Green
- Last 2 digits = Blue
HEX → RGB Conversion
Convert each pair from base 16 to base 10:
- FF = 255, 57 = 87, 33 = 51
#FF5733 → rgb(255, 87, 51)
More Examples
| HEX | RGB |
|---|---|
| #000000 | rgb(0, 0, 0) — black |
| #FFFFFF | rgb(255, 255, 255) — white |
| #FF0000 | rgb(255, 0, 0) — red |
| #00FF00 | rgb(0, 255, 0) — green |
| #0000FF | rgb(0, 0, 255) — blue |
RGB → HEX
Convert each value to base 16: 255 = FF, 87 = 57, 51 = 33 → #FF5733
Short 3-Digit HEX
3-digit HEX (#F53) is short for #FF5533 — valid when each channel repeats.
Where It Applies
- Writing CSS and web design
- Working with design tools (Figma, Photoshop)
- Keeping brand colors consistent across platforms
Try the color converter to convert colors instantly.