Hex8 (RGBA Hex) Alpha Converter

Convert 8-digit hex colors (#RRGGBBAA) including alpha channel

Convert 8-digit CSS hex colors with an alpha channel (#RRGGBBAA) to rgba(), split out R, G, B, and alpha, and round-trip back to hex. Accepts shorthand #RGBA too, with a checkerboard transparency preview. Runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is an 8-digit hex color?

It is a CSS hex color with an extra pair of digits for the alpha channel, written #RRGGBBAA. The final byte sets opacity from 00 fully transparent to FF fully opaque, so #ff000080 is red at about 50 percent opacity.

Convert 8-digit hex colors with alpha

The #RRGGBBAA syntax lets a single CSS hex value carry an opacity in its final byte. This converter decodes any 8-digit hex into its red, green, blue, and alpha components, gives you the matching rgba() string, and round-trips back to hex. A checkerboard backing behind the swatch makes the transparency visible so you can judge how the color will actually composite.

How it works

The input is normalized first: shorthand #RGB and #RGBA are expanded by doubling each digit, and a 6-digit value gets an ff alpha appended. The three color bytes are parsed as 0–255 integers exactly as in any hex color. The alpha byte is parsed the same way, then divided by 255 to produce the CSS 01 alpha used in rgba(). Converting back simply reverses this: the 01 alpha is multiplied by 255 and formatted as a two-digit hex byte appended to the color.

Worked example

The value #3b82f6cc decodes as follows:

Byte pairValueMeaning
3b59Red
82130Green
f6246Blue
cc204Alpha → 204 / 255 ≈ 0.800

Result: rgba(59, 130, 246, 0.800) — a medium blue at 80% opacity.

Common alpha byte reference

Knowing a few landmarks helps when writing 8-digit hex by hand:

Alpha byteOpacity
ff100% (fully opaque)
cc80%
9960%
80~50%
6640%
3320%
000% (invisible)

Channel order pitfall — CSS vs Android

CSS and the web use alpha-last order: #RRGGBBAA. Android and several other platforms use alpha-first order: #AARRGGBB. If you copy a color value from Android XML resources or a Kotlin/Java source file, the channels will be in the wrong order here unless you swap the first two bytes with the last two.

For example, Android’s #CC3B82F6 (alpha CC, blue 3b82f6) should be entered as #3B82F6CC in CSS tools like this one.

When to use the alpha-stripped output

The converter also shows the 6-digit hex without alpha, which is useful as a fallback for contexts that do not support 8-digit syntax. For instance, some SVG renderers and older email clients do not understand #RRGGBBAA, so a degradation strategy is to specify the solid 6-digit color first and layer transparency via opacity or a separate attribute.

Browser support for 8-digit hex

The #RRGGBBAA syntax was added in the CSS Color Level 4 specification. Support is broad across modern browsers, but the 4-digit shorthand #RGBA and 8-digit #RRGGBBAA are not understood in:

  • Internet Explorer (all versions)
  • Some older versions of Safari (pre-2020)
  • Certain SVG tooling that has not been updated to Color Level 4

For general web use today, 8-digit hex is safe in modern browsers. For maximum compatibility when targeting legacy environments, use rgba() instead, which has been supported far longer and is what this tool also outputs.

Everything runs in your browser — nothing is uploaded.