โTwo's Complement Calculator
Convert signed integers to two's complement binary, step by step.
Free Two's Complement Calculator
Our free two's complement calculator converts any signed decimal integer into its two's complement binary representation for a chosen bit width โ 4, 8, 16, or 32 bits โ and shows every step: writing the magnitude in binary, inverting the bits, and adding 1. It also works in reverse, decoding a two's complement binary string back to its signed decimal value.
Two's complement is the standard way computers represent negative integers, because it lets addition and subtraction use the same circuitry for both positive and negative numbers. The calculator flags overflow when a value falls outside the representable range for the selected bit width, so you can see exactly why a number wraps around.
Built for computer science students learning number representation, and for anyone debugging low-level code who needs a quick, reliable conversion. No sign-up, no downloads โ just instant, accurate results.
About the Two's Complement Calculator
Features
Two-way conversion
Decimal to binary and binary to decimal, in the same tool.
Step-by-step working
See the magnitude, inversion, and add-1 steps laid out clearly.
Selectable bit width
4, 8, 16, or 32-bit representations.
Overflow detection
Flags values outside the representable range for the chosen width.
Frequently Asked Questions
What is two's complement?
A method of representing signed integers in binary where negative numbers are formed by inverting the bits of the positive value and adding 1.
Why do computers use two's complement instead of a sign bit?
Because it lets the same binary addition circuitry work for both positive and negative numbers, with no separate subtraction logic needed.
How do I convert a negative decimal to two's complement?
Write the magnitude in binary, invert every bit, then add 1. The calculator shows each of these steps.
What bit widths are supported?
4-bit, 8-bit, 16-bit, and 32-bit.
What happens if my number is out of range?
The calculator shows an overflow message with the valid range for the selected bit width, e.g. -128 to 127 for 8-bit.
How is the sign determined in two's complement?
The leftmost (most significant) bit: 0 means non-negative, 1 means negative.
Can I convert binary back to decimal?
Yes, switch to Binary โ Decimal mode and enter a two's complement bit string.
What is the range for an 8-bit signed number?
-128 to 127.
Is my data stored?
No; all conversion happens locally in your browser.
Is it free?
Completely free, no sign-up or limits.