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.
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):
- Red 11 →
0B - Green 107 →
6B - Blue 203 →
CB - Alpha 0.5 →
round(0.5 × 255) = 128→80
Result: #0B6BCB80
Common alpha values
| Transparency | Alpha | Hex pair |
|---|---|---|
| Fully transparent | 0 | 00 |
| 10% opaque | 0.1 | 1A |
| 25% opaque | 0.25 | 40 |
| 50% opaque | 0.5 | 80 |
| 75% opaque | 0.75 | BF |
| 90% opaque | 0.9 | E6 |
| Fully opaque | 1 | FF |
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
RGB ↔ HEX
Two-way color conversion without alpha.
Text ↔ Binary
Convert text to binary using real UTF-8.
Decimal → Octal
Base-10 to base-8 number conversion.
JSON ↔ XML
Two-way developer format conversion.
Epoch → Date
Turn a Unix timestamp into a readable date.
BPM → Milliseconds
Note lengths in ms for delay timing.
Last updated: August 31, 2026