RGBA to HEX Converter

Convert an RGBA color — red, green, blue plus alpha — into an 8-digit HEX code. Values are validated, so out-of-range input is clamped rather than silently producing a broken color.

Three numbers from 0 to 255, then an optional alpha between 0 and 1. Percentages such as 50% are also accepted for alpha.

HEX with alpha (8-digit)
Enter an RGBA value.
HEX without alpha (6-digit)

How alpha is encoded

An 8-digit HEX code is a 6-digit color with one extra pair at the end for alpha:

#RRGGBBAA

The alpha channel runs from 00 (fully transparent) to FF (fully opaque), and is the alpha fraction multiplied by 255 and rounded:

alphaHex = round(alpha × 255).toString(16)

Worked example. Convert rgba(11, 107, 203, 0.5):

Result: #0B6BCB80

Common alpha values

TransparencyAlphaHex pair
Fully transparent000
10% opaque0.11A
25% opaque0.2540
50% opaque0.580
75% opaque0.75BF
90% opaque0.9E6
Fully opaque1FF

Frequently asked questions

How is alpha represented in HEX?
In an 8-digit hex code the final pair is the alpha channel: 00 is fully transparent and FF is fully opaque. So rgba(11, 107, 203, 0.5) becomes #0B6BCB80.
What is the difference between 6-digit and 8-digit HEX?
A 6-digit code such as #0B6BCB carries only red, green and blue. An 8-digit code such as #0B6BCB80 adds a trailing alpha pair. All modern browsers support the 8-digit form.
Can I omit the alpha value?
Yes. If you leave alpha blank the tool treats it as 1 (fully opaque), and both the 6-digit and 8-digit codes are shown so you can pick the one you need.
Do all browsers support 8-digit HEX?
Every current browser does, including Chrome, Firefox, Safari and Edge. Support in CSS dates back several years; very old browsers would need the rgba() form instead.
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser; nothing is sent to a server.

Related tools

Last updated: August 31, 2026