Color Opacity Calculator
Pick a HEX color and an opacity level to get the rgba(), 8-digit hex, and CSS variable values instantly. Preview the result over a transparent background.
Hex, rgb(), hsl(), hwb() or a CSS color name.
Translucent color (50%)
- HEX8
#4F46E580 - rgba()
rgba(79, 70, 229, 0.5) - hsla()
hsla(243, 75%, 59%, 0.5) - oklch()
oklch(51.06% 0.2301 276.97 / 0.5) - CSS variable
--color-overlay: rgba(79, 70, 229, 0.5);
Solid equivalent after blending
Over white (#FFFFFF)
#A7A3F2
rgb(167, 163, 242)
Over black (#000000)
#282373
rgb(40, 35, 115)
Over custom (#F4F4F5)
#A29DED
rgb(162, 157, 237)
Use the solid value when a design tool, email client or chart library cannot render transparency.
CSS Color Transparency Formats
| Format | 50% red example | Browser support |
|---|---|---|
| rgba() | rgba(255, 0, 0, 0.5) | All browsers (IE9+) |
| 8-digit HEX | #FF000080 | All modern browsers (Chrome 62+) |
| hsla() | hsla(0, 100%, 50%, 0.5) | All browsers (IE9+) |
| oklch() | oklch(0.63 0.26 29 / 50%) | Chrome 111+, Firefox 113+, Safari 16.4+ |
| opacity prop | opacity: 0.5 | Affects entire element incl. children |
HEX Alpha Reference (common values)
The two alpha hex digits range from 00 (fully transparent) to FF (fully opaque).
Frequently Asked Questions
What is color opacity in CSS?
Opacity (alpha) controls how transparent a color is. A value of 1 (100%) is fully opaque, 0 (0%) is fully transparent. CSS supports alpha in rgba(), hsla(), and 8-digit hex (#RRGGBBAA).
What is the difference between rgba() and hex8?
rgba() uses red, green, blue 0-255 values plus an alpha 0-1. Hex8 uses the same RRGGBB hex digits followed by two hex digits for alpha (00-FF). Both achieve the same result.
What is the hex alpha value for 50% opacity?
50% opacity is 128 in decimal, which is 80 in hex. So a red (#FF0000) at 50% opacity would be #FF000080.
Can I use this for CSS backgrounds?
Yes. Use the rgba() output directly in any CSS color property: background-color: rgba(255, 0, 0, 0.5); or use the hex8 value in modern browsers.
Related tools
- Percentage CalculatorThree calculation modes: X% of Y, X is what % of Y, and % change between two numbers. Instant results with formula explanation.
- Unit ConverterConvert between units of length, weight, temperature, speed, and area. Instant bidirectional conversion with common unit presets.
- Aspect Ratio CalculatorCalculate and simplify aspect ratios from width and height. Scale dimensions while locking ratio. Common ratios reference table.
- CSS Specificity CalculatorCalculate the specificity of any CSS selector. Breaks down IDs, classes, attributes, pseudo-classes, elements, and pseudo-elements. Compare two selectors.
All Calculators tools · Found a bug or a wrong result? Report it.