Hex Opacity Calculator and Alpha Table
To make a hex colour transparent, add two more hex digits for the alpha: #RRGGBBAA. The pair is the opacity times 255, written in hex, so 50% is 80, 75% is BF and 25% is 40. Pick a colour and opacity below to get the 8-digit hex plus the matching rgba and hsla values.
| Opacity | Alpha pair | Example on #4F98FB |
|---|---|---|
| 90% | E6 | #4F98FBE6 |
| 75% | BF | #4F98FBBF |
| 50% | 80 | #4F98FB80 |
| 25% | 40 | #4F98FB40 |
| 10% | 1A | #4F98FB1A |
Updated
Choose a colour, drag the opacity slider and copy whichever format your code needs. The preview shows the colour over white, black and a checkerboard, along with the solid colour it blends to on each.
Hex opacity table
| Opacity | Hex pair | Decimal (0 to 255) |
|---|---|---|
| 100% | FF | 255 |
| 95% | F2 | 242 |
| 90% | E6 | 230 |
| 85% | D9 | 217 |
| 80% | CC | 204 |
| 75% | BF | 191 |
| 70% | B3 | 179 |
| 65% | A6 | 166 |
| 60% | 99 | 153 |
| 55% | 8C | 140 |
| 50% | 80 | 128 |
| 45% | 73 | 115 |
| 40% | 66 | 102 |
| 35% | 59 | 89 |
| 30% | 4D | 77 |
| 25% | 40 | 64 |
| 20% | 33 | 51 |
| 15% | 26 | 38 |
| 10% | 1A | 26 |
| 5% | 0D | 13 |
| 0% | 00 | 0 |
Reading the alpha pair
A hex pair counts from 00 to FF, which is 0 to 255. The alpha pair uses the same scale, where 00 is fully transparent and FF is fully opaque. That is why the common values look odd at first: half of 255 is 127.5, so 50% rounds to 128, which is 80 in hex.
Designers often export colours from a design file with a separate opacity number. Turning that into a single 8-digit value makes it easy to drop into a design token or a Tailwind config.
Transparent colours in Tailwind
Tailwind adds opacity with a slash after the colour name, for example bg-sky-500/50, which works for any colour in the theme. For a custom colour, an arbitrary value such as bg-[#4F98FB80] accepts the 8-digit hex directly.
Under the hood, Tailwind 4 mixes the colour with transparent using color-mix(), and older versions use rgb() with an alpha. The result on screen is the same as the hex value this tool gives you.
How it works
- Type or pick a base colour. Three, six and eight digit hex all work; an existing alpha pair sets the slider.
- Drag the slider or type a percentage from 0 to 100.
- Copy the 8-digit hex, rgba(), modern rgb() with a slash, hsla() or the Android #AARRGGBB form.
- Check the blended colour on white and on black if you need a solid fallback or want to test text contrast.
Tips
- Alpha pairs are rounded, so a percentage does not always round-trip. 80 in hex is 128 out of 255, which is 50.2%, close enough for any screen.
- Android colour resources put the alpha first (#AARRGGBB), the opposite of CSS. Swapping them is a common reason a colour looks wrong in an app.
- For text, check contrast against the blended colour, not the transparent one. A 60% black on white reads very differently from 60% black on a photo.
- Use the opacity property only when the whole element, children included, should fade. For a see-through background with solid text, put the alpha in the background colour instead.
Frequently asked questions
Do all browsers support 8-digit hex colours?
Yes. The #RRGGBBAA and #RGBA forms come from CSS Color Level 4 and work in every current version of Chrome, Edge, Firefox and Safari. Very old browsers ignore them, so add an rgba() fallback only if you still support those.
How do I convert opacity to hex?
Multiply the opacity (0 to 1) by 255, round to a whole number and write it as two hex digits. For 30%: 0.3 times 255 is 76.5, which rounds to 77, which is 4D in hex. The full table on this page lists every step of 5%.
Is #RRGGBBAA the same as rgba()?
They describe the same colour. rgba(79, 152, 251, 0.5) and #4F98FB80 render identically, apart from the tiny rounding in the hex alpha. Pick whichever your codebase already uses.
What about 4-digit hex?
#RGBA is the short form of #RRGGBBAA, the way #RGB is short for #RRGGBB. Each digit is doubled, so #0008 means #00000088, black at about 53% opacity.
Related: Color converter, Hex colour picker, Colour contrast checker, Colour blindness simulator, CSS text shadow generator.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
More in Free Tools
- Hours Calculator
- HTML Accessibility Checker
- HTML Email Template Builder
- Responsive Embed Code Generator
- HTML Escape and HTML Entities List
- HTML Formatter
- HTML Link Generator
- HTML Minifier
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App