HEX to RGB Converter
Convert colour codes both ways — HEX, RGB and HSL — with a live preview and colour picker.
| HEX | |
|---|---|
| RGB | |
| HSL | |
| CSS |
How to convert HEX to RGB
- Type a hex code like #1E90FF (or #fff), or pick a colour.
- RGB, HSL and a CSS snippet update instantly.
- Type in the RGB box to convert RGB back to HEX.
How HEX to RGB works
A hex colour is three pairs of hexadecimal digits — red, green and blue — each from 00 to FF (0–255). For #1E90FF: 1E = 30, 90 = 144, FF = 255, so the colour is rgb(30, 144, 255). Three-digit codes double each digit (#0AF = #00AAFF); an optional fourth pair is the alpha (opacity).
| Colour | HEX | RGB |
|---|---|---|
| White | #FFFFFF | 255, 255, 255 |
| Black | #000000 | 0, 0, 0 |
| Red | #FF0000 | 255, 0, 0 |
| Lime | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
| Dodger blue | #1E90FF | 30, 144, 255 |
Frequently asked questions
How do I convert RGB to HEX?
Convert each value (0–255) to two hexadecimal digits and join them: rgb(255, 165, 0) → FF A5 00 → #FFA500. Type RGB values into the tool to do it automatically.
What is an 8-digit hex colour?
#RRGGBBAA adds an alpha channel. For example #1E90FF80 is dodger blue at about 50% opacity (0x80 = 128 ÷ 255 ≈ 0.502).
Are HEX codes case-sensitive?
No. #1e90ff and #1E90FF are the same colour.
What is HSL?
Hue (0–360°), saturation and lightness (percentages) — a more intuitive way to adjust colours in CSS.