What is colour opacity?
Opacity is how see-through a colour is. A colour at 100% opacity is solid — you see only it. A colour at 0% opacity is invisible — you see only what is behind it. A colour at 50% opacity is a mix: half of it, half of the background showing through. Every overlay, watermark, shadow, and translucent panel on a screen is an opacity calculation.
The question this calculator answers is simple: if I put this colour at this opacity over that background, what colour do I actually get? The answer is not a guess, and it is not the average of the two colours. It is a precise blend, and the blend depends on the opacity in a way that surprises people — a 50% red over white is not pink, it is a light red that is much closer to white than most people expect.
Designers need the answer because screens show the blended colour, not the two colours separately. A button with a 20% black overlay on a photo, a white text box at 80% opacity over a coloured background, a watermark at 10% — all of them produce a colour that only exists after the blend. This calculator shows that colour before you commit to it.
How alpha compositing works
The method is called alpha compositing, and the formula is one line per channel: result equals foreground times opacity plus background times one minus opacity. Opacity is written as a decimal, so 50% is 0.5. Each of the red, green, and blue channels is blended separately, and the three blended channels make the resulting colour.
Take the default: #FF5733 at 50% over white #FFFFFF. The foreground is red 255, green 87, blue 51. The background is 255, 255, 255. Red is 255 times 0.5 plus 255 times 0.5, which is 255. Green is 87 times 0.5 plus 255 times 0.5, which is 171. Blue is 51 times 0.5 plus 255 times 0.5, which is 153. The result is RGB 255, 171, 153 — hex #FFAB99, a soft peach.
The formula explains why a dark colour over white lightens fast. Black at 25% over white is 0 times 0.25 plus 255 times 0.75, which is 191 — a light grey, #BFBFBF — even though the overlay was pure black. The background dominates at low opacity, and the foreground only takes over as the opacity climbs. At 100% the background disappears entirely, and the result is the foreground colour unchanged. Our hex to RGB converter breaks any hex code into the red, green, and blue numbers this formula needs.
The opacity percentage explained
Opacity runs from 0% to 100%, and each part of the range has a use. At 0% the layer is invisible and the result is the background. At 10 to 20% you get a tint — a whisper of the foreground colour, used for watermarks and subtle overlays. At 50% you get a true half-blend, where both colours contribute equally. At 80 to 90% the foreground dominates and the background is a faint trace. At 100% the layer is solid.
People get the middle wrong most often. A 50% black overlay over a photo does not make the photo half as bright — it makes every pixel halfway to black, which looks like a heavy dimming, because the eye reads the darkening strongly. A 50% white overlay over a dark photo looks washed out for the same reason. The numbers are linear, but the eye is not, so check the result on a real screen rather than trusting the percentage.
A useful rule: if the overlay is meant to be noticed, use 70% or more. If it is meant to be felt but not seen — a shadow, a tint, a watermark — use 10 to 30%. The calculator shows the exact resulting colour at any point, so you can pick the percentage that gives the colour you actually want, instead of guessing and checking in the design tool. Our color blender mixes two colours in any ratio, which is the same maths without the language of opacity.
A worked example: red at 50% over white
Take pure red #FF0000 at 50% opacity over white #FFFFFF. Red is 255 times 0.5 plus 255 times 0.5, which is 255. Green is 0 times 0.5 plus 255 times 0.5, which is 127.5, rounded to 128. Blue is the same, 128. The result is RGB 255, 128, 128 — hex #FF8080, a light salmon pink. That is the colour a 50% red overlay really makes, and it is lighter than most people draw in their heads.
Now take black #000000 at 25% over white. Red, green, and blue are all 0 times 0.25 plus 255 times 0.75, which is 191.25, rounded to 191. The result is #BFBFBF, a light grey. A quarter-strength black overlay does not make a dark grey — it makes a light one, because three quarters of the white is still showing through. That is why a 25% black shadow looks soft rather than heavy.
Try the default again: #FF5733 at 50% over white gives #FFAB99, as the formula section shows. Change the background to black #000000 and the same foreground at 50% gives red 128, green 44, blue 26 — hex #802C1A, a dark brick. Same colour, same opacity, completely different result, because the background does half the work. The background is not a detail; it is half the answer.
Who uses an opacity calculator, and why
Web designers use it for overlays. A hero image with a dark overlay so white text reads on it, a modal with a dimmed page behind it, a card with a translucent background — every one of them is a foreground colour at an opacity over a background, and the designer needs to know the colour that actually appears. Guessing gives muddy results; the calculator gives the exact hex to put in the stylesheet.
App designers use it for states. A disabled button is often the normal button colour at 40% opacity over the page background. A pressed button is the same colour at 80%. The calculator turns a design rule like disabled means 40% into the concrete colours the developer has to ship, for every background the button can sit on.
Print and presentation designers use it for watermarks and tints. A watermark at 10% opacity over a white page is barely visible; over a dark photo the same 10% is invisible, and the opacity has to rise. The calculator shows what the watermark colour becomes on each background, so one watermark setting works everywhere. Our color contrast checker then tests whether text in the resulting colour is readable against its background.
Opacity vs transparency in CSS
CSS has two ways to make something see-through, and they are not the same. The opacity property makes the whole element see-through, including its text and its children: a box at 50% opacity has 50% text too. An rgba colour, like rgba(255, 87, 51, 0.5), makes only the background see-through, and the text inside stays solid. This calculator models the rgba case — one colour over a background — not the whole-element case.
The difference matters for text. A white text box at 80% opacity over a photo, done with rgba, keeps the text at full strength and readable. The same box done with the opacity property fades the text as well, and the text can become unreadable. If your text looks washed out, you are probably using opacity where you should be using rgba, and this calculator gives you the background colour either way.
There is a third case: layered translucency. A 50% overlay on top of another 50% overlay is not 100% solid — it is 75% opaque, because the second layer only covers half of what is left. Stacking two 50% layers gives 0.5 plus 0.5 times 0.5, which is 0.75. The calculator handles one layer at a time; for a stack, take the result of the first blend and use it as the background for the second.
Common mistakes with opacity
The first mistake is assuming the background is white. An overlay colour that looks perfect on a white artboard can look completely different on a dark photo, because the background supplies half the blended colour at 50% opacity. Always test the overlay on the real background it will sit on, not on white.
The second mistake is using opacity to fix a bad colour. A 50% white overlay over a clashing colour does not fix the clash — it makes a lighter version of the clash. If two colours fight, change one of them; opacity only dilutes the fight. Our color picker reads the exact colour of anything on your screen, so you can test the real colours instead of the ones you remember.
The third mistake is rounding by eye. A blend of 87 and 255 at 50% is 171, not 170 and not 175, and on a large flat area a few steps of difference are visible as banding against a neighbouring colour. The calculator rounds properly, so the hex it gives is the colour the browser will actually paint. And the fourth mistake is forgetting that opacity is per layer: a 50% overlay over a 50% overlay is 75% opaque, not 100%.
How to use this color opacity calculator
Type a foreground colour as a hex code, with or without the hash sign — #FF5733 is the default. Type a background colour the same way — #FFFFFF is the default. Move the opacity slider from 0% to 100%. The resulting colour, its red, green, and blue values, and the opacity update live as you drag.
Read the result. The hex code is the colour the blend actually produces, and it is the value to paste into your stylesheet or design file. The red, green, and blue numbers are the same colour broken into channels, for tools that want them separately.
Everything runs in your browser. No sign-up, no account, no data sent anywhere. The maths is alpha compositing, the standard formula every browser uses to paint translucent colours, so the hex this calculator gives is the hex your browser will paint.