Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Hex Color Code
#FF6347
RGB(255, 99, 71)
Hex code #FF6347
Decimal value 16,737,095
Red (R) 255 → FF
Green (G) 99 → 63
Blue (B) 71 → 47

What is the RGB to Hex Color Calculator?

This tool converts a color defined by its Red, Green and Blue channels into the hexadecimal color code used across the web, CSS, design software and HTML. Each channel ranges from 0 to 255, and the calculator turns those three numbers into a familiar code like #FF6347 along with its raw decimal value. A live swatch shows you exactly what the color looks like.

Three overlapping circles in red, green and blue blending to white where they overlap
RGB additive color mixing: red, green and blue combine to form a full-color spectrum.

How to use it

Enter a value between 0 and 255 for each of the Red, Green and Blue inputs. Press calculate and you'll see the hex code, the decimal color value, and how each individual channel maps to its two-digit hex pair. Copy the hex code straight into your CSS or design app.

The formula explained

Each channel is an 8-bit number (0-255), which is exactly two hexadecimal digits (00-FF). To get the combined decimal value, multiply red by 65536 (164), green by 256 (162), and add blue: $$\text{decimal} = \text{R}\times 65536 + \text{G}\times 256 + \text{B}$$. The hex code is simply each channel written in base-16 and joined with a leading #:

$$\text{Hex} = \#\,\text{hex}_2\!\left(\text{Red}\right)\,\text{hex}_2\!\left(\text{Green}\right)\,\text{hex}_2\!\left(\text{Blue}\right)$$

Diagram showing an RGB triplet converting into a six-digit hexadecimal color code split into red, green, blue byte pairs
Each RGB channel (0-255) becomes a two-digit hex pair, joined into a 6-digit hex code.

Worked example

Take RGB(255, 99, 71) — "tomato". Red 255 = FF, Green 99 = 63, Blue 71 = 47, giving the hex code #FF6347. The decimal value is $$255\times 65536 + 99\times 256 + 71 = 16{,}711{,}680 + 25{,}344 + 71 = 16{,}737{,}095$$

FAQ

Why are there exactly two hex digits per channel? Because 255 in hexadecimal is FF — two digits cover every value from 0 to 255.

Can I use the decimal value in code? Yes. Many graphics APIs accept the single integer (e.g. 16737095) as a packed color value.

What's the difference between hex and RGB? They describe the same color in different notations — hex is more compact, RGB is more readable. This tool shows both.

Last updated: