Hex Color Opacity Calculator
Hex Color Opacity Calculator. Enter your Hex Color and an opacity percentage, and the Hex Color Opacity Calculator instantly adds it to Hex Output (with alpha). Use the signed integer to hex converter to convert a negative decimal number to hex, since the underlying two's complement math is identical.
Turn any six-digit color into a see-through one with the Hex Color Opacity Calculator, which converts a hex color code and an opacity percentage into an 8-digit hex value and an RGBA string you can paste straight into CSS. Enter your color, set the opacity level between 0% and 100%, and the tool shows the blended result over a white background, so your web design and UX decisions never rest on guesswork. The two-digit alpha value it returns works the same way in digital graphics, UI components and brand colors.
What Is a Hex Color Opacity Calculator?
A color calculator for transparency takes a standard hexadecimal color such as #7B3FE4, adds an alpha channel, and returns the color in a form that browsers and design apps can render with partial transparency. A normal hex code carries only red, green and blue. The alpha channel is a fourth value that says how much of the color shows through, from fully transparent at 0% to fully opaque at 100%. Use the ebcdic to text converter to turn mainframe-style EBCDIC hex data into readable text without manually mapping code points.
This matters because a flat color rarely does the whole job in an interface. Overlays, glassmorphism panels, soft shadows and layered cards all depend on a color that lets whatever sits behind it show through. Instead of working the math out by hand, you type the hex code and the opacity, and the calculator gives you the matching #RRGGBBAA value, the equivalent rgba string and a preview of the blended color.
Why alpha is stored as two hexadecimal digits
Each channel in a color code is one byte, a number from 0 to 255 written as a two-digit hexadecimal pair. Alpha gets the same treatment: 00 means no color at all and FF means the full color. That is why the hexadecimal system shows up in every transparency conversion, and why a percentage has to be scaled to 255 before it can be written as an alpha value.
How to Add Hex Opacity to Any Color in Four Steps
The calculator has two inputs and two kinds of output, so a full conversion takes a few seconds. When you need octal values for permission bits or legacy file systems, the decimal to octal converter converts each decimal number in one pass.
Enter the hex color code
Type a 3-digit or 6-digit hex color code, with or without the leading hash. Common HTML color names such as navy or tomato work as well, and you can autofill the field from a sample swatch if you only want to experiment.
Set the opacity level
Choose any opacity level from 0 to 100 percent, either by typing it or by dragging one of the sliders. Values are in percent, so 35 means 35% of the color shows and 65% of the background shows through.
Click the Convert button
Press the Convert button. The calculator scales your percentage to the 0–255 range, writes it as hex, appends it to your color and builds the matching RGBA string in one pass.
Read the results and copy them
You get three outputs: the 8-digit hex code, the RGBA value for CSS, and the solid color you would see if the transparent color were blended over a white background. Copy any of them to the clipboard and click Clear to start a new color.
Hex Opacity Formula: Converting Percent to an Alpha Value
Two short formulas sit behind every result. The first turns a percentage into the two hex digits you append to the color:
$$\text{alpha}_{\text{hex}} = \text{round}\left(\frac{\text{opacity}\%}{100} \times 255\right)\ \text{written in base 16}$$
The second blends the transparent color with the surface behind it, one channel at a time:
$$C_{\text{out}} = C_{\text{color}} \times \alpha + C_{\text{background}} \times (1 - \alpha)$$
Here \(\alpha\) is the opacity written as a decimal between 0 and 1, and \(C\) stands for the red, green or blue channel on a 0–255 scale.
Worked example: #7B3FE4 at 35% opacity
Take the violet #7B3FE4, which is rgb(123, 63, 228), and set it to 35% opacity. Multiply 0.35 by 255 to get 89.25, and rounding gives 89, which is 59 in hexadecimal. Appending it gives #7B3FE459, and the RGBA form is rgba(123, 63, 228, 0.35).
To see the blend over white, run each channel through the second formula:
- Red: 123 × 0.35 + 255 × 0.65 = 208.8, which rounds to 209 (D1)
- Green: 63 × 0.35 + 255 × 0.65 = 187.8, which rounds to 188 (BC)
- Blue: 228 × 0.35 + 255 × 0.65 = 245.55, which rounds to 246 (F6)
The blended result is #D1BCF6, a pale lavender. Over a dark navy surface such as #1A1A2E the same 35% violet blends to #3C276E, a deep purple. One transparent color, two different looks: that is exactly why a preview against the real background beats guessing.
Hex Opacity Table for Common Transparency Levels
If you only need a quick lookup, this table lists the alpha pair for the opacity steps designers reach for most. Append the pair to any six-digit hex code. The values use standard rounding, so 50% becomes 80 (128 in decimal, since 127.5 rounds up).
| Opacity (%) | Alpha (0–255) | Hex Code |
|---|---|---|
| 100 | 255 | FF |
| 95 | 242 | F2 |
| 90 | 230 | E6 |
| 80 | 204 | CC |
| 70 | 179 | B3 |
| 60 | 153 | 99 |
| 50 | 128 | 80 |
| 40 | 102 | 66 |
| 30 | 77 | 4D |
| 20 | 51 | 33 |
| 10 | 26 | 1A |
| 5 | 13 | 0D |
| 0 | 0 | 00 |
Black at 40% is therefore #00000066, and any color followed by 00 is a transparent hex code that shows nothing at all. Some tools truncate instead of rounding and show 7F for 50%; both versions are valid CSS and the visual difference is imperceptible.
Fixing Faded Helper Text with an Alpha Value and RGBA Output
Marisol is polishing the billing screen of a client dashboard. The brand's dark green, #1B4D3E, already styles the headings, and she wants the small helper text under each field to look like a softer cousin of it rather than a separate gray. Her plan is to keep the same green and lower its opacity.
She enters #1B4D3E and 62 into the opacity calculation and presses Convert. The tool scales 0.62 × 255 to 158.1, rounds to 158, and returns the alpha pair 9E, so the code is #1B4D3E9E and the CSS value is rgba(27, 77, 62, 0.62). The blended preview over the page's white background reads #729187, a muted sage.
The sage looks pleasant, but Marisol checks it against the rule her team ships to: WCAG 2.1 level AA asks for a 4.5:1 contrast ratio on normal-size text. Computing the contrast of #729187 against white gives 3.43:1, so the helper text fails by more than a full point. The pretty result is not a usable one.
She keeps the color, raises one input and converts again with 78 percent:
- Alpha: 0.78 × 255 = 198.9, which rounds to 199 and is C7
- Output: #1B4D3EC7, or rgba(27, 77, 62, 0.78)
- Blended over white: #4D7468, which measures 5.23:1 and clears AA
That figure settles the decision. Marisol pastes the RGBA line into the helper-text style, saves 78% as the "text-muted" design token, and notes in the pull request that anything below roughly 72% on white starts to approach the 4.5:1 floor, so nobody lowers it later without rechecking.
8-Digit Hex vs RGBA vs the CSS Opacity Property
Three CSS approaches handle transparency, and they are not interchangeable. Picking the right one avoids washed-out text and surprise side effects.
#RRGGBBAA and the 4-digit shorthand
The 8-digit form adds transparency to a single color value and works anywhere a color is accepted: a background-color, a border, text or a box-shadow. CSS also allows a 4-digit shorthand, so #0F08 means the same as #00FF0088. The shorthand only works when every pair repeats the same digit, which is why the full form is more common.
RGBA and HSLA
RGBA and HSLA put the alpha channel in a 0–1 decimal, so 0.5 means 50% and no hex conversion is needed. Both produce results identical to the 8-digit hex; they are different syntax for the same color, and the rgb form is simply easier to read at a glance.
The opacity property and child elements
The opacity property behaves differently. Setting opacity: 0.5 fades the entire element, and its children inherit the effect, so text inside a semi-transparent card fades with it. To keep text fully visible while only the background is see-through, use a hex color with an alpha pair or an RGBA syntax value on the background alone.
Using Alpha Transparency in CSS and Design Tools
Once you have the output, the next question is where it belongs. These are the places a transparent color earns its keep.
Overlays, hover effects and box shadows
Each of these starts from the 8-digit hex or RGBA result the calculator returns for a chosen opacity.
- Dark overlays behind modals, usually black at 50%, which the table gives as #00000080
- Subtle hover effects that tint a button or table row with the brand color at 10%, which appends 1A
- Soft shadows and glows, such as a box shadow of
0 4px 6px #00000033, where black at 20% (alpha 33) keeps the edge gentle - Frosted glassmorphism cards built from layered translucent fills over gradients and photos and faint borders marking each of the stacked layers
Figma, Webflow and design tokens
Design apps such as Figma and Webflow accept an RGBA or 8-digit value directly, so the calculator's output drops into a fill field without conversion. Storing the result as a named design tokens entry keeps every component on the same alpha, and your style guides can then record the opacity next to the base color rather than as an unexplained magic number.
Android and Kotlin's AARRGGBB order
Android and Kotlin reverse the web order and expect alpha first, in the form #AARRGGBB. The alpha pair from the table still applies; you only move it to the front. The violet from the worked example becomes #597B3FE4 on Android.
Browser Support, Rounding and Print Matching
Eight-digit hex colors are supported in every current evergreen browser with consistent rendering across engines, so browser support is rarely a concern for new projects. Very old browsers ignore the declaration entirely, which is why some teams ship an RGBA fallback line first. Because the calculation is client-side, your colors never leave the page.
Rounding is the other thing worth knowing. A percentage rarely lands on a whole alpha byte, so the stored value can differ from your target by up to half a step, about 0.2%. That gap is invisible on screen. If you are matching a mockup for print, preview the blended color over the paper or white background first, since the solid result is what ink will actually reproduce.
When you need other conversions, a color converter or color picker pairs well with this page: use one to find the hex code, then come back to add opacity. The same alpha logic also powers a hex to rgba change and the reverse rgba to hex direction. A plain hex 2 rgba color calculator stops at the conversion, while the Hex Color Opacity Calculator goes on to blend and preview the result. Whoever uses it, whether designers, developers or content teams, gets one consistent format across every platform.