Color Picker
Pick any colour and copy it as HEX, RGB, HSL or CSS.
Turn an RGBA colour into an 8-digit HEX code, or flatten the alpha away.
Used for the solid six-digit answer.
The hex code appears here
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.
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.
Keep the alpha as eight digits, or flatten it away — the two are different results and the tool gives you each.
A 50% black is mid grey on white and near black on charcoal, so the background is asked for rather than assumed.
Every common opacity with its hex pair, because 50% is 80 rather than 50 and that catches everyone once.
Compositing is done in sRGB, the way browsers do it, so the flattened colour is the one you are looking at.
The flattened colour is scored for contrast, which is the only way translucent text can be checked at all.
Type an rgba() string, or set the channels and the alpha with the sliders.
The alpha is appended as two hex digits, which is what CSS expects.
Set the background colour and get the solid HEX that matches what you see.
Every common opacity with its hex pair, for when you are writing the codes by hand.
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.
Whenever the destination has no alpha. Email HTML, many print workflows, some icon formats and older design tools all need a solid colour, and flattening gives you the exact one.
Entirely. rgba(0 0 0 / 0.5) is mid grey on white and near black on dark grey. That is why the tool asks for the background rather than assuming white.
Browsers composite in sRGB, so that is what this tool does by default and it matches what you see. Linear-light compositing is physically more correct but would not match the browser, which is the thing you are trying to reproduce.
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.
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 reviewPick any colour and copy it as HEX, RGB, HSL or CSS.
Check whether a colour code is valid, and fix it if not.
Convert colour temperature in kelvin to an RGB colour.
Convert HEX colour codes to RGB and HSL, and back again.
Build a duotone pair and get the CSS to apply it.
See your colours as the eight percent of men who see them differently do.
Find the true complement of any colour, and the near ones.
Check any text and background pair against WCAG AA and AAA.