Hex to decimal converter

To convert hex to decimal, multiply each hex digit by its power of 16 and add the results, so FF is 15 × 16 + 15 = 255. Type any hexadecimal number below to get its decimal value with every digit kept, even past 64 bits. The conversion runs in your browser.

Input number

Enter a whole number and choose the bases.

Enter a whole number, choose the bases, then convert.

Allowed digits depend on your input base.

Swap uses the result as your next input when one is available.

Whole numbers only. Enter digits without prefixes or separators: FF, not 0xFF. Surrounding whitespace is ignored.

Converted number

The same integer in your chosen base.

Exact whole-number conversion

Hex to decimal conversion table

Each decimal value is the converter's own output for the hex number in the same row. No cell is rounded.
HexDecimal
11
99
A10
F15
1016
1218
1E30
2032
64100
7F127
80128
FF255
100256
3E81000
FFFF65535
7FFFFFFF2147483647
FFFFFFFF4294967295

Several rows mark the top of a common size. 7F and FF are the largest signed and unsigned byte values, 127 and 255. FFFF is the largest 16-bit value, and FFFFFFFF is the largest unsigned 32-bit value. Each extra hex digit makes the range 16 times larger.

A web color such as FF8800 holds three bytes. Convert FF, 88 and 00 one at a time to get the red, green and blue values 255, 136 and 0. Converted whole, FF8800 is the single number 16746496.

How to convert hex to decimal

Hexadecimal is base 16. It uses the digits 0 to 9 and the letters A to F for the values 10 to 15. Each place is worth 16 times the place to its right, so the place values are 1, 16, 256, 4096 and so on.

To convert by hand, write the place values under the digits from the right, multiply each pair and add. For 1A3 that is 1 × 256 + 10 × 16 + 3 × 1, which is 256 + 160 + 3 = 419. For 7B it is 7 × 16 + 11 = 123.

The converter works from the left instead. It multiplies the running total by 16 and adds the next digit, so 1A3 goes 1, then 26, then 419. Both routes give the same whole number, and the tool uses exact integer arithmetic, so a long value is never rounded.

Using the hex to decimal converter

The page opens with Hexadecimal (16) in From base and Decimal (10) in To base. Type or paste the hex digits in the Number field and select Convert number. The decimal result appears in the Converted number panel, where Copy result copies it and Download TXT saves it.

Letters can be upper or lower case, so ff and FF both give 255. Leave out the 0x prefix and the # of a color code. The converter rejects 0xFF because x is not a hex digit, and it rejects #FF8800 as an invalid format. Spaces and line breaks around the number are ignored.

Swap bases turns the form around to decimal to hex and moves the result into the Number field, so you can convert the answer back as a check. Reset clears the number and returns the form to hex to decimal.

Limits

The converter reads hex as an unsigned value with an optional plus or minus sign in front, so −FF gives -255. It does not apply two's complement, so FFFFFFFF gives 4294967295 and never −1. To read a 32-bit value as signed, subtract 4294967296 from any result of 2147483648 or more.

Only whole numbers convert. A hex fraction such as 1A.8 is rejected, not rounded. Separators inside the number are rejected as well, so type FFFF rather than FF FF or FF_FF. Leading zeros are fine, and 00FF gives 255.

There is no digit limit. The 64-bit value FFFFFFFFFFFFFFFF converts to 18446744073709551615 with every digit exact. This page converts one number at a time, typed or pasted into the Number field. It does not decode hex bytes into letters or read a hex dump from a file.

Questions

How do I convert hex to decimal?

Multiply each digit by 16 raised to its position, counting from 0 on the right, and add the products. A to F count as 10 to 15. For 2F that is 2 × 16 + 15 = 47. With this page, type 2F in the Number field and select Convert number to get 47.

What is 7FFFFFFF in decimal?

7FFFFFFF in hex is 2147483647 in decimal. That is 2 to the power 31 minus 1, the largest value a signed 32-bit integer can hold. One more, 80000000 in hex, is 2147483648, which a signed 32-bit type reads as a negative number.

What is 12 hex in decimal?

12 in hex is 18 in decimal: 1 × 16 + 2 = 18. The digits look like the decimal number twelve, but the 1 stands for one sixteen. Other short values work the same way, so 20 in hex is 32 and 1E is 30.

Is 1 hex digit 16 bits?

No. One hex digit holds 4 bits, because 16 is 2 to the power 4, and F is the 4-bit value 1111. Two hex digits make one byte, so FF is 255. Four hex digits, such as FFFF, make 16 bits, which is 65535 in decimal.