HEX color to decimal integer

Enter a color code to get its value as a single decimal integer, plus the 0x hexadecimal literal used in code.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter hex color.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Integer = R × 65536 + G × 256 + B, which is simply the six digits read as one base-16 number.

Example

Inputs: HEX color = #FF8000. Result: Decimal integer: 16744448; Working: 255 × 65536 + 128 × 256 + 0 = 16744448.

#FF8000
16744448

Limits and caveats

  • 8-digit codes with alpha are not accepted, since this integer holds RGB only.

Questions about this tool

Where would I need a decimal color?

In the color field of Discord embeds, and in databases or config files that store colors as integers.

What is the largest possible value?

White #FFFFFF equals 16777215, which is 2 to the power 24 minus 1.

Does letter case change the result?

No. #ff8000 and #FF8000 both give 16744448.