Skip to content

RGBA to HEX Converter

Turn an RGBA colour into an 8-digit HEX code, or flatten the alpha away.

The RGBA colour

Used for the solid six-digit answer.

HEX
The hex code appears here

Quick Tool Overview

The RGBA to HEX Converter does both things people mean by the question: it writes the alpha into an eight-digit HEX code, and it flattens the transparency against a background into the solid six-digit colour that actually appears.

What it does
Converts RGBA to 8-digit HEX, or flattens it to solid
You give it
An RGBA colour, and a background if flattening
You get back
Both answers, with the alpha-to-hex table
Best for
Email HTML, print specs and older design tools
Color Tools Free, unlimited use No sign-up Runs in your browser

About the RGBA to HEX Converter

There are two different things people mean by converting RGBA to HEX, and this tool does both.

The first is the literal one: keep the transparency and write it as an eight-digit HEX code, where the last pair of digits is the alpha channel. Every current browser reads this, and it is the right answer when the colour will still be composited by the browser.

The second is flattening: work out what the translucent colour actually looks like over a specific background and give the solid six-digit HEX that matches it. That is what you need when the target does not support alpha at all — an email client, a print spec, an older design tool — or when you want to replace a stack of overlays with a single opaque colour. Both answers are shown together, with the full alpha-to-hex table so you can see that 80% is CC rather than 80.

Key features of the RGBA to HEX Converter

Both answers at once

Keep the alpha as eight digits, or flatten it away — the two are different results and the tool gives you each.

Flattening against any background

A 50% black is mid grey on white and near black on charcoal, so the background is asked for rather than assumed.

The alpha table

Every common opacity with its hex pair, because 50% is 80 rather than 50 and that catches everyone once.

Matches the browser

Compositing is done in sRGB, the way browsers do it, so the flattened colour is the one you are looking at.

Contrast alongside

The flattened colour is scored for contrast, which is the only way translucent text can be checked at all.

How to use the RGBA to HEX Converter

  1. 1

    Enter the RGBA colour

    Type an rgba() string, or set the channels and the alpha with the sliders.

  2. 2

    Take the 8-digit HEX

    The alpha is appended as two hex digits, which is what CSS expects.

  3. 3

    Or flatten it

    Set the background colour and get the solid HEX that matches what you see.

  4. 4

    Check the alpha table

    Every common opacity with its hex pair, for when you are writing the codes by hand.

Frequently asked questions

The alpha channel, from 00 for fully transparent to FF for fully opaque. 50% opacity is 80, not 50 — the digits are hexadecimal, so 128 of 255 is 0x80.

Reviews of the RGBA to HEX Converter

What people who use the RGBA to HEX Converter think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the RGBA to HEX Converter. It takes half a minute and no account.

Write the first review

More color tools