Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

HEX to RGBA Converter

Add opacity/transparency to any hex color and convert to RGBA, HEX8, and HSLA formats

Your files never leave your browser
#
%
RGBArgba(99, 102, 241, 1)
HEX8#6366F1FF
CSSbackground-color: rgba(99, 102, 241, 1);
HSLAhsla(239, 84%, 67%, 1)

Drop in any hex color, pick an opacity level, and get the RGBA, HEX8, or HSLA value back instantly — no manual math, no guessing what 0.35 alpha looks like on #FF5733. Batch mode lets you convert a whole palette at once if you’re working with multiple brand colors. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste HEX Code
→
Set Opacity %
→
Copy RGBA Output

The hex string gets split into pairs — two characters each for red, green, and blue. Each pair is converted from base-16 to a decimal number between 0 and 255. Your opacity percentage becomes the alpha value (a decimal from 0 to 1). The result is a valid CSS color value you can paste directly into your stylesheet.

Examples

Semi-transparent button hover state

Your primary brand color needs to look lighter on hover without picking a whole new shade.

INPUT
#3B82F6 at 30% opacity
OUTPUT
rgba(59, 130, 246, 0.3)

Dark modal overlay

A common pattern — black background dimmed to 60% so the content behind is still partially visible. Most designers use this exact value for dialog backdrops.

INPUT
#000000 at 60% opacity
OUTPUT
rgba(0, 0, 0, 0.6) HEX8: #00000099

Shorthand hex for a faded warning badge

3-digit shorthand works too. Quick conversion for a subtle orange background.

INPUT
#F80 at 15% opacity
OUTPUT
rgba(255, 136, 0, 0.15) HSLA: hsla(32, 100%, 50%, 0.15)

Who Uses This

👨‍💻 Front-End Developers

Adding transparency to brand colors for hover states, overlays, and box shadows in CSS.

🎨 UI Designers

Generating exact RGBA values from a hex-based style guide for handoff to developers.

📧 Email Developers

Converting hex to RGBA because some email clients don’t support 8-digit hex codes.

📱 Mobile Developers

Getting RGBA breakdowns for React Native, Flutter, or SwiftUI color definitions.

Common Mistakes

Including the # in a raw value field

Some code editors or frameworks expect hex without the hash symbol. If you paste #FF5733 into a field that wants FF5733, the parser chokes. Double-check what format your target expects.

Confusing opacity percentage with alpha decimal

50% opacity equals an alpha of 0.5 — not 50. Writing rgba(99, 102, 241, 50) won’t give you what you want. The alpha value in RGBA always sits between 0 and 1.

Assuming HEX8 works everywhere

8-digit hex (like #6366F1CC) is supported in modern browsers, but older tools and email clients might ignore those last two characters entirely. If you need wide compatibility, stick with the RGBA output.

Technical Details

Frequently Asked Questions

What is the difference between HEX and RGBA?

HEX uses a 6-character code like #FF5733 to represent red, green, and blue in base-16. RGBA spells those same channels out as decimals (0–255) and tacks on an alpha value between 0 and 1 for transparency. Standard hex doesn’t have a transparency component — that’s the main reason you’d convert.

How do I add transparency to a hex color in CSS?

Two ways. You can convert the hex to RGBA and set the fourth value (like rgba(99, 102, 241, 0.5)). Or you can use an 8-digit hex code where the last two digits control opacity — #6366F180 is roughly 50%. Both work in all modern browsers.

What does the alpha value mean in RGBA?

Alpha controls how see-through the color is. 1 means fully solid, 0 means completely invisible. So rgba(255, 0, 0, 0.5) gives you a red that’s 50% transparent — whatever’s behind it shows through halfway.

Can I convert shorthand hex like #F00?

Yes. Three-digit shorthand gets expanded automatically — each character is doubled, so #F00 becomes #FF0000 and #ABC becomes #AABBCC. You don’t need to expand it yourself before pasting.

Is this tool free and private?

Completely free, no account needed. All the conversion math runs in JavaScript right in your browser. Nothing gets uploaded, no cookies are set, and the page works offline once it’s loaded.

Share: