RGBA to HEX Converter
Convert RGBA to HEX with alpha (8 digits), or turn 8-digit HEX back into RGBA.
rgba(30, 144, 255, 0.5), rgb(30 144 255 / 50%) or a color name
Alpha is the last pair, e.g. #1E90FF80
- HEX (CSS)#RRGGBBAA
- #1E90FF80
- ARGB#AARRGGBB, Android
- #801E90FF
- Android codeColor(0x…)
- 0x801E90FF
- RGBA
- rgba(30, 144, 255, 0.5)
- HEX (no alpha)
- #1E90FF
- Alpha0–1, %, hex byte
- 0.5 = 50% = 80
Same color, two byte orders: CSS puts alpha last (#RRGGBBAA), Android and ARGB formats put it first (#AARRGGBB). Without alpha, use the RGB to HEX converter.
How to convert RGBA to HEX
- Enter red, green and blue (0–255) and alpha (0–1), drag the opacity slider, or paste an
rgba()value. - Copy
#RRGGBBAAfor CSS or#AARRGGBBfor Android, Flutter and other ARGB formats. - To go the other way, pick the byte order and paste an 8-digit HEX code into the HEX field — the RGBA values update instantly.
CSS vs. Android: where the alpha goes
An 8-digit HEX color is four bytes: red, green, blue and alpha. The web and Android agree on everything except the position of the alpha byte. CSS Color Level 4 puts it at the end; Android's Color class, .NET and many design exports put it at the front. Paste one into the other and the colors come out wrong.
CSS #1E90FF80 → RR GG BB AA
Android #801E90FF → AA RR GG BB
Kotlin Color(0x801E90FF)The alpha byte is the opacity × 255, rounded: 0.5 × 255 = 127.5, which rounds to 128 or 80 in hex. Reading it back gives 128 / 255 = 0.502, so a round trip can differ from your input in the third decimal place.
Opacity to HEX alpha
| Opacity | Alpha (0–1) | HEX byte |
|---|---|---|
| 100% | 1 | FF |
| 90% | 0.9 | E6 |
| 80% | 0.8 | CC |
| 75% | 0.75 | BF |
| 70% | 0.7 | B3 |
| 60% | 0.6 | 99 |
| 50% | 0.5 | 80 |
| 40% | 0.4 | 66 |
| 30% | 0.3 | 4D |
| 25% | 0.25 | 40 |
| 20% | 0.2 | 33 |
| 10% | 0.1 | 1A |
| 0% | 0 | 00 |
RGBA to HEX examples
| Swatch | #RRGGBBAA (CSS) | #AARRGGBB (Android) | RGBA |
|---|---|---|---|
| #1E90FF80 | #801E90FF | rgba(30, 144, 255, 0.5) | |
| #00000080 | #80000000 | rgba(0, 0, 0, 0.5) | |
| #00000040 | #40000000 | rgba(0, 0, 0, 0.25) | |
| #FFFFFFCC | #CCFFFFFF | rgba(255, 255, 255, 0.8) | |
| #FF6347BF | #BFFF6347 | rgba(255, 99, 71, 0.75) | |
| #2E8B571A | #1A2E8B57 | rgba(46, 139, 87, 0.1) | |
| #FF0000FF | #FFFF0000 | rgba(255, 0, 0, 1) | |
| #00000000 | #00000000 | rgba(0, 0, 0, 0) |
Related color tools
For opaque colors, the RGB to HEX converter and HEX to RGB converter also give the short 3-digit form. Check that semi-transparent text stays readable with the contrast checker, or find a starting color in the color picker.
Frequently asked questions
- How do I convert RGBA to HEX?
- Convert red, green and blue to two hex digits each, then multiply alpha (0–1) by 255, round it and add it as a fourth pair. rgba(30, 144, 255, 0.5) gives 1E, 90, FF and 80, so the CSS code is #1E90FF80.
- What is the difference between #RRGGBBAA and #AARRGGBB?
- Only the position of the alpha pair. CSS and most web tools use #RRGGBBAA with alpha last. Android, .NET and many design tools use #AARRGGBB (ARGB) with alpha first. The same half-transparent blue is #1E90FF80 in CSS and #801E90FF on Android.
- Which alpha values match common opacities?
- 100% is FF, 75% is BF, 50% is 80, 25% is 40 and 0% is 00. Because alpha has only 256 steps, 50% is stored as 128/255 and reads back as 50.2%.
- Do all browsers support 8-digit HEX colors?
- Yes. #RRGGBBAA and the 4-digit #RGBA short form are part of CSS Color Level 4 and work in all current browsers. For very old browsers, use rgba() instead.
- Can I convert 8-digit HEX back to RGBA?
- Yes. Choose the byte order, paste the code — with #, 0x or no prefix — and the RGBA values, opacity and preview update immediately.