Number Base Converter

Convert between binary, octal, decimal and hex at 8 to 128 bits, with signed two's complement and an editable bit grid.

Runs in your browser — your data never leaves your device

Frequently Asked Questions

How do I convert hex to decimal?

Type the hex value (with or without 0x) into the Hexadecimal field and read the Decimal field. With Signed switched on, a hex value whose top bit is set reads as negative — 0xFF is −1 as an int8 but 255 as a uint8.

What is two's complement?

The way computers store signed integers. To encode a negative number, write its magnitude in binary, invert every bit, and add 1. The top bit then acts as the sign: 1 for negative, 0 for zero or positive.

Why does the same hex value give two different decimals?

Hex, octal and binary show the raw bit pattern; decimal shows what that pattern means. Signed and unsigned are two readings of the same bits — 1111 1111 is 255 unsigned and −1 signed.

What happens if a number does not fit the bit width?

The tool tells you the valid range and offers to switch to the smallest width that fits, instead of silently wrapping the value.

Does it handle 64-bit and 128-bit numbers exactly?

Yes. All conversions use arbitrary-precision integers, so values beyond JavaScript's 2^53 safe-integer limit are exact.