HEX to RGB Color Converter
FreeConvert any HEX color code to RGB values instantly. Enter #FF5733, get RGB(255, 87, 51). Free, browser-based, no signup required.
What's next
Settings guide
HEX format reference:
| Format | Example | Notes |
|---|---|---|
| 6-digit | #FF5733 | Standard. Each pair = one channel (00–FF). |
| 3-digit shorthand | #F53 | Expands to #FF5533. Only valid when each digit doubles. |
| 8-digit with alpha | #FF573380 | Last pair = alpha (00 = transparent, FF = opaque). |
Reading HEX digits:
- ·Each HEX pair ranges from 00 (decimal 0) to FF (decimal 255).
- ·To convert manually: multiply the first digit by 16, add the second digit. E.g. FF = 15×16 + 15 = 255.
- ·Common values: 00=0, 80=128, CC=204, FF=255.
When to use RGB over HEX in CSS:
- ·
rgba()for opacity:rgba(255, 87, 51, 0.5)— easier to read than 8-digit HEX. - ·CSS custom properties that need channel separation:
--color-r: 255; --color-g: 87; - ·JavaScript Canvas API:
ctx.fillStyle =rgb(${r}, ${g}, ${b})``.
Format comparison
HEX vs RGB in CSS: Both work identically — browsers parse them to the same internal representation. HEX is shorter for opaque colors (#FF5733 vs rgb(255, 87, 51)). RGB is clearer for semi-transparent values (rgba(255, 87, 51, 0.5) vs #FF57337F — the alpha is obvious in rgba).
HEX vs HSL: Neither is universally better. HEX/RGB maps directly to screen hardware. HSL is easier for humans to adjust — change the L (lightness) value to lighten or darken without touching hue. Pick HEX for copying from design tools; HSL for programmatic color manipulation.
HEX vs OKLCH (modern CSS): OKLCH is perceptually uniform — equal numerical steps produce equal-looking lightness changes. HEX/RGB are not perceptually uniform. For design systems being built in 2025+, OKLCH is worth learning. For compatibility-sensitive projects, HEX and RGB remain the safe choice.
How it works
Enter HEX
Type or paste your HEX code — with or without the # prefix. Supports 3-digit, 6-digit, and 8-digit (alpha) formats.
Convert
The tool splits the HEX string into pairs, converts each from base-16 to decimal, and displays the RGB values.
Copy
Click any output format to copy it — rgb(), rgba(), or individual R/G/B values.
About this format
HEX and RGB represent the same colors — they are two different notations for the same underlying data. A HEX code like #FF5733 encodes three 8-bit values (Red, Green, Blue) as pairs of hexadecimal digits. FF is 255 in decimal, 57 is 87, and 33 is 51. The RGB equivalent is therefore rgb(255, 87, 51).
You need this conversion when your design tool gives you a HEX value but your CSS framework, canvas API, or programming library expects RGB integers. JavaScript's Canvas API uses separate R, G, B parameters. Many animation libraries accept RGB triplets. Some design tokens systems store colors as integer arrays. HEX works perfectly in CSS but not everywhere else.
The 3-digit HEX shorthand (#F53) expands to 6 digits by doubling each character (#FF5533). 8-digit HEX (#FF573380) adds an alpha channel as the last pair — 80 hex is 128 decimal, meaning 50% opacity. This converter handles all three forms and shows the RGBA equivalent when an alpha channel is present.