Menu

Color Opacity Calculator

Set alpha or transparency for any color and convert between 8-digit HEX, RGBA, HSLA, and CSS opacity — with live preview, blend calculator, and WCAG contrast check.

1. Pick a base color

Opacity100%

2. Quick swatches

Click a swatch to load that color into the calculator.

3. Live preview

—
On light
On dark

4. Color values CLICK TO COPY

5. Blend calculator

Preview how the semi-transparent color blends over a background.

—

Composite color = foreground × alpha + background × (1 − alpha)

6. Contrast on white & black

On White
—
—
On Black
—
—

WCAG AA requires ≥ 4.5:1 for normal text and ≥ 3:1 for large text.

✓ Copied!
OPACITY & ALPHA TOOL • CSS COLOR • DESIGN

Color Opacity Calculator

Add transparency to any color in seconds. Convert between 8-digit HEX, RGBA, HSLA, and CSS opacity, preview blends over any background, and check contrast — all in one place.

HEX88-digit alpha hex
RGBAAlpha as 0–1
HSLAHue-sat-lightness alpha
CSS opacityElement-level alpha
01
THE BASICS

What Is Color Opacity?

Color opacity controls how transparent a color appears. An opacity of 100% means fully opaque (solid color), while 0% means fully transparent (invisible). Anything in between produces a semi-transparent color that lets the layer beneath show through.

Opacity is stored in the alpha channel of a color. Modern CSS supports it in four common formats: 8-digit HEX (#RRGGBBAA), rgba(), hsla(), and the separate opacity property.

02
FORMATS

Four Ways to Write Opacity

HEX8

8-digit HEX

Two extra hex characters at the end represent alpha. FF = full, 00 = invisible.

#2563EBCC
RGBA

rgba()

Red, green, blue as 0–255, alpha as 0–1. Universally supported.

rgba(37, 99, 235, 0.8)
HSLA

hsla()

Hue, saturation, lightness, alpha. Great for adjusting colors by feel.

hsla(217, 83%, 53%, 0.8)
OPACITY

CSS opacity

Applies to the whole element — including text and borders — not just the background.

opacity: 0.8;
03
ALPHA MATH

How Alpha Blending Works

When a semi-transparent color is drawn over a background, the final pixel is a weighted average of the two colors. The alpha value decides the weight:

result = foreground × alpha + background × (1 − alpha)

For example, a 50% blue over white becomes a light blue. The same 50% blue over black becomes a dark blue. This is why opacity looks different depending on what is behind it — the tool shows both previews so you can see the effect.

04
WHEN TO USE

Common Use Cases

  • Overlay backgrounds: Use a semi-transparent dark color behind text over images.
  • Cards and panels: A slightly transparent white creates a "frosted glass" look.
  • Hover states: Increase opacity from 60% to 100% on button hover.
  • Borders and dividers: Use 10–20% alpha for subtle separators.
  • Disabled states: Reduce opacity to 40–60% to signal interactivity is off.
  • Shadows: Use low-alpha black (rgba(0,0,0,0.15)) for soft shadows.
05
TIPS

Opacity Tips

  • Prefer RGBA over CSS opacity: The opacity property affects the whole element, while rgba() only affects that color.
  • Use 8-digit HEX for compact code: #2563EB80 is shorter than rgba(37,99,235,0.5).
  • Watch contrast: Semi-transparent text on a background can fail WCAG contrast — always check.
  • Stack alpha carefully: Two 50% layers do not equal 100% — they compose multiplicatively.
  • Use opacity for transitions: Fading opacity from 0 to 1 is smooth and cheap to animate.
06
FAQS

Color Opacity FAQ

What is the difference between HEX8 and rgba()?

They encode the same information. HEX8 is more compact (#RRGGBBAA), while rgba() is more human-readable and has been supported longer.

What alpha value equals 50% opacity?

0.5 in rgba(), 80 in 8-digit HEX, and 50% in CSS opacity.

Does CSS opacity affect child elements?

Yes. The opacity property makes the entire element (including children) transparent. To make only the background transparent, use rgba() or 8-digit HEX instead.

Why does my semi-transparent text look wrong?

Because its effective color depends on the background. Text at low opacity often fails WCAG contrast. Always check against the actual background color.

How do I convert HEX8 to RGBA?

Split #RRGGBBAA into RR, GG, BB, AA. Convert each hex pair to 0–255 for RGB and divide AA by 255 for alpha.

What does 0.15 alpha look like?

Very subtle. Over white it looks like a faint tint; over dark it looks like a soft glow. It's commonly used for shadows and thin dividers.

Add Transparency to Any Color

Pick a color, set its opacity, and copy the exact format your project needs — 8-digit HEX, RGBA, HSLA, or CSS opacity. Includes blend preview and WCAG contrast check so you always ship accessible colors.