RGBA to HEX converter

To convert RGBA to HEX, write red, green and blue as two hex digits each, then add the alpha as a final pair: rgba(37, 99, 235, 0.5) = #2563eb80. Paste any rgba() value below to get the 8-digit HEX.

To convert RGBA to HEX, turn red, green and blue into two hex digits each, then multiply the alpha by 255 and add it as two more digits: rgba(37, 99, 235, 0.5) is #2563eb80.

HEX#2563eb80
RGBrgba(37, 99, 235, 0.5)
HSLhsla(221, 83%, 53%, 0.5)

How to convert RGBA to HEX

  1. Take the three colour channels and write each as a two-digit hex pair. For rgba(37, 99, 235, 0.5) that is 25, 63 and eb.
  2. Multiply the alpha by 255, round it and write it as a third pair. 0.5 × 255 = 128, which is 80 in hex.
  3. Join the four pairs after a hash to get the 8-digit code: #2563eb80. Drop the alpha pair when you want the plain six-digit colour.

Want to see the solid colour a transparent value makes on your page? Blend it over the background with channel × alpha + background × (1 − alpha). The table below does that for white and black, or use the RGB to HEX converter for plain rgb() values and the HEX to RGBA converter to go the other way.

Common RGBA values as HEX

The 8-digit HEX for each rgba() value, plus the solid HEX it looks like once it sits on white or black.
RGBA8-digit HEXSolid on whiteSolid on black
rgba(0, 0, 0, 0.5)#00000080#808080#000000
rgba(0, 0, 0, 0.25)#00000040#bfbfbf#000000
rgba(255, 255, 255, 0.5)#ffffff80#ffffff#808080
rgba(37, 99, 235, 0.5)#2563eb80#92b1f5#133276
rgba(239, 68, 68, 0.8)#ef4444cc#f26969#bf3636
rgba(34, 197, 94, 0.1)#22c55e1a#e9f9ef#031409
rgba(17, 24, 39, 0.75)#111827bf#4d525d#0d121d
rgba(249, 115, 22, 0.6)#f9731699#fbab73#95450d

RGBA to HEX questions

How do I convert RGBA to HEX?

Turn red, green and blue into two hex digits each, then multiply the alpha by 255 and add it as two more digits. rgba(37, 99, 235, 0.5) has channels 25, 63 and eb, and 0.5 × 255 = 128 = 80 in hex, so the code is #2563eb80.

What is the HEX code for rgba(0, 0, 0, 0.5)?

rgba(0, 0, 0, 0.5) is #00000080: black channels 00 00 00 plus alpha 80. On a white background it looks like #808080, a mid grey, because half the black shows through the white behind it.

How do I get a solid HEX color from RGBA?

Blend the colour over the background it sits on with channel × alpha + background × (1 − alpha). For rgba(37, 99, 235, 0.5) on white: red 37 × 0.5 + 255 × 0.5 = 146, green 99 × 0.5 + 255 × 0.5 = 177 and blue 235 × 0.5 + 255 × 0.5 = 245, giving #92b1f5.

Do all browsers support 8-digit HEX?

Yes, every current browser supports 8-digit HEX with alpha. Keep a solid HEX or rgba() fallback only for old email clients and tools that do not understand the four-pair format.

More color tools

Image tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools