Design

Hex Opacity Generator

Add opacity to a hex colour. Convert a hex colour and an opacity percentage into an 8-digit hex code and an rgba value.

Last reviewed by the Radiatus Cloud team

Add opacity to a hex colour and get the 8-digit hex and rgba values.

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

Add opacity to a hex colour

CSS supports an eight-digit hex notation where the last two digits set the opacity, or alpha, of a colour. This tool converts a six-digit hex colour and an opacity percentage into the corresponding eight-digit hex code and the equivalent rgba value. Pick a colour and an opacity of, say, fifty percent, and you get the eight-digit hex with the correct alpha pair and the matching rgba string, both ready to paste into your CSS.

The alpha byte ranges from 00 for fully transparent to FF for fully opaque, and the tool calculates it precisely from your percentage.

Transparency in CSS

Semi-transparent colours are everywhere in modern design: subtle overlays, shadows, hover tints and frosted panels all rely on them. Eight-digit hex keeps everything in one compact value, while rgba is the more traditional and widely supported form. Having both means you can use whichever your codebase prefers.

Remember that opacity on a colour affects only that colour, unlike the opacity property which fades an entire element and its contents. All conversion happens locally in your browser.

Notes on the generated code

Because the hex opacity generator runs entirely in your browser, you can experiment with every option and watch the generated code update instantly, with nothing uploaded and no account required. The output is clean, standards-based CSS that works in any project without external libraries or a build step, so you can paste it straight into your stylesheet and refine it further by hand whenever you need to.

Related tools

  • Color Converter — Convert colours between HEX, RGB, HSL, HWB and OKLCH, with alpha support. Runs in your browser and shows the live swatch for each format.
  • Accessibility Color Contrast Checker — Check foreground and background colour contrast against WCAG thresholds, with the rules for text size, UI components and states.
  • Typography Scale Generator — Generate a modular type scale from a base size and ratio, with fluid clamp() values for responsive layouts.
  • Design Token Generator — Generate design tokens as CSS variables, JSON or platform formats, structured in the layers that make them maintainable.

Frequently Asked Questions

What is 8-digit hex?

It is a hex colour with two extra digits at the end that set the alpha, or opacity, from 00 for transparent to FF for fully opaque.

How is the alpha value calculated?

The opacity percentage is converted to a value from 0 to 255 and written as the final two hex digits, which the tool computes precisely.

Should I use 8-digit hex or rgba?

Both represent the same colour with opacity. Eight-digit hex is compact, while rgba is more traditional and universally supported. Use whichever your project prefers.

Is this the same as the opacity property?

No. A transparent colour affects only that colour, while the opacity property fades an entire element including its text and children.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Pick a colour and set the opacity to get 8-digit hex and rgba.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.