Hex to RGB color converter
Convert a hex color (#ff8800) to its RGB equivalent (rgb(255, 136, 0)). The math, the worked example, and a live converter that handles 3-digit, 6-digit, and 8-digit (with alpha) variants.
# conversion
| format | foreground | background |
|---|---|---|
| hex | #ff8800 | #ffffff |
| rgb | rgb(255, 136, 0) | rgb(255, 255, 255) |
| hsl | hsl(32, 100%, 50%) | hsl(0, 0%, 100%) |
| oklch | oklch(75% 0.18 60) | oklch(100% 0 0) |
# context
Hex is the compact, designer-friendly form. RGB is the explicit numeric form CSS, Canvas, and most APIs accept. The conversion is base-16 → base-10 per channel: split the hex into red/green/blue pairs, parse each as a base-16 number, and you have the 0-255 RGB values.
→ Open in color picker (pre-filled)
# notes
- #ff8800 = ff (255 red) + 88 (136 green) + 00 (0 blue) = rgb(255, 136, 0).
- 3-digit hex is shorthand: #f80 expands to #ff8800. Each digit is duplicated.
- 8-digit hex includes alpha: #ff8800cc is rgba(255, 136, 0, 0.8). The last two hex digits are the alpha channel.