What is 50% opacity in hex?
50% opacity is the alpha code 80, so a blue like #2563eb becomes #2563eb80. The code is 80 because 50% of 255 is 127.5, which rounds to 128, and 128 in hexadecimal is 80.
To make a hex color transparent, add a two-digit alpha code to the end: 80 is 50% opacity, so #2563eb becomes #2563eb80. FF is fully opaque and 00 is fully transparent.
rgba(37, 99, 235, 0.5)#2563EB80hsla(221, 83%, 53%, 0.5)| Opacity | Alpha hex | Example (#000000) |
|---|---|---|
| 100% | FF | #000000FF |
| 99% | FC | #000000FC |
| 98% | FA | #000000FA |
| 97% | F7 | #000000F7 |
| 96% | F5 | #000000F5 |
| 95% | F2 | #000000F2 |
| 94% | F0 | #000000F0 |
| 93% | ED | #000000ED |
| 92% | EB | #000000EB |
| 91% | E8 | #000000E8 |
| 90% | E6 | #000000E6 |
| 89% | E3 | #000000E3 |
| 88% | E0 | #000000E0 |
| 87% | DE | #000000DE |
| 86% | DB | #000000DB |
| 85% | D9 | #000000D9 |
| 84% | D6 | #000000D6 |
| 83% | D4 | #000000D4 |
| 82% | D1 | #000000D1 |
| 81% | CF | #000000CF |
| 80% | CC | #000000CC |
| 79% | C9 | #000000C9 |
| 78% | C7 | #000000C7 |
| 77% | C4 | #000000C4 |
| 76% | C2 | #000000C2 |
| 75% | BF | #000000BF |
| 74% | BD | #000000BD |
| 73% | BA | #000000BA |
| 72% | B8 | #000000B8 |
| 71% | B5 | #000000B5 |
| 70% | B3 | #000000B3 |
| 69% | B0 | #000000B0 |
| 68% | AD | #000000AD |
| 67% | AB | #000000AB |
| 66% | A8 | #000000A8 |
| 65% | A6 | #000000A6 |
| 64% | A3 | #000000A3 |
| 63% | A1 | #000000A1 |
| 62% | 9E | #0000009E |
| 61% | 9C | #0000009C |
| 60% | 99 | #00000099 |
| 59% | 96 | #00000096 |
| 58% | 94 | #00000094 |
| 57% | 91 | #00000091 |
| 56% | 8F | #0000008F |
| 55% | 8C | #0000008C |
| 54% | 8A | #0000008A |
| 53% | 87 | #00000087 |
| 52% | 85 | #00000085 |
| 51% | 82 | #00000082 |
| 50% | 80 | #00000080 |
| 49% | 7D | #0000007D |
| 48% | 7A | #0000007A |
| 47% | 78 | #00000078 |
| 46% | 75 | #00000075 |
| 45% | 73 | #00000073 |
| 44% | 70 | #00000070 |
| 43% | 6E | #0000006E |
| 42% | 6B | #0000006B |
| 41% | 69 | #00000069 |
| 40% | 66 | #00000066 |
| 39% | 63 | #00000063 |
| 38% | 61 | #00000061 |
| 37% | 5E | #0000005E |
| 36% | 5C | #0000005C |
| 35% | 59 | #00000059 |
| 34% | 57 | #00000057 |
| 33% | 54 | #00000054 |
| 32% | 52 | #00000052 |
| 31% | 4F | #0000004F |
| 30% | 4D | #0000004D |
| 29% | 4A | #0000004A |
| 28% | 47 | #00000047 |
| 27% | 45 | #00000045 |
| 26% | 42 | #00000042 |
| 25% | 40 | #00000040 |
| 24% | 3D | #0000003D |
| 23% | 3B | #0000003B |
| 22% | 38 | #00000038 |
| 21% | 36 | #00000036 |
| 20% | 33 | #00000033 |
| 19% | 30 | #00000030 |
| 18% | 2E | #0000002E |
| 17% | 2B | #0000002B |
| 16% | 29 | #00000029 |
| 15% | 26 | #00000026 |
| 14% | 24 | #00000024 |
| 13% | 21 | #00000021 |
| 12% | 1F | #0000001F |
| 11% | 1C | #0000001C |
| 10% | 1A | #0000001A |
| 9% | 17 | #00000017 |
| 8% | 14 | #00000014 |
| 7% | 12 | #00000012 |
| 6% | 0F | #0000000F |
| 5% | 0D | #0000000D |
| 4% | 0A | #0000000A |
| 3% | 08 | #00000008 |
| 2% | 05 | #00000005 |
| 1% | 03 | #00000003 |
| 0% | 00 | #00000000 |
Multiply the opacity percentage by 255, round the result, then convert that number to two-digit hexadecimal. At 50% opacity, 50 × 255 ÷ 100 gives 127.5, which rounds to 128, and 128 in hex is 80. That is why #2563eb at 50% becomes #2563eb80. The 4-digit short form #RGBA also exists, where the last digit is the alpha: #0008 is black at roughly 50% opacity.
50% opacity is the alpha code 80, so a blue like #2563eb becomes #2563eb80. The code is 80 because 50% of 255 is 127.5, which rounds to 128, and 128 in hexadecimal is 80.
Yes. Every current browser, including Chrome, Edge, Firefox, Safari and their mobile versions, supports 8-digit #RRGGBBAA hex colors. Only very old browsers such as Internet Explorer do not.
In CSS the alpha goes at the end, as #RRGGBBAA, so #2563eb80 is blue at 50% opacity. Android color resources use the opposite order, #AARRGGBB, with the alpha at the start.
Both work and render the same color. Use 8-digit hex when you want one compact value that fits a design token or a hex field; use rgba() when you need the alpha as a separate 0–1 number or are already editing an rgb() value.
Convert the same color to other formats, or check the alpha value against the rest of your palette.