WebToolsPlanet
Converter Tools

RGBA to HEX

Enter R, G, B, and Alpha values and instantly get both the 6-digit and 8-digit HEX colour codes. Useful when a colour picker, CSS rgba() value, or design tool returns RGBA and you need hex for CSS, SVG, or a design system that expects 8-digit hex.

Last updated: August 16, 2026

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What is RGBA to HEX?

RGBA and HEX can represent the same colour, including transparency, in different formats. RGBA expresses red, green, and blue channels as integers from 0–255 plus an alpha (opacity) channel from 0 (fully transparent) to 1 (fully opaque). HEX encodes those same channels as two hexadecimal digits each: a 6-digit #RRGGBB code ignores alpha entirely, while an 8-digit #RRGGBBAA code appends the alpha channel as a fifth byte pair.

Converting RGBA to HEX is needed when working with CSS custom properties, design tokens, SVG fill/stroke attributes, or any system that expects hex colour strings but your source data (a colour picker, a design tool export, or a CSS rgba() value) is in RGBA form. Not every context supports 8-digit hex — CSS does via modern browsers, but some older tooling only accepts 6-digit hex, which is why this tool outputs both.

How to Use RGBA to HEX

1

Enter the Red, Green, and Blue values (0–255 each)

2

Enter the Alpha value (0–1, e.g. 0.5 for 50% opacity)

3

Copy the 6-digit #RRGGBB code (ignores alpha) or the 8-digit #RRGGBBAA code (includes alpha)

Common Use Cases

  • Converting a CSS rgba() value from a design tool export into hex for a design token file.
  • Getting an 8-digit hex colour for CSS or SVG properties that accept #RRGGBBAA but not rgba().
  • Frontend developers translating a Canvas API RGBA colour into hex for a stylesheet.
  • Designers checking what a semi-transparent colour looks like against a checkered background before exporting.

Example Input and Output

Converting a semi-transparent Tailwind blue-500 to its 6-digit and 8-digit HEX equivalents.

RGBA input
R: 59, G: 130, B: 246, A: 0.5
HEX output
#3B82F6 (6-digit) / #3B82F680 (8-digit)

Reverse direction

To convert HEX back to RGBA, use the HEX to RGBA tool.

Browser-side only

Conversion runs locally in your browser.

Frequently Asked Questions

What is the difference between the 6-digit and 8-digit output?

The 6-digit #RRGGBB code represents only the red, green, and blue channels — it ignores transparency entirely, as if alpha were 100%. The 8-digit #RRGGBBAA code appends the alpha channel as two extra hex digits, preserving transparency.

Do browsers support 8-digit hex colours?

Yes, all modern browsers support #RRGGBBAA and #RGBA short-hand hex notation in CSS. Some older design tools and file formats only accept 6-digit hex, which is why both outputs are shown.

What range does the Alpha value accept?

Alpha is a decimal from 0 (fully transparent) to 1 (fully opaque), matching CSS rgba() syntax. 0.5 means 50% opacity.

Is my data sent to a server?

No. All conversion runs locally in your browser.