Skip to main content

HEX to RGBA Converter

Convert a HEX color (#RGB, #RGBA, #RRGGBB or #RRGGBBAA) to CSS rgba()/rgb() notation, with a full breakdown of red, green, blue, alpha and HSLA — plus an optional alpha override.

Input

Accepts 3-, 4-, 6- or 8-digit hex, with or without a leading #. The 4- and 8-digit forms include an alpha channel.

Optional. A value from 0 (transparent) to 1 (opaque). Overrides any alpha in the hex.

Output

Color Values
PropertyValue
No data yet
Was this helpful?

Guides

Turn any HEX color code into CSS rgba() (and rgb()) notation in one step. Paste a hex value, and this converter breaks it down into its red, green, blue and alpha components, ready to drop straight into a stylesheet. It runs entirely in your browser, so your colors never leave your machine.

How to use it

  1. Type or paste a hex color into the HEX Color field.
  2. Read the converted rgba() string, or copy it with one click.
  3. Check the Color Values table for the individual R, G, B and alpha numbers, plus the equivalent rgb() and hsla() notations.

You can leave off the leading # — both #FF0000 and FF0000 work.

Which hex formats are supported?

Every standard CSS hex form is accepted:

  • #RGB — 3-digit shorthand. Each digit is doubled, so #F00 becomes #FF0000rgba(255, 0, 0, 1).
  • #RGBA — 4-digit shorthand with an alpha nibble.
  • #RRGGBB — the classic 6-digit form.
  • #RRGGBBAA — 8-digit, where the final two digits carry the alpha channel.

When the hex has no alpha channel, the color is treated as fully opaque (alpha 1).

How does the alpha conversion work?

In an 8-digit hex, alpha is stored as a byte from 00 to FF (0–255). CSS rgba() expects a decimal from 0 to 1, so the byte is divided by 255. For example, 80 is 128, and 128 ÷ 255 = 0.502. Values are kept to three decimal places, which is enough precision for every 8-bit alpha level to round-trip back to the exact same byte — a common source of "off by one" errors in cruder converters that round to two decimals.

Can I set a custom transparency?

Yes. Use the optional Alpha Override field to force an alpha value between 0 (fully transparent) and 1 (fully opaque). This is handy when you have an opaque brand color like #336699 and want a 50% translucent version — set the override to 0.5 and get rgba(51, 102, 153, 0.5). The override replaces any alpha already present in the hex.

RGB vs RGBA

If you only need solid colors, use the rgb() row from the results table. The rgba() output always includes the alpha channel, which is what you want for overlays, shadows, hover states and glassmorphism effects.

Is my data private?

Yes. The conversion happens locally in your browser using plain arithmetic — nothing is uploaded to a server.

colorhexrgbargbcssalphaconverter

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.