RGBA to HEX Converter

Convert RGBA colours to 8-digit HEX, plus flattened HEX on white or black.

HEX (#RRGGBBAA)#112d93cc
HEX (#RRGGBB, alpha dropped)#112d93
Flattened on white#4157a9
Flattened on black#0e2476
CSSrgba(17, 45, 147, 0.8)
alpha 0.8 × 255 = 204 → CC
White text
Black text

Runs entirely in your browser — nothing you enter is uploaded.

About this tool

Get the #RRGGBBAA equivalent of an rgba() colour, or the solid colour it produces over a white or black background.

How to use the RGBA to HEX Converter

  1. Enter the red, green, blue and alpha.
  2. The result updates instantly, with the working shown underneath.
  3. Use Copy to grab a result, or Reset to start again.

How it works

Alpha (0–1) is scaled to 0–255 and written as two hex digits. Flattening blends the colour with the background: result = colour × α + background × (1 − α).

Examples

Semi-transparent blue

rgba(17, 45, 147, 0.5) → #112D9380. Over white it looks like #8896C9.

Benefits and use cases

  • 8-digit hex (#RRGGBBAA) for modern CSS
  • Flattened solid colour for tools without alpha support
  • Exact rounding rules shown

Frequently asked questions

Do all browsers support 8-digit HEX?

All current major browsers do.

Do all browsers support 8-digit hex?

All current major browsers support #RRGGBBAA in CSS. Some older design tools and email clients do not — use the flattened colour there.