Here's a correct table of percentages to hex values for opacity. E.g. for 50% white you'd use #80FFFFFF. To think in terms of transparency instead, flip the order of the percentages (more opaque = less transparent).

% Hex
100% FF
95% F2
90% E6
85% D9
80% CC
75% BF
70% B3
65% A6
60% 99
55% 8C
50% 80
45% 73
40% 66
35% 59
30% 4D
25% 40
20% 33
15% 26
10% 1A
5% 0D
0% 00

(source question)

Answer from Ben Clayton on Stack Overflow
Top answer
1 of 8
4111

Here's a correct table of percentages to hex values for opacity. E.g. for 50% white you'd use #80FFFFFF. To think in terms of transparency instead, flip the order of the percentages (more opaque = less transparent).

% Hex
100% FF
95% F2
90% E6
85% D9
80% CC
75% BF
70% B3
65% A6
60% 99
55% 8C
50% 80
45% 73
40% 66
35% 59
30% 4D
25% 40
20% 33
15% 26
10% 1A
5% 0D
0% 00

(source question)

2 of 8
185

Short answer: full table of percentages

You can see the full table of percentages to hex values and run the code in this playground in

  • Golang https://play.golang.org/p/l1JaPYFzDkI .
  • Kotlin https://pl.kotl.in/o9BnFYhRn

Ok the table tells the results not how to find the results. The next parts explain how you can calculate yourself.

Short explanation in pseudocode

Percentage to hex values

  1. decimal = percentage * 255 / 100 . ex : decimal = 50*255/100 = 127.5
  2. convert decimal to hexadecimal value . ex: 127.5 in decimal = 7*16ˆ1 + 15 = 7F in hexadecimal

Hex values to percentage

  1. convert the hexaxdecimal value to decimal. ex: D6 = 13*16ˆ1 + 6 = 214
  2. percentage = (value in decimal ) * 100 / 255. ex : 214 *100/255 = 84%

More infos for the conversion decimal <=> hexadecimal

Long answer: how to calculate in your head

The problem can be solved generically by a cross multiplication.

We have a percentage (ranging from 0 to 100 ) and another number (ranging from 0 to 255) then converted to hexadecimal.

  • 100 <==> 255 (FF in hexadecimal)
  • 0 <==> 0 (00 in hexadecimal)

For 1%

  • 1 * 255 / 100 = 2,5
  • 2,5 in hexa is 2 if you round it down.

For 2%

  • 2 * 255 / 100 = 5
  • 5 in hexa is 5 .

The table in the best answer gives the percentage by step of 5%.

How to calculate the numbers between in your head ? Due to the 2.5 increment, add 2 to the first and 3 to the next

  • 95% — F2 // start
  • 96% — F4 // add 2 to F2
  • 97% — F7 // add 3 . Or F2 + 5 = F7
  • 98% — F9 // add 2
  • 99% — FC // add 3. 9 + 3 = 12 in hexa : C
  • 100% — FF // add 2

I prefer to teach how to find the solution rather than showing an answer table you don't know where the results come from.

Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime

🌐
GitHub
gist.github.com › lopspower › 03fb1cc0ac9f32ef38f4
Hexadecimal color code for transparency · GitHub
function convertAlphaToHex(alphaDecimal) { // Convert alphaDecimal to a value between 0 and 1 const alpha = alphaDecimal / 100; // Calculate the equivalent alpha value in the range of 0 to 255 const alphaInt = Math.round(alpha * 255); // Convert alphaInt to hexadecimal string const alphaHex = alphaInt.toString(16).toUpperCase(); // Pad the hexadecimal value with leading zero if needed const paddedAlphaHex = alphaHex.padStart(2, '0'); return paddedAlphaHex; } ... function applyAlphaToColorHex(hexColor, alpha) { var red = parseInt(hexColor.substring(1, 3), 16); var green = parseInt(hexColor.substring(3, 5), 16); var blue = parseInt(hexColor.substring(5, 7), 16); return Qt.rgba(red, green, blue, alpha); }
Discussions

Hexadecimal color code for transparent?
All hex-colors in three-digit or six-digit hex are pure colors, so #000000 will be black in all implementations that follow the official specification. Eight-digit hex means that the last 2 digits represent the alpha value.. so #ffffff00 works. It translates to 255,255,255,0 (white with an alpha of 0, which makes it transparent). This works with every color.. as long as it's eight-digit and the last 2 digits are 00, it will always be transparent. More on reddit.com
🌐 r/webdev
7
3
December 28, 2020
colors - Transparent ARGB hex value - Stack Overflow
Transparency is controlled by the alpha channel (AA in #AARRGGBB). Maximal value (255 dec, FF hex) means fully opaque. Minimum value (0 dec, 00 hex) means fully transparent. Values in between are semi-transparent, i.e. the color is mixed with the background color. More on stackoverflow.com
🌐 stackoverflow.com
hex - What is the hexadecimal code for a transparent color? - Stack Overflow
1 What code would I use to get the hex value of a color when an alpha at about half transparency is applied? More on stackoverflow.com
🌐 stackoverflow.com
Color Hex of the background of Discord Dark?
Discord is a voice, video, and text communication service used by over a hundred million people to hang out and talk with their friends and communities · Short and sweet, I want to make a role that has a color that matches the discord dark background. All my other attempts lead to a slightly ... More on reddit.com
🌐 r/discordapp
4
1
June 22, 2022
🌐
W3Schools
w3schools.com › cssref › tryit.php
HEX colors with transparency
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
The Flerlage Twins
flerlagetwins.com › 2021 › 10 › introducing-transparent-color-hex-code.html
Introducing the Transparent Color Hex Code in Tableau - The Flerlage Twins: Analytics, Data Visualization, and Tableau
However, my understanding is that there are additional levels of transparency as you can set them to 10% transparent, 20%, 30%, etc. and each level has it's own hex code. ... Eager to learn more, I instantly went into Tableau, pulled up the Color Picker and starting typing the code into the hex code field. Unfortunately, it stopped me at 6 characters...because they are hex codes after all, not oct codes! So, here's the trick...you must create a custom color palette that includes the 8-digit hex and then you apply color from the palette itself.
🌐
Ben Frain
benfrain.com › easily-add-transparency-to-any-hex-color-with-4-and-8-digit-hex
Easily add transparency to any HEX color with 4 and 8 digit HEX – Ben Frain
June 16, 2021 - Prefer the video version? Here it is! 4 and 8 digit HEX are great because they let you easily create semi-transparent variations of a HEX colour, without the need to convert it to rgb or HSL first. It’s supported by everything apart from old, pre-chromium Edge so most people can be using them right now....
Find elsewhere
🌐
Android Explained
androidexplained.github.io › android › ui › 2020 › 10 › 12 › hex-color-code-transparency.html
Hexadecimal color code for transparency | Android Explained
October 12, 2020 - In this post we’ll cover how the color transparency works on android. On android the color can be declared in the following format #AARRGGBB · AA - is the bit that’s of most interest to us in this article, it stands for alpha channel · RR GG BB - red, green & blue channels respectively · It is also worth noting that each channel is represented as a hexadecimal number.
🌐
OpenReplay
openreplay.com › tools › rgba-to-hex
RGBA to HEX Converter
Seamless in-app support. ... Convert RGBA color values to hexadecimal format with alpha channel support. This tool helps web developers and designers work with colors that include transparency.
🌐
Medium
kirti-du.medium.com › hexadecimal-color-code-for-transparency-in-android-e2e2108edd0b
Hexadecimal color code for transparency in Android | by Kirti K | Medium
June 1, 2021 - Hexadecimal color code for transparency in Android Transparency is controlled by the alpha channel (AA in #AARRGGBB). Maximal value (255 dec, FF hex) means fully opaque. The minimum value (0 dec, 00 …
🌐
Fausto Capellan, Jr
faustocapellan.com › 2020 › 06 › 01 › how-to-2-add-transparency-to-hex-colors-in-power-apps
How-To #2: Add Transparency to Hex Colors in Power Apps – Fausto Capellan, Jr
June 1, 2020 - We decided to use Hex color values instead of RGB because of its simplicity and because there are many websites that provide color pickers, such as w3schools. I am very familiar with how to apply transparency to colors using RGBA(), but not to hex colors using ColorValue().
🌐
Drawne
drawne.com › home › blog › hex opacity: what is it & hex opacity table
What is it & hex opacity table - Andy Feliciotti
July 5, 2024 - If you want a background color to be semi-transparent, you can use the RGBA color model and specify the opacity using a hexadecimal value. In CSS, this would look like background-color: #000000AA, where “AA” represents the level of opacity. This can be especially useful when you want to create overlays, fade effects, or blend elements together on your website. While it may not be intuitive to find the hex value percentage, here is a handy table to quickly find the opacity to append to your hex color to make it transparent.
🌐
R-project
colorspace.r-forge.r-project.org › reference › adjust_transparency.html
Adjust or Extract Transparency of Colors — adjust_transparency • colorspace
The adjust_transparency function can be used to adjust the alpha transparency of a set of colors. It always returns a hex color specification.
🌐
Hexcalculator
hexcalculator.org › color-opacity
Hex Color Opacity Calculator
December 4, 2025 - Adjust HEX colors with custom opacity levels. Our Hex Color Opacity Calculator creates transparent overlays for UI, design, and CSS work.
🌐
W3Schools
w3schools.com › cssref › css_colors_legal.php
CSS Legal Color Values
A hexadecimal color is specified with: #RRGGBB. To add transparency, add two additional digits between 00 and FF.
🌐
Color Hex
color-hex.com › color-palette › 1014517
Transparent Color Palette
Color Hex » · Color Palettes » · Transparent · 2505194 · 0 Favorites 0 Comments · Login to add palette to your favorites. In your favorite palettes · Download Color Palette · Transparent Dioxazine Purple · Transparent Phthalo Blue ...
🌐
DigitalOcean
digitalocean.com › community › tutorials › css-hex-code-colors-alpha-values
How To Use CSS Hex Code Colors with Alpha Values | DigitalOcean
April 12, 2021 - The alpha value in the hexadecimal format can be a little confusing because it’s hard to conceptualize what a base 16 value for transparency will actually look like. However, the benefit is if you’re already using hex codes in your codebase, now you can update them to change the transparency, too! No color format changes required.