Skip to content

RGBA to Hex Converter

An rgba() color becomes an 8-digit hex code (#RRGGBBAA) by adding the opacity as a fourth hex pair, scaled from 0-1 to 00-FF. Convert below, or read the pair for any opacity straight from the chart. Android ARGB and HSLA are included, and everything runs in your browser.

RGBA to hex example

rgba(255, 87, 51, 0.5) = #FF573380

100% = FF · 80% = CC · 75% = BF · 50% = 80 · 25% = 40 · 10% = 1A

The last pair is the opacity: 0.5 × 255 = 127.5, rounded to 128, which is 80 in hex. Every step from 0% to 100% is in the opacity chart below the converter.

Current Color

#FF573380

50%

Color Values

Hex (8-digit)#FF573380
Hex (no alpha)#FF5733
RGBArgba(255, 87, 51, 0.5)
ARGB (Android)#80FF5733
HSLAhsla(11, 100%, 60%, 0.5)

Hex Opacity Chart: Alpha Percent to Hex Pair

Append the pair to any 6-digit hex code for CSS (#RRGGBBAA), or put it in front for Android (#AARRGGBB). The examples use #FF5733.

OpacityAlphaHex pairCSS #RRGGBBAAAndroid #AARRGGBB
100%1FF#FF5733FF#FFFF5733
95%0.95F2#FF5733F2#F2FF5733
90%0.9E6#FF5733E6#E6FF5733
85%0.85D9#FF5733D9#D9FF5733
80%0.8CC#FF5733CC#CCFF5733
75%0.75BF#FF5733BF#BFFF5733
70%0.7B3#FF5733B3#B3FF5733
65%0.65A6#FF5733A6#A6FF5733
60%0.699#FF573399#99FF5733
55%0.558C#FF57338C#8CFF5733
50%0.580#FF573380#80FF5733
45%0.4573#FF573373#73FF5733
40%0.466#FF573366#66FF5733
35%0.3559#FF573359#59FF5733
30%0.34D#FF57334D#4DFF5733
25%0.2540#FF573340#40FF5733
20%0.233#FF573333#33FF5733
15%0.1526#FF573326#26FF5733
10%0.11A#FF57331A#1AFF5733
5%0.050D#FF57330D#0DFF5733
0%000#FF573300#00FF5733

RGBA to Hex Formula

An RGBA color becomes an 8-digit hex code by converting each channel to hexadecimal, including the alpha channel scaled to 0-255:

  1. Convert R, G, and B (0-255) to two-digit hex pairs, exactly like a normal hex code.
  2. Multiply the alpha value (0-1) by 255 and round to a whole number.
  3. Convert the alpha number to a two-digit hex pair.
  4. Concatenate as #RRGGBBAA. For Android ARGB, place the alpha pair first: #AARRGGBB.

Example: convert rgba(255, 87, 51, 0.5) to hex

R = 255 → FF, G = 87 → 57, B = 51 → 33

A = 0.5 × 255 = 128 → 80

CSS 8-digit hex: #FF573380

Android ARGB: #80FF5733

How to Use the RGBA to Hex Converter

Paste an rgba() value like rgba(255, 87, 51, 0.5), an 8-digit hex code, or a plain hex color, then fine-tune transparency with the alpha slider. The tool outputs the CSS 8-digit hex, the hex without alpha, the rgba() string, the Android ARGB code, and the HSLA equivalent - each with a copy button. The checkered preview shows the real transparency.

Understanding Hex Alpha Notation

Standard 6-digit hex codes have no way to express transparency, which is why rgba() existed long before hex alpha. CSS Color Level 4 added 8-digit hex, where the final two digits encode opacity from 00 to FF. Because the scale is 0-255 rather than 0-100, common opacities map to non-obvious pairs: 80% is CC, 50% is 80, 25% is 40, and 10% is 1A.

Common Use Cases

Converting overlay and shadow colors from design tools that export rgba() into compact hex tokens, translating web colors into Android ARGB resources, building design token files that standardize on 8-digit hex, and debugging why a pasted #AARRGGBB value renders wrong in CSS.

Frequently Asked Questions about RGBA to Hex Converter

An 8-digit hex code appends two extra digits for alpha: #RRGGBBAA. The alpha pair ranges from 00 (fully transparent) to FF (fully opaque). For example, 50% opacity is 80, so rgba(255, 87, 51, 0.5) becomes #FF573380.