Skip to content

RGBA to HEX Converter

Convert RGBA to HEX with alpha (8 digits), or turn 8-digit HEX back into RGBA.

RGBA: red, green, blue (0–255) and alpha (0–1)

rgba(30, 144, 255, 0.5), rgb(30 144 255 / 50%) or a color name

HEX byte order
Byte order of the 8-digit HEX input

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

  1. Enter red, green and blue (0–255) and alpha (0–1), drag the opacity slider, or paste an rgba() value.
  2. Copy #RRGGBBAA for CSS or #AARRGGBB for Android, Flutter and other ARGB formats.
  3. 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.

The same 50 % transparent blue, rgba(30, 144, 255, 0.5)
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 percentages and the alpha byte they become
OpacityAlpha (0–1)HEX byte
100%1FF
90%0.9E6
80%0.8CC
75%0.75BF
70%0.7B3
60%0.699
50%0.580
40%0.466
30%0.34D
25%0.2540
20%0.233
10%0.11A
0%000

RGBA to HEX examples

RGBA values with their CSS and Android HEX codes
Swatch#RRGGBBAA (CSS)#AARRGGBB (Android)RGBA
#1E90FF80#801E90FFrgba(30, 144, 255, 0.5)
#00000080#80000000rgba(0, 0, 0, 0.5)
#00000040#40000000rgba(0, 0, 0, 0.25)
#FFFFFFCC#CCFFFFFFrgba(255, 255, 255, 0.8)
#FF6347BF#BFFF6347rgba(255, 99, 71, 0.75)
#2E8B571A#1A2E8B57rgba(46, 139, 87, 0.1)
#FF0000FF#FFFF0000rgba(255, 0, 0, 1)
#00000000#00000000rgba(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.