HEX to RGBA converter
Paste a color such as #FF800080 to get the channel values, the alpha and a ready rgba() string.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter hex color.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Each pair of hex digits becomes a number from 0 to 255, and alpha = A byte ÷ 255. A code without alpha means alpha = 1.
Example
Inputs: HEX color = #FF800080. Result: CSS rgba(): rgba(255, 128, 0, 0.502); Red R: 255; Green G: 128.
#FF800080
rgba(255, 128, 0, 0.502)
Limits and caveats
- Assumes CSS order with alpha last; Android #AARRGGBB codes need the Android tool.
- Alpha in the rgba() string is rounded to 3 decimals.
Questions about this tool
What is the difference between HEX and RGBA?
Both describe the same color. HEX writes values in base 16, while rgba() uses decimal numbers plus alpha from 0 to 1.
Why is alpha 0.502 and not 0.5?
The byte 80 equals 128, and 128 ÷ 255 = 0.502. No byte gives exactly 0.5.
Does it accept the short #RGBA form?
Yes. Each digit is doubled, so #0F08 becomes #00FF0088.
