🎨 RGB to HEX Converter
RGB Sliders
#8040C0
HEX
128,64,192
RGB
278°,50%,50%
HSL
Reverse: Paste HEX
RGB vs HEX
RGB uses three numbers 0-255. HEX is a 6-digit hex code. Both describe the same colours.
Common Colors
| Color | HEX | RGB |
|---|---|---|
| Red | #FF0000 | 255,0,0 |
| Green | #00FF00 | 0,255,0 |
| Blue | #0000FF | 0,0,255 |
| Black | #000000 | 0,0,0 |
| White | #FFFFFF | 255,255,255 |
Frequently Asked Questions
When to use HEX vs RGB?▾
HEX is more compact for CSS. RGB (RGBA) supports opacity. Both work in modern browsers.
What is HSL?▾
HSL = Hue (0-360°), Saturation (0-100%), Lightness (0-100%). More intuitive for picking colours.