How to Convert Hex to RGBA and Add Opacity to Any Color
- Paste your hex code into the converter to get the RGB values instantly.
- Write rgba(r, g, b, alpha) in your CSS — alpha is a decimal from 0 (invisible) to 1 (solid).
- Example: #3B82F6 converts to rgb(59, 130, 246), so rgba(59, 130, 246, 0.5) gives 50% opacity.
- Works in your browser — no account, no download required.
Table of Contents
To add opacity to a hex color, you first need the RGB values. Paste your hex code into the converter, copy the three RGB numbers, then write rgba(r, g, b, alpha) in your CSS — where alpha is a decimal between 0 (fully transparent) and 1 (fully opaque). That is the complete workflow.
Hex colors like #3B82F6 do not carry transparency information. CSS handles opacity separately through the rgba() function. The converter bridges the gap: you get the RGB numbers in one click, then apply any opacity level you need.
Why Hex Colors Cannot Store Opacity
A standard six-character hex code stores three values — red, green, and blue — with two characters each. There is no slot for an alpha channel. When you need transparency, you have two options: the CSS rgba() function, or the newer eight-character hex format (like #3B82F680).
Most developers default to rgba() because it is more readable and widely understood across teams. Either way, you need to extract the RGB components from your hex color first.
How to Convert Hex to RGBA in Four Steps
The conversion takes about ten seconds:
- Enter your hex code into the converter (with or without the # symbol)
- Copy the three RGB numbers from the result — for example,
#FF6400becomesrgb(255, 100, 0) - Open your CSS file
- Write:
rgba(255, 100, 0, 0.5)for 50% opacity
Common alpha values to bookmark: 0.1 for a faint tint, 0.25 for subtle overlays, 0.5 for half-transparent, 0.75 for mostly opaque, 1 for fully solid.
Sell Custom Apparel — We Handle Printing & Free ShippingWhere RGBA Colors Show Up in Real CSS Work
Once you start thinking in rgba(), you find uses for it constantly:
- Modal overlays: A dark semi-transparent backdrop —
rgba(0, 0, 0, 0.6) - Hover states: Lighten a button color without maintaining a separate hex value
- Brand color tints: Create a light background by reducing your primary color to 0.1 opacity
- Box shadows: Shadows look more natural in dark rgba tones than pure black
- Focus rings: Accessible focus indicators often use transparent brand colors at 0.3 to 0.5
In every case, you start with a hex code from your design file and need the rgba equivalent for CSS.
The Eight-Character Hex Alternative to RGBA
Browsers now support an eight-character hex format where the last two characters set opacity. #3B82F680 is the same blue at roughly 50% opacity — 80 in hex equals 128 in decimal, which is half of 255.
This format is supported in Chrome 62+, Firefox 49+, Safari 10+, and Edge 79+. It is useful in design tokens and component libraries, but rgba() stays more common in hand-written CSS because the decimal 0.5 is more intuitive than calculating hex percentages.
Get Your RGB Values in One Click
Paste any hex code above and copy the RGB numbers for your CSS rgba() in seconds.
Open Hex to RGB ConverterFrequently Asked Questions
How do I convert hex to rgba without a converter?
Split the hex code into three pairs. Convert each pair from base 16 to base 10 — those are your R, G, B values. Then add your alpha decimal. Example: #FF6400 splits into FF (255), 64 (100), 00 (0), giving rgba(255, 100, 0, 0.5) for 50% opacity.
What alpha value creates 30% opacity?
Use 0.3. The alpha in rgba() runs from 0 (completely invisible) to 1 (fully visible). Multiply your target percentage by 0.01 to get the decimal: 30% becomes 0.30.
Does rgba() work in all browsers?
Yes. rgba() has been fully supported across all major browsers since 2010. No fallbacks are needed for any modern web project.
What is the difference between rgba opacity and the CSS opacity property?
The CSS opacity property makes an element and all its child elements transparent, including text. rgba() applies transparency only to that specific color, so a semi-transparent background does not affect text color inside the element.

