Advertisement
HEX to RGB Converter
Convert between HEX, RGB and HSL color codes with a live preview swatch.
Advertisement
How to Use This Converter
Type a HEX code, or enter RGB values — both directions update instantly, along with the HSL equivalent and a preview swatch.
- HEX codes may include the # or omit it; 3-digit shorthand (#4f4) also works.
- RGB values must be between 0 and 255.
Frequently Asked Questions
What does HSL stand for?
Hue (the color angle, 0-360), Saturation (0-100%) and Lightness (0-100%) — a more intuitive model for adjusting colors.
Can I use 3-digit hex like #f00?
Yes. Each digit is doubled: #f00 becomes #ff0000 (red). This shorthand is supported by CSS.
Why is my hex invalid?
It must contain exactly 6 hex digits (0-9, a-f) or 3. Anything else — including spaces — is rejected.
What about alpha/transparency?
This tool handles opaque colors. CSS 8-digit hex (#RRGGBBAA) is not yet supported here.
Practical Example
Convert the hex code #FF5733:
- Split it into pairs:
FF,57,33. - Convert each pair from base 16:
FF= 255,57= 87,33= 51. - Result:
rgb(255, 87, 51)— a vivid orange.
What Your Results Mean
- RGB — red, green and blue intensity from 0 (off) to 255 (full).
rgb(255, 87, 51)means full red, partial green, low blue. - HEX — the same three channels written in hexadecimal: each pair
00–FFequals 0–255. - HSL — hue (0–360 degrees on the color wheel), saturation (0–100%) and lightness (0–100%), a more intuitive model for tweaking a color.
- Preview swatch — the live color chip shows exactly how the code renders on screen.
Trusted Sources
Advertisement