Home Calculators Two's Complement Calculator

Two's Complement Calculator

Convert integers to two's complement binary, perform binary arithmetic with overflow detection, and explore every number representation in 4, 8, 16, or 32-bit widths.

Two's complement: invert all bits, then add 1  ·  MSB is the sign bit

Mode

Convert a number or perform binary arithmetic

Quick Examples

Classic two's complement scenarios

Result

Two's Complement
Decimal
Hexadecimal
Octal
Binary (signed)
Bit Width
Sign Bit

Range Reference

4-bit signed−8 to 7
8-bit signed−128 to 127
16-bit signed−32768 to 32767
32-bit signed−2³¹ to 2³¹−1

Quick Reference

−n in 2C~n + 1
MSB = 1negative
MSB = 0positive
All 1s−1
1000...0MIN_INT