>_devtools

Hex to Decimal Converter

Convert hexadecimal to decimal and back with BigInt precision, including two's complement signed values.

What this does

Converts integers between hexadecimal and decimal, one value per line. It uses arbitrary precision (BigInt) arithmetic, so 64-bit IDs, 128-bit UUID values, 256-bit hashes and anything else beyond JavaScript's 253 safe-integer limit convert exactly, with no rounding.

Accepted input

Hex may be written with or without 0x, in either case, and with spaces or underscores as digit separators (DEAD_BEEF). Decimal may include thousands commas or underscores. A single value also shows how many bits it needs and its binary form.

Signed values and two's complement

Choose a width (8, 16, 32, 64, 128 or 256 bits) to treat hex as a two's complement integer:ff as 8-bit is -1, 80 is -128. Going the other way, -1 at 32 bits becomes ffffffff, padded to the full width. Values that do not fit the chosen width are rejected with the valid range rather than silently truncated. Without a width, a leading minus sign is simply carried over (-255 is -ff).

Example

0xDEADBEEF is 3735928559.ffffffffffffffff is 18446744073709551615 unsigned and -1as a 64-bit signed integer. Errors name the offending character and the line it is on.

Privacy

The conversion runs in your browser. Nothing is uploaded or stored.