Number Base Converter (Binary, Hex, Octal)

Type in any field and the others follow. Handles huge numbers, negative values and fixed bit widths.

How it works

Type a number into any field: decimal, hexadecimal, binary, octal, or the custom field set to any base from 2 to 36. Prefixes like 0x, 0b and 0o are accepted, and spaces, underscores and commas used as digit separators are ignored. Conversion uses arbitrary-precision integers, so 200-digit numbers are exact.

Choose a bit width to see how a value is stored in a fixed-size register. Negative numbers are shown in two's complement: in 8-bit, -1 is ff and -128 is 80. When you type a hex or binary pattern with the top bit set, the panel shows both its unsigned and signed meaning. Values that do not fit are wrapped modulo 2n, exactly as a CPU would, and the tool tells you.

The bit view groups bits into bytes with their positions. Click any bit to flip it and watch every representation update, which is a quick way to build flag masks or check which bits a hex constant sets.

Questions

What is two's complement?

The standard way computers store signed integers: a negative number -x is stored as 2^n - x. It lets the same adder handle positive and negative numbers.

Why is 0xFF 255 in one place and -1 in another?

The bits are the same. Read as unsigned 8-bit they mean 255; read as signed 8-bit (two's complement) they mean -1.

Can it convert fractions?

No. It works with whole numbers only, which is where base conversion is exact.

Is there a size limit?

Inputs up to 2,000 digits. The bit view is shown for widths up to 128 bits.

Related tools

Guides