HEX to RGB Converter
Paste a HEX color code and get its exact RGB and RGBA values, plus HSL and a live preview.
About the HEX to RGB Converter
Paste a HEX color code and get its exact RGB and RGBA values, plus HSL and a live preview. Every value is computed locally with vanilla JavaScript — there is no server round-trip, no sign-up and no limit on how many times you use it.
How to use
Enter a HEX code
Type or paste a HEX value such as #3B82F6 into the input, or use the color box to pick one visually.
Watch it convert
As you type, the tool validates the code and converts it the moment it is complete.
Read the values
See the matching RGB, RGBA and HSL values appear directly below the input.
Copy what you need
Tap the copy icon next to any value to send it straight to your clipboard.
Benefits
Instant results
Conversion happens as you type — no submit button, no waiting.
Accurate every time
Each channel is converted from base-16 with no rounding surprises.
Private by default
Your colors are processed in the browser and never sent anywhere.
Features & supported formats
Features
- Live HEX validation as you type
- 3- and 6-digit HEX support
- RGB, RGBA and HSL output
- One-tap copy on every value
- Visual color picker fallback
Supported formats
Accuracy & limitations
HEX and RGB are two spellings of the same sRGB triplet, so this conversion loses nothing — but the HSL shown beside it is rounded, and the sRGB assumption matters on a wide-gamut screen.
- HEX and RGB describe the same sRGB color, so this conversion is exact — no rounding and no approximation in either direction.
- Shorthand like #F80 is expanded by doubling each digit, which is the standard rule, not a guess.
- The HSL values shown alongside are rounded to whole degrees and percentages for readability. Converting them back may land one unit away from the original.
- Colors are interpreted as sRGB. An image tagged with a wider gamut such as Display P3 may look more saturated on screen than this code suggests.
Frequently asked questions
What is a HEX color code?
A HEX code is a six-digit hexadecimal representation of red, green and blue, written as #RRGGBB. Each pair of characters describes one channel from 00 to FF.
How do I convert HEX to RGB by hand?
Split the code into three pairs and convert each from base-16 to base-10. For example #FF8800 becomes R=255, G=136, B=0.
Does it support 3-digit shorthand?
Yes. Shorthand like #F80 is expanded to #FF8800 automatically before conversion.
Can I paste a code with no hash?
Yes. The leading # is optional; the tool adds it for you.
Is my data uploaded anywhere?
No. Everything runs locally in your browser, so nothing leaves your device.
Further reading
Color Models Explained
What each color model actually measures, where each one is the right choice, and why the same color has six different sets of numbers.
Front-endColor in CSS
Every way CSS lets you write a color, when custom properties beat hard-coded values, and what the newer color functions change.