Skip to main content
CalcChef

Hex to Decimal

Convert hex to decimal, binary or octal with exact whole-number math: FF is 255. Pads hex to 8, 16, 32 or 64 bits and converts 200 lines at once. How it works

Use the Hex to Decimal

Whole numbers only: fractions are not supported. Negative numbers keep a minus sign. One space or underscore between digit groups is accepted, and a 0x, 0o or 0b prefix switches the From base (a hex number that starts with 0B stays hexadecimal).

Decimal result
255
To
255

About the Hex to Decimal

Hex FF is 255 in decimal: F is 15, and 15 × 16 + 15 = 255. To convert hex to decimal, multiply each digit by a power of 16 (1, 16, 256, 4,096 and so on from the right) and add the results, with A to F standing for 10 to 15.

Common hex values in decimal and binary

HexDecimalBinary
A101010
F151111
101610000
641001100100
7F1271111111
8012810000000
FF25511111111
100256100000000
1F4500111110100
3E810001111101000
400102410000000000
100040961000000000000
FFFF655351111111111111111

Largest values by bit width

BitsUnsigned max (hex)Unsigned max (decimal)Signed max (hex)Signed max (decimal)
8FF2557F127
16FFFF655357FFF32767
32FFFFFFFF42949672957FFFFFFF2147483647
64FFFFFFFFFFFFFFFF184467440737095516157FFFFFFFFFFFFFFF9223372036854775807

Signed maximums are for two’s-complement integers, where the top bit is the sign, so 7F is the largest signed byte and 80 the first value read as negative.

Frequently asked questions

How do I convert hex to decimal by hand?
Write each digit’s value (A = 10 up to F = 15), multiply it by 16 raised to its position counted from 0 at the right, and add: 1F4 = 1 × 256 + 15 × 16 + 4 = 500.
What is FF in decimal?
255, the largest two-digit hex number and the largest value of one 8-bit byte. FFFF is 65535 and FFFFFFFF is 4294967295.
What does 0x in front of a number mean?
It marks the number as hexadecimal in C, JavaScript and many other languages: 0x1A is 26. Typing 0x in the field switches the From base to hexadecimal, and 0o switches it to octal. The Copy as menu adds 0x to a hex result, in upper or lower case.
Can it convert very large hex numbers?
Yes, up to 4,096 decimal digits, with whole-number arithmetic: DEADBEEF is 3735928559 and FFFFFFFFFFFFFFFF is 18446744073709551615, every digit exact. An ordinary JavaScript number holds whole numbers exactly only up to 9,007,199,254,740,991.
How do I convert a negative hex number?
Type the minus sign: -FF is -255. The converter keeps the sign and does not use two’s complement, so FF is never read as -1. Padding to a bit width is shown for values of 0 and above.
Can I convert a list of hex values?
Yes. Open Batch and paste up to 200 lines, one value per line. Each row shows the value in decimal, hex, binary and octal, and a line that is not a valid number says why.

Related Tools

View all tools