HEX to RGB converter
Paste a HEX code and copy its RGB values.
RGB
Values
HSL
How it works
#4285F4
42 → 4 × 16 + 2 = 66
85 → 8 × 16 + 5 = 133
F4 → 15 × 16 + 4 = 244
= rgb(66, 133, 244)HEX to RGB chart
| Color | HEX | RGB |
|---|---|---|
| Black | ||
| White | ||
| Red | ||
| Lime | ||
| Blue | ||
| Yellow | ||
| Cyan | ||
| Magenta | ||
| Silver | ||
| Gray | ||
| Maroon | ||
| Olive | ||
| Green | ||
| Purple | ||
| Teal | ||
| Navy | ||
| Orange | ||
| Pink |
Questions
How do I convert HEX to RGB?
Split the code into three pairs and read each in base 16. #4285F4 is 42, 85, and F4: rgb(66, 133, 244).
How do I read a three-digit HEX code?
Double each digit. #F60 is #FF6600, which is rgb(255, 102, 0).
What is an eight-digit HEX code?
The last pair is the alpha, from 00 (invisible) to FF (solid). #4285F480 is rgba(66, 133, 244, 0.5).
Should I use HEX or RGB in CSS?
Either. They give the same color in every browser. HEX is shorter, and RGB is easier to adjust in code.