- Home
- Tools
- Color & Design
- Color Converter
- HEX to RGB Converter
HEX to RGB Converter
Type a HEX color code and read its red, green and blue values, ready to copy as rgb() for CSS.
With or without the #. Three digits work too.
In RGB
rgb(30, 144, 255)
Hue
210°Alpha
100%
In the other notations
Name
dodgerblueexact match
HEX to RGB by hand
The converter opens with #1e90ff. This is how that color gets from HEX to RGB, step by step.
- Split
#1e90ffinto three pairs:1efor red,90for green andfffor blue. - Each pair is a number in base 16. The letters a to f stand for 10 to 15, and the first digit counts sixteen times:
1eis 1 × 16 + 14 = 30,90is 9 × 16 + 0 = 144 andffis 15 × 16 + 15 = 255. - Written the CSS way:
rgb(30, 144, 255).
Well-known colors in HEX and RGB
| Color | HEX | RGB |
|---|---|---|
| black | #000000 | rgb(0, 0, 0) |
| white | #ffffff | rgb(255, 255, 255) |
| gray | #808080 | rgb(128, 128, 128) |
| red | #ff0000 | rgb(255, 0, 0) |
| orange | #ffa500 | rgb(255, 165, 0) |
| yellow | #ffff00 | rgb(255, 255, 0) |
| lime | #00ff00 | rgb(0, 255, 0) |
| green | #008000 | rgb(0, 128, 0) |
| cyan | #00ffff | rgb(0, 255, 255) |
| blue | #0000ff | rgb(0, 0, 255) |
| purple | #800080 | rgb(128, 0, 128) |
| magenta | #ff00ff | rgb(255, 0, 255) |
Short codes, capitals and a fourth pair
- A code of three digits is shorthand in which every digit is doubled:
#f80means#ff8800. - Capitals make no difference.
#1E90FFand#1e90ffare the same color. - A fourth pair of digits is the opacity. It is divided by 255, so
#1e90ff80becomesrgba(30, 144, 255, 0.5):80is 128, and 128 ÷ 255 is 0.502. - Two digits in base 16 count from 0 to 255, which is why RGB values stop there.
The color converter shows a color in all seven notations at once, with a picker to choose it by eye.