HEX to RGBA Converter

Converts between hex colour notation and rgba(), including the alpha channel in both directions — eight-digit hex to rgba and back. Useful whenever a design tool gives you one form and your code wants the other.

Live demo · real result from this tool
8-digit hex (#rrggbbaa) and rgba() keep their own alpha.
Multiplies the colour's own alpha.
rgba()rgba(59, 130, 246, 0.8)
8-digit HEX (CSS, alpha last)
#3b82f6cc
Modern rgb()
rgb(59 130 246 / 80%)
Android / ARGB (alpha first)
#cc3b82f6
6-digit HEX (alpha dropped)
#3b82f6

Common alpha values

OpacityAlphaHEX suffix
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
5%0.050D
0%000

14 rows — scroll inside the table, or download the CSV.

Processed on your device — nothing is uploaded.

How to use HEX to RGBA Converter

  1. Enter a hex value, with or without alpha, or an rgba() string.
  2. Read the equivalent in the other notation.
  3. Copy whichever form your stylesheet or design tool expects.
  4. CSS puts alpha last in eight-digit hex; Android resources put it first.
  5. 80 is 50% alpha, 1A is 10%, FF is opaque — the value is the percentage of 255.
  6. Check contrast on the blended result, not on the transparent colour.

Eight-digit hex is alpha, and it is well supported

#3B82F680 is the same colour as rgba(59, 130, 246, 0.5): the last two digits are the alpha channel, from 00 for fully transparent to FF for fully opaque. Every browser in current use supports it, so the old habit of converting to rgba() purely for transparency is no longer necessary. The one thing to watch is order: CSS puts alpha last, while some other ecosystems — notably Android — put it first, so #803B82F6 in an Android resource is the same colour written the other way round.

The alpha values worth knowing

FF is 100%, BF is 75%, 80 is 50%, 40 is 25%, 1A is 10% and 0D is 5%. The conversion is simply the percentage of 255 in hexadecimal, and those six cover most interface work: overlays, hover tints, disabled states and shadows. Note that CSS alpha is a decimal from 0 to 1, not a percentage, though modern CSS accepts a percentage too.

Transparency versus a solid blend

A semi-transparent colour composites against whatever is behind it, so the same value looks different on white and on a photograph. That is usually what you want for an overlay and usually not what you want for text, where you should compute the resulting blended colour and check that against the background for contrast — a contrast checker fed the transparent colour gives an optimistic answer. For a fixed background, blending to a solid hex also renders marginally faster and avoids the compositing entirely.

Frequently asked questions

How do I turn hex into rgba?
Split the hex into red, green and blue pairs, convert each to 0–255, then add your chosen alpha value to form rgba().
What alpha value should I use?
Alpha ranges from 0 (invisible) to 1 (solid). 0.5 is half-transparent; pick the value that matches your design.
Does it accept shorthand hex?
Yes — 3-digit shorthand like #f00 is expanded to #ff0000 before the rgba() value is produced.
How do I add transparency to a hex colour?
Append two hex digits: #3B82F6 becomes #3B82F680 at about 50%. Every current browser supports eight-digit hex, so there is no need to convert to rgba() just for an alpha channel.
What is 50% opacity in hex?
80. The alpha byte is the percentage of 255, so 50% is 127.5 which rounds to 0x80. 75% is BF, 25% is 40 and 10% is 1A.
Does a transparent colour affect accessibility contrast?
Yes, and a contrast checker given the transparent value will be optimistic. Work out the colour that actually results once it composites over the background, and check that. Against a varying background, such as a photograph, check the worst case.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close