About This Tool
HEX to RGB converts hexadecimal colors to CSS rgb() notation so you can use the same color across design files, stylesheets, and development settings. Input is strictly validated, and the preview uses only successfully parsed RGB values.
How to Use
- Enter #FF5733, #09f, or a 3- or 6-digit HEX value without #.
- View the live result or click Convert.
- Check the color preview and three RGB channels, then click Copy RGB.
- Click Clear to remove the input or Load Example to restore the sample color.
Examples
- #FF5733 → rgb(255, 87, 51), with normalized HEX #ff5733.
- #09f → rgb(0, 153, 255), with normalized HEX #0099ff.
- #fff → rgb(255, 255, 255); #000000 → rgb(0, 0, 0).
How the Calculation Works
In a 6-digit HEX color, each pair of digits represents one channel and converts from hexadecimal to an integer from 0 to 255. A 3-digit HEX color repeats each digit first: #09f expands to #0099ff. This tool accepts only opaque RGB HEX colors, not 4- or 8-digit alpha formats.
Common Uses
- Convert design colors to RGB styles.
- Check that shorthand and full HEX values match.
- Inspect the integer value of each red, green, and blue channel.
Privacy
All input processing, calculations, CSS generation, and previews run in your browser. Your content is never uploaded. No backend, database, online API, or third-party CDN is used, and your input is not saved automatically.
FAQ
What is HEX?
HEX represents the three RGB channels in hexadecimal. The 6-digit form uses two digits each for red, green, and blue, in that order.
Are #fff and #ffffff the same?
Yes. Each digit in the 3-digit shorthand is repeated, so #fff normalizes to #ffffff.
Why do #12345 and #gg0000 produce errors?
This tool accepts only 3 or 6 hexadecimal digits. Valid characters are 0–9 and a–f, in either uppercase or lowercase.
Does converting HEX to RGB lose precision?
No. Both 3- and 6-digit opaque HEX colors convert exactly to integer RGB channels.