Skip to content

RGB to Hex Converter

Enter red, green and blue values between 0 and 255 and get the matching HEX code. This is handy when a design gives you RGB numbers, such as the arguments of Power Fx RGBA(), and you need a HEX value for CSS or branding documents.

Also known as: rgb to hex converter, convert rgb to hex, rgb to hex color, rgb to hex code.

Tip: three-digit HEX codes such as #0F8 work too.

HEX#742774
RGBrgb(116, 39, 116)
Power FxRGBA(116, 39, 116, 1)

Your data is processed locally in your browser and is not uploaded to our servers.

Features

  • Red, green and blue inputs with a live preview
  • Values are kept within 0 to 255
  • Copy HEX, rgb() or RGBA() with one click

How to use the RGB to Hex Converter

  1. Enter the red, green and blue values.
  2. Read the HEX code next to the preview.
  3. Copy the format you need.

When you need HEX instead of RGB

Power Apps formulas give you colors as RGBA(red, green, blue, alpha). Branding documents, CSS files, Power BI themes and most design tools prefer HEX codes. Type the three numbers here to get the matching HEX value without opening another app.

Each RGB channel becomes two HEX digits: 0 becomes 00, 255 becomes FF. That is why every HEX color code has six digits after the # sign.

If you are building a theme, open the color picker to see shades, tints and a contrast check for the same color.

Example input and output

Power Apps purple

rgb(116, 39, 116)  ->  #742774

White

rgb(255, 255, 255)  ->  #FFFFFF

Frequently asked questions

How do you convert RGB to HEX by hand?

Convert each of the three values to base 16 and join them, adding a leading zero when needed. For example 116 is 74 and 39 is 27, so rgb(116, 39, 116) is #742774.

What if my RGB value is above 255?

RGB channels only go from 0 to 255, so the converter limits each value to that range.

How do I get the HEX code of a color in Power Apps?

Look at the RGBA() value in the color property, then enter the first three numbers here. For example RGBA(0, 120, 212, 1) becomes #0078D4.

Is HEX the same as hexadecimal?

Yes. A HEX color code is just the three RGB numbers written in hexadecimal (base 16). To convert other numbers between hex, decimal and binary, use the Hex Converter.

Related tools