Skip to main content
Screendesk
Free tool

Hex to Decimal Converter

Convert hexadecimal to decimal, or decimal to hex, as you type. Exact for any length, with the signed reading of 32-bit and 64-bit error codes.

Open source on GitHub

Number

Whole numbers of any size. A leading minus sign, 0x / 0b / 0o prefixes, and spaces or underscores between digits are fine.

Result

Decimal (base 10)

500

Binary (base 2)

1 1111 0100

Octal (base 8)

764

Hexadecimal (base 16)

1 F4

9 bits · 3 decimal digits

Two’s complement

Fits in 32 bitsSigned range -2,147,483,648 to 2,147,483,647, unsigned 0 to 4,294,967,295

Bit pattern

0000 0000 0000 0000 0000 0001 1111 0100

Hex

0x00 00 01 F4

As signed integer

500

As unsigned integer

500

Runs entirely in your browser. Nothing you type here is uploaded or stored.

How it works

0x1F4 to decimal, digit by digit. Each position is worth 16 times the one to its right.

Converting hexadecimal 1F4 to decimal
Hex digitPlace valueDecimal
11 × 16² = 1 × 256256
F15 × 16¹ = 15 × 16240
44 × 16⁰ = 4 × 14
Sum256 + 240 + 40x1F4 = 500
Reference

Hex values you will meet while debugging. Limits, colors, and error codes.

Common hexadecimal values and their decimal equivalents
HexDecimalWhere you see it
0xFF255Largest unsigned byte; one RGB color channel at full intensity
0x100256One more than a byte can hold
0x3E81,000A round decimal number in hex
0xFFFF65,535Largest unsigned 16-bit value; highest TCP/UDP port number
0x7FFFFFFF2,147,483,647Largest signed 32-bit integer (INT_MAX)
0xFFFFFFFF4,294,967,295Largest unsigned 32-bit value; −1 when read as a signed 32-bit integer
0x800700052,147,942,405Windows HRESULT for “access denied”. Signed 32-bit reading: −2,147,024,891
0xDEADBEEF3,735,928,559A classic debug fill value for uninitialized memory
Chart

Hex digit chart. Sixteen digits, each exactly four bits.

Hexadecimal digits in decimal and binary
HexDecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111
FAQ

Frequently asked questions

How do I convert hex to decimal?

Multiply each hex digit by 16 raised to its position, counting from 0 on the right, and add the results. Letters stand for 10 to 15 (A = 10, F = 15). For 0x1F4: 1 × 256 + 15 × 16 + 4 × 1 = 500. Paste any hex value above and the decimal result appears as you type.

How do I convert decimal to hex?

Divide the decimal number by 16 and note the remainder, then divide the quotient by 16 again until it reaches 0. The remainders read from bottom to top, with 10–15 written as A–F, are the hex digits. 500 ÷ 16 = 31 r 4, 31 ÷ 16 = 1 r 15 (F), 1 ÷ 16 = 0 r 1, so 500 = 0x1F4. Press Swap to convert in that direction.

What does 0x mean in front of a number?

0x is the prefix most programming languages use to mark a hexadecimal literal, so 0x10 means sixteen rather than ten. It is not part of the value. This converter accepts hex with or without 0x, and also with a leading # as in CSS colors.

Why does a hex error code show as a negative number in my logs?

Many error codes are 32-bit values with the top bit set, such as Windows HRESULTs starting with 0x8. When a program prints them as a signed 32-bit integer, they come out negative: 0x80070005 becomes −2,147,024,891. Choose 32-bit in the two’s complement panel to see both readings side by side.

Is there a limit to how long the hex value can be?

No practical limit. The converter uses BigInt, so 64-bit hashes, 128-bit UUIDs written as hex, and longer values convert exactly. Regular JavaScript numbers lose precision above 0x1FFFFFFFFFFFFF (2^53 − 1).

Customer support runs on Screendesk.

Start for free