Free tool

Hex to decimal converter

To turn hex into decimal, multiply each hex digit by 16 to the power of its position and add them up: 0xFF = 15×16 + 15 = 255. Type any hex value below to get the decimal number, the working, and what the same bits mean as a signed integer.

Free · no sign-up · runs in your browser, nothing is uploaded

hex input
one number per line for a list
decimal result

2,014

4 digits

Binary (2)

111 1101 1110

Octal (8)

3736

Decimal (10)

2,014

Hex (16)

7DE

Bits and two’s complement
16-bit pattern
0000 0111 1101 1110
hex
0x07DE
bytes, big-endian
07 DE
bytes, little-endian
DE 07
as unsigned
2014
as signed
2014

Click a bit to flip it. The numbers under each byte are bit positions (0 is the lowest bit).

How hex → decimal works for this number

Multiply each digit by its place value (16 to the power of its position, counting from 0 at the right of the point), then add them up.

digitvalueplacedigit × place
7716^2 = 2561792
D1316^1 = 16208
E1416^0 = 114

1792 + 208 + 14 = 2014

Result: 2014 (decimal)

How to convert hex to decimal, step by step

Hexadecimal is base 16. Its digits run from 0 to F, and each place is worth 16 times the place to its right: 1, 16, 256, 4,096, 65,536 and so on.

Hex digitValue
0-90-9
A10
B11
C12
D13
E14
F15

Worked example, 0x1A3F:

1 × 16³ = 1 × 4096 = 4096
A × 16² = 10 × 256 = 2560
3 × 16¹ = 3 × 16   =   48
F × 16⁰ = 15 × 1   =   15
                     ------
                       6719

Upper and lower case mean the same thing: ff, FF and 0xFf are all 255. Hex fractions work the same way with negative powers: 0x0.8 is 8/16 = 0.5.

Hex values you see in code

HexUnsigned decimalSigned (same width)
7F127127 (8-bit max)
80128-128 (8-bit)
FF255-1 (8-bit)
100256256
FFFF65,535-1 (16-bit)
7FFFFFFF2,147,483,6472,147,483,647 (32-bit max)
800000002,147,483,648-2,147,483,648 (32-bit min)
FFFFFFFF4,294,967,295-1 (32-bit)
FFFFFFFFFFFFFFFF18,446,744,073,709,551,615-1 (64-bit)

Whether FFFFFFFF is 4,294,967,295 or -1 depends on the type that holds it, not on the bits. Pick a width in the converter’s bits panel to see both readings.

Signed hex: when FF means -1

In a signed integer type the highest bit is the sign bit (two’s complement). For a hex value of a known width, if the first digit is 8 or higher the number is negative, and its value is the unsigned value minus 2 to the power of the width. FFFFFF85 as a 32-bit signed int is 4,294,967,173 - 4,294,967,296 = -123.

// JavaScript: read 32-bit hex as signed
BigInt.asIntN(32, 0xFFFFFF85n)   // -123n
0xFFFFFF85 | 0                    // -123 (bitwise ops use 32-bit ints)

# Python
v = int('FFFFFF85', 16)
v - (1 << 32) if v >= 1 << 31 else v   # -123

Hex to decimal in code

// JavaScript
parseInt('7DE', 16)              // 2014
Number('0x7DE')                  // 2014 (needs the 0x prefix)
BigInt('0x' + 'FFFFFFFFFFFFFFFF') // 18446744073709551615n, exact

# Python
int('7DE', 16)        # 2014
int('0x7de', 0)       # 2014, base from the prefix

// Go
n, err := strconv.ParseInt("7DE", 16, 64)    // 2014
u, err := strconv.ParseUint("FFFFFFFFFFFFFFFF", 16, 64)

# Bash
echo $((16#7DE))                # 2014
echo "ibase=16; 7DE" | bc       # 2014 (bc needs uppercase hex)

JavaScript numbers are exact only up to 2^53 - 1, which is 1FFFFFFFFFFFFF in hex (14 digits). Beyond that, parseInt rounds; BigInt does not. This converter uses BigInt, so 64-bit hashes and IDs convert exactly.

Hex to decimal table, 00 to FF

Find the first hex digit on the left and the second along the top. 0xA5 is row A, column 5: 165. For the same values in binary see the decimal to binary table; for colors written in hex, the hex to RGB converter.

hex_0_1_2_3_4_5_6_7_8_9_A_B_C_D_E_F
0_0123456789101112131415
1_16171819202122232425262728293031
2_32333435363738394041424344454647
3_48495051525354555657585960616263
4_64656667686970717273747576777879
5_80818283848586878889909192939495
6_96979899100101102103104105106107108109110111
7_112113114115116117118119120121122123124125126127
8_128129130131132133134135136137138139140141142143
9_144145146147148149150151152153154155156157158159
A_160161162163164165166167168169170171172173174175
B_176177178179180181182183184185186187188189190191
C_192193194195196197198199200201202203204205206207
D_208209210211212213214215216217218219220221222223
E_224225226227228229230231232233234235236237238239
F_240241242243244245246247248249250251252253254255

FAQ

How do you convert hex to decimal?+

Number the digits from the right starting at 0, turn each digit into its value (A=10, B=11, C=12, D=13, E=14, F=15), multiply it by 16 to the power of its position, and add the results. 7DE is 7×256 + 13×16 + 14×1 = 2014.

What is FF in decimal?+

255: F×16 + F = 15×16 + 15. FF is the largest value of one byte. As a signed 8-bit number it means -1, because the top bit is set.

What does 0x mean in front of a number?+

It marks the number as hexadecimal in C, JavaScript, Python, Go, Rust and most other languages. 0x10 is 16, not 10. The converter accepts the prefix, and if you type 0x while Decimal is selected it reads the number as hex and tells you.

What is 7F in decimal?+

127, the largest value of a signed byte. 80 is 128 (or -128 signed), FFFF is 65,535, 7FFFFFFF is 2,147,483,647 (the largest signed 32-bit integer) and FFFFFFFF is 4,294,967,295.

How do I convert hex to decimal in Excel?+

Use =HEX2DEC("A5"), which returns 165. Excel takes at most 10 hex characters (40 bits) and treats the top bit as the sign, so =HEX2DEC("FFFFFFFF5B") is -165. For longer values, use a script or this converter.

Why do programmers use hexadecimal?+

One hex digit is exactly 4 bits, so every byte is two hex digits and long bit patterns become short and readable. Memory addresses, colors (#FF8800), byte dumps, hashes and Unicode code points (U+00E9) are all written in hex.

How do I convert decimal back to hex?+

Divide by 16 and keep the remainders: 2014 ÷ 16 = 125 r 14 (E), 125 ÷ 16 = 7 r 13 (D), 7 ÷ 16 = 0 r 7. Read the remainders bottom up: 7DE. Press swap above to convert in that direction with the steps shown.

Sources: MDN: parseInt() · MDN: BigInt · MDN: BigInt.asIntN() · Python: int() · Go: strconv.ParseInt · Microsoft: HEX2DEC function. Checked 2026-10-30.