Two's Complement Calculator

Convert decimal to two's complement binary — and back — for 8, 16 and 32-bit words, with step-by-step arithmetic.

Two's complement is the standard way computers represent signed integers. The leftmost bit is the sign: 0 = positive, 1 = negative.

Binary (two's complement)
—
—
—

Why two's complement?

Two's complement makes subtraction trivial for hardware — a computer only ever adds.

One zero

Unlike sign-magnitude, two's complement has a single representation of zero — no messy +0/−0.

Natural wraparound

Adding 1 to the largest value wraps to the most negative — a built-in modulo system.

Simple negation

To negate: invert every bit, then add 1. Try it on −42: invert 42's bits and add 1.

Range by bit width

The representable range depends on how many bits you use.

More developer tools

Explore binary, RAID and screen-size calculators in our tech toolkit.

Browse All Tools