Convert OnlineConvertOnline

ConvertRGBtoHEX

Input

Color Preview

Output

CSS Color Value

How to use this RGB to HEX Color Converter 🤔

  1. Click 👆 on the input fields and enter values for the input RGB color channels, or you may use the sliders given 🎚 against each channel to set a specific value for the respective color channel.
  2. As you change the RGB color channels, the HEX color value is calculated, in real time ⌚.
  3. Also a color preview is provided to give a feedback on which color that we are converting from RGB to HEX.

RGB to HEX Conversion

RGB to HEX conversion is the process of converting a color represented in the RGB format to its equivalent HEX representation.

In the RGB format, colors are expressed as combinations of red, green, and blue components, each ranging from 0 to 255 decimal values.

In the HEX format, colors are expressed as combinations of red, green, and blue components, each ranging from 00 to FF hexadecimal values.

Steps to Convert RGB to HEX

Here are the steps to convert an RGB color to HEX:

  1. Convert each component of RGB to its equivalent hexadecimal representation.
  2. Combine the hexadecimal representations of the red, green, and blue components in the order #RRGGBB.

Please note that we have to place a '#' symbol before the RRGGBB value.

If any of the hexadecimal values of the color components is a single digit hexadecimal, then we need to specify a leading zero for that color component. For example, if R=12 in decimal, then it is C in hexadecimal, and we have to specify it as 0C with leading zero instead of single digit C.

Example

Let's take an example to illustrate the process. Suppose we have an RGB color with components R=128, G=192, B=64:

  1. Convert each component to hexadecimal: R (46) becomes 2E in hexadecimal, G (209) becomes D1 in hexadecimal, and B (138) becomes 8A in hexadecimal.
  2. Combine the hexadecimal representations in the sequence of red, green, and blue: #2ED18A.

The HEX equivalent is #80C040.

Therefore, RGB(46, 209, 138) is equal to #2ED18A in HEX.