Two's Complement Calculator – Signed Binary

Calculate two's complement representation for signed binary integers.

About This Calculator

Calculate two's complement representation for signed binary integers. Use the calculator above for instant results.

Worked Examples

Example 1: -13 in 8-bit

  • Invert 13 (00001101) → 11110010 + 1 = 11110011 = 0xF3

Answer: 11110011 (0xF3)

Example 2: −1 in 8-bit

  • = 11111111 = 0xFF

Answer: 11111111

Example 3: -128 in 8-bit

  • = 10000000 | Most negative 8-bit value

Answer: 10000000

Who Uses This Calculator?

💻
CS Students

Understand signed integer representation.

🔧
Embedded Engineers

Signed number handling in hardware.

🏫
CS Teachers

Demo two's complement system.

📊
Programmers

Debug signed integer issues.

Common Mistakes to Avoid

❌ Two's complement vs sign-magnitude

Two's complement (used by all modern CPUs) lets you add signed numbers the same way as unsigned. Sign-magnitude (not used) would need different adder circuits.

❌ MSB is the sign bit

In two's complement, the most significant bit is the sign: 0 = positive, 1 = negative.

Frequently Asked Questions

Why two's complement?

Single representation of zero. Addition works the same for signed and unsigned. No special hardware needed for subtraction.

How to find two's complement?

Method 1: Invert all bits (one's complement) then add 1. Method 2: Keep rightmost 1 and all bits to its right; invert everything to its left.

Range of n-bit signed integer?

From -2^(n-1) to 2^(n-1)-1. 8-bit: -128 to 127. 16-bit: -32768 to 32767. 32-bit: -2,147,483,648 to 2,147,483,647.