HEX ↔ RGB color converter
Convert colors between HEX (#RRGGBB) and RGB formats.
How the calculation works
Each HEX pair (#RRGGBB) is a 0–255 value in base 16. RGB uses the same three values in base 10. Converting just changes the base.
Examples
- #FF0000 = rgb(255, 0, 0) = pure red.
- #808080 = rgb(128, 128, 128) = mid gray.
Frequently asked questions
Do 3-digit HEX codes work?
Yes, #abc is the same as #aabbcc.
What does each HEX pair mean?
The three pairs are red, green and blue (RRGGBB), each 00 to FF (0 to 255).
How does transparency (alpha) work?
An 8-digit HEX (#RRGGBBAA) adds an alpha channel: 00 = transparent, FF = opaque.
Why are colours written in hexadecimal?
Because each channel is one byte (0–255) and a byte fits exactly two hex digits, matching the computer's binary structure.
How do I spot a grey from its code?
When all three pairs are equal (#333333, #CCCCCC). With no dominant channel the result is always grey.
What does a three-digit hex like #F90 mean?
It is shorthand: each digit doubles, so #F90 equals #FF9900. It only works when both digits in each pair match.
How do I add transparency?
With a fourth pair in #RRGGBBAA form, or with rgba() in CSS where alpha runs from 0 to 1.
Related calculators
More Tech / IT calculators
See all →Download time
Calculate how long a file takes to download at your internet speed.
Subnet (IPv4/CIDR)
Compute network address, broadcast, mask and host count from an IP and CIDR prefix.
Password strength
Estimate password entropy (bits) and crack time from length and character types.
Aspect ratio
Find the aspect ratio (e.g. 16:9) of an image or screen and resize keeping the proportion.
Password generator
Create strong, random passwords with the length and character types you choose. Generated in your browser — nothing is sent.
Pixel density (PPI)
Calculate a screen's pixels per inch (PPI) from its resolution and diagonal size.
Uptime / SLA
Find out how much downtime an uptime SLA allows per year, month, week and day.
Updated on June 18, 2026 · by Rafael Rossi · Methodology & sources