RGB to Decimal Converter — Free Online Tool

Convert between RGB, HEX, and decimal color values instantly — enter any one format and get the other two, free, with no signup.

Decimal 3900150
Hex #3B82F6
RGB rgb(59, 130, 246)
Decimal Whole number, 0 to 16777215
Hex
With or without the # symbol
RGB
Each value 0 to 255

What is an RGB decimal color value?

An RGB decimal color value is a single whole number, from 0 to 16,777,215, that represents a full RGB color packed into one integer instead of three separate red, green, and blue values. It’s calculated by combining the red, green, and blue channels (each 0–255) into one number using positional weighting, the same way a 3-digit number combines hundreds, tens, and ones — except each “digit” here can range up to 255 instead of 9.

You’ll run into decimal color values most often in places that store color as a single field rather than three: Discord embed colors, Java and Android Color objects, and older Windows/VBA color constants (like in Excel macros or Access forms) all use this packed format.

How the RGB to decimal conversion works

The formula converts red, green, and blue into one decimal number by multiplying each channel by its positional weight and adding the results together:

Decimal = (Red × 65,536) + (Green × 256) + Blue

Each channel gets a weight based on its position: red is shifted furthest (×65,536, since 256²), green is shifted once (×256), and blue keeps its raw value. This mirrors how HEX color codes work — HEX is just this same packed value written in base 16 instead of base 10, which is why every decimal color also has a matching 6-digit HEX code.

To reverse it — decimal back to RGB — the process divides out each channel in the same order:

Red = ⌊Decimal ÷ 65,536⌋ mod 256 Green = ⌊Decimal ÷ 256⌋ mod 256 Blue = Decimal mod 256

RGB decimal to HEX and HEX to decimal

Since decimal and HEX represent the exact same underlying number in different bases, converting between them doesn’t require touching RGB at all — it’s a direct base conversion. A decimal value of 3900150, for example, is the same color as HEX #3B82F6; the digits just look different because one is base 10 and the other is base 16. The tool above handles this instantly in both directions, along with the RGB triplet, so you never have to do the base-16 math by hand.

Use cases

  • Discord bot and embed development — Discord’s embed color field accepts a decimal integer, not HEX or RGB, so developers regularly need to convert a brand or design color into its decimal equivalent before it’ll work in an embed.
  • Java and Android developmentColor.parseColor() and related APIs frequently expect or return packed integer color values rather than RGB triplets, especially when working with Color.rgb() output or hardcoded color ints.
  • Legacy VB, VBA, and Access projects — Excel macros, Access forms, and older Windows applications often store colors as decimal (or sometimes signed long) integers in their color-picker dialogs and property panes, so converting a known brand HEX/RGB value into that format is a common one-off task.

FAQ

What is RGB decimal?
RGB decimal is a single whole number between 0 and 16,777,215 that represents a color’s red, green, and blue values combined into one integer, instead of three separate numbers.

How do I convert HEX to a decimal color value?
Convert each pair of HEX digits (red, green, blue) to its decimal equivalent, then combine them using Decimal = (Red × 65,536) + (Green × 256) + Blue. The tool above does this instantly — just paste in the HEX code.

How do I convert RGB to decimal for a Discord embed color?
Enter your Discord embed’s RGB or HEX color into the converter above, and use the decimal output directly in your embed’s color field — Discord’s API expects that value as a plain integer.

What does a decimal color value mean?
It means the color’s red, green, and blue channels have been packed into a single number using positional weighting, the same underlying value as the color’s HEX code, just written in base 10 instead of base 16.

What is the maximum decimal color value?
The maximum is 16,777,215, which represents pure white (RGB 255, 255, 255 / HEX #FFFFFF) — the highest possible value across all three 8-bit color channels combined.

How do I convert a decimal color back to HEX?
Convert the decimal number directly to base 16 — the result is the 6-digit HEX code with no RGB step required, since decimal and HEX represent the same value in different number bases.

Scroll to Top