Skip to content

Folds the alpha into the last 2 digits of an 8-digit HEX, the notation design tools expect.

What is Online RGBA to HEX Converter?

RGBA to HEX Converter is a free online tool for converting RGBA color code to HEX format. RGBA and HEX are the most common color code formats other than HSL (HSLA) and predefined color codes.

RGBA stands for red, blue, green, and alpha (opacity). Red, green, and blue are numbers between 0 to 256 while alpha (opacity) is between 0 to 1. These values express the amount of any r, g, b color in the mixture. For example, if the color code is rgb(255,0,0), this is pure red as there is no green and blue in the mixture while red is maximum. HEX color code works just like that, but the main difference is it uses base 16 or hexadecimal number system to represent each color. There are 6 digits, each pair represents red, green, and blue respectively.

Same Color Both in RGBA and HEX Color Format
Same Color Both in RGBA and HEX Color Format

For the example in the image, if you convert each r, g, b number to hexademcimal, 0 => 00, 82 => 52, 204 => cc, you will get the HEX code. Since alpha opacity is 1, HEX color have 6 digits.

How to use Online RGBA to HEX Converter?

You can convert a RGBA color to HEX by following these steps.

  1. First, enter the RGBA code you want to convert to HEX in the input area.
  2. Click the convert button. If the RGBA color code you entered is valid, HEX color code will be shown as output, otherwise you will see an error. You can also use the color picker to see HEX equivalent of any color directly. You don't need to use Convert button in this case as it automatically fill both RGBA and HEX color codes.
  3. You can copy the HEX code to your clipboard by using the "Copy HEX Color" button.

Frequently asked questions

What happens to the alpha value?

It becomes the last two digits of an eight-digit HEX value, #RRGGBBAA. Drop those two digits and you have the plain six-digit colour with the transparency discarded.

Why convert to HEX in the first place?

Because most design tools, brand guidelines and colour pickers speak HEX. It is also shorter, which is why it dominates in stylesheets where the alpha is not needed.

Is eight-digit HEX safe to use?

In current browsers, yes. If you support genuinely old ones, RGBA is the safer notation — it has been understood for far longer.

Does anything get lost in the conversion?

No, the two notations describe the same values. Only rounding on the alpha can shift things, and only in the last decimal place.

Can I go back again?

The HEX to RGBA Converter does the reverse, and the Color Tools cover mixing and generating shades.