HEX to RGBA
Convert a HEX colour code to an RGBA value with a controllable alpha (opacity) channel. Outputs the CSS rgba() function string ready to paste into your stylesheet.
Last updated: May 28, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HEX to RGBA?
CSS rgba() extends RGB with a fourth alpha channel that controls transparency. Values range from 0 (fully transparent) to 1 (fully opaque). This is commonly used for overlays, shadows, hover states, backgrounds with opacity, and any element where the colour must be semi-transparent.
This tool takes a HEX code — the most common way colours are stored in design tools — and converts it to rgba() with your chosen opacity.
How to Use HEX to RGBA
Enter a HEX colour code (3 or 6 digits, # optional)
Set the alpha value between 0 (transparent) and 1 (opaque)
The CSS rgba() string appears instantly
Copy it for use in your stylesheet
Common Use Cases
- CSS authors adding transparency to brand colours for overlays and modal backdrops.
- Developers creating hover/focus states that use the same hue as the solid colour but with reduced opacity.
- Designers testing how a brand colour looks at different opacity levels before committing to a value.
- Engineers building CSS custom property tokens that include semi-transparent variants of base colours.
Example Input and Output
Converting a brand blue to a semi-transparent overlay colour for a modal backdrop.
#3B82F6, alpha: 0.5rgba(59, 130, 246, 0.5)CSS custom properties
Store the rgba() value in a CSS custom property (--overlay-color: rgba(59,130,246,0.5)) for easy reuse across your stylesheet.
Browser-side only
Conversion runs locally in your browser.

