HEX to RGB Converter
Turn a HEX colour code into RGB and HSL.
Quick answer: Type a HEX code to get RGB and HSL. For example #1E90FF is rgb(30, 144, 255) and hsl(210, 100%, 56%).
How to use it
- Enter a HEX code such as #1E90FF, or the red, green and blue numbers, or pick a colour.
- HEX, RGB and HSL appear together.
- Press Copy next to the one you need.
HEX is red, green and blue as two hexadecimal digits each (00 to FF). RGB gives the same numbers in decimal (0 to 255).
Common colours
| Colour | HEX | RGB |
|---|---|---|
| Black | #000000 | 0, 0, 0 |
| White | #FFFFFF | 255, 255, 255 |
| Red | #FF0000 | 255, 0, 0 |
| Green | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
| Yellow | #FFFF00 | 255, 255, 0 |
| Orange | #FFA500 | 255, 165, 0 |
| Gray | #808080 | 128, 128, 128 |
How a HEX colour is built
A HEX colour such as #1E90FF has three pairs of digits: red 1E, green 90 and blue FF. Each pair is a number from 00 to FF (0 to 255). 1E is 30, 90 is 144, and FF is 255, so #1E90FF is rgb(30, 144, 255). A short code like #F80 doubles every digit to make #FF8800.
Choosing readable colours
Text needs enough contrast against its background. The web accessibility guidelines ask for a contrast ratio of at least 4.5 to 1 for normal text. Dark text on a light background is the safest choice, and a pale color on white is hard to read.
RGB to HEX Converter
Common colours
| Colour | HEX | RGB |
|---|---|---|
| Black | #000000 | 0, 0, 0 |
| White | #FFFFFF | 255, 255, 255 |
| Red | #FF0000 | 255, 0, 0 |
| Green | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
| Yellow | #FFFF00 | 255, 255, 0 |
| Orange | #FFA500 | 255, 165, 0 |
| Gray | #808080 | 128, 128, 128 |
Converting by hand
Turn each of the three numbers into a two-digit hex value, then join them with a # in front. To convert a number to hex, divide it by 16: the quotient is the first digit and the remainder is the second. 255 is FF, 128 is 80, 30 is 1E and 0 is 00. So rgb(255, 128, 0) is #FF8000, a bright orange.
When to use which
HEX and RGB describe the same colours. HEX is shorter to write in style sheets and design tools, while RGB is easier to adjust by number. HSL describes a colour by hue, saturation and lightness, which is the easiest way to make a colour lighter or darker.
What people use it for
- Homework and school projects
- Quick checks without a calculator
- Puzzles and games
- Learning how codes work
Questions
What is #FF0000 in RGB?
rgb(255, 0, 0), pure red.
What does a 3-digit HEX code mean?
Each digit is doubled: #F80 is #FF8800.
What is HSL?
Hue (0 to 360 degrees), saturation and lightness.
Is it free?
Yes. No sign-up, no install and no limit.
Is anything saved or sent?
No. Everything runs in your browser. Only your own best score, where a page shows one, is kept on your device.
Last updated 2026-10-25. Free to use, no sign-up. Made by ficklestudio26.