Color conversion tool

RGB to HEX Converter

Enter red, green, and blue channel values to get a copy-ready HEX color. Add alpha when you need an 8-digit CSS color.

Enter RGB or RGBA

Use channel values from 0 to 255. Valid decimals are rounded to the nearest whole channel.

RGB channel values

Alpha uses a value from 0 to 1.

Try an example

HEX result

The full value and related color formats update as you type.

HEX#4F46E5
Normalized HEX
#4F46E5
RGB channels
79, 70, 229
CSS color
rgb(79, 70, 229)
HSL
hsl(243, 75%, 59%)
HSV / HSB
hsv(243, 69%, 90%)
Alpha
Not included

Convert RGB to HEX without guesswork

RGB records red, green, and blue as three numeric channels. This converter validates each channel, rounds valid decimal inputs to the nearest whole number, and turns the result into a six-digit HEX color.

The conversion runs in this browser. Your channel values are not uploaded, and the same result is shown as a color preview, CSS syntax, HSL, and HSV so you can check it before copying.

How RGB becomes HEX

Each RGB channel from 0 to 255 becomes one two-character base-16 pair from 00 to FF. The red, green, and blue pairs are then joined in that order after a # sign.

A channel is converted independently, so rounding happens before the three HEX pairs are assembled.

rgb(79, 70, 229) -> 4F + 46 + E5 -> #4F46E5

Convert RGBA to 8-digit HEX

Turn on alpha to add transparency. The converter maps alpha from 0 through 1 to an 8-bit pair from 00 through FF and appends it after the color channels, producing CSS #RRGGBBAA notation.

Because HEX alpha has 256 possible steps, a decimal alpha value can change slightly when converted back. For example, 0.5 becomes 80 in HEX, which represents about 0.502.

Useful RGB to HEX workflows

HEX and rgb() syntax on this page follows the CSS Color Module Level 4.

RGB to HEX Converter FAQ

How do I convert RGB to HEX?

Enter red, green, and blue values from 0 to 255. Each channel is rounded to a whole number, converted to a two-character hexadecimal pair, and combined as #RRGGBB.

Can I convert RGBA to HEX?

Yes. Turn on alpha and enter a value from 0 to 1. The result uses CSS 8-digit #RRGGBBAA notation, with transparency in the final two characters.

What is RGB 255, 255, 255 in HEX?

RGB 255, 255, 255 is #FFFFFF. Each channel is at its maximum value, which is FF in hexadecimal.

Are decimal RGB values supported?

Yes. Valid decimal channels are rounded to the nearest whole value before conversion because an 8-bit RGB channel uses an integer from 0 to 255.

Does this converter send my color values to a server?

No. The conversion runs locally in your browser and does not require an account.