The standard method computers use to represent negative integers in binary.
How it works
For a negative number, the binary representation is found by taking the two’s complement — inverting the bits of the positive equivalent and adding 1 — within a chosen bit width.
What this does not include
This does not include unsigned (always-positive) binary conversion — for that plain case, use this site’s binary calculator instead.
How to use this calculator
- Enter a decimal value (positive or negative) and choose a bit width.
A worked example
−5 in 8-bit two’s complement: 11111011.
5 in 8-bit two’s complement: 00000101 — a positive number looks identical to plain binary.
What the variables mean
| Variable | Meaning |
|---|---|
| Value | The signed decimal number being converted |
| Bits | How many bits the binary representation uses |
Edge cases worth knowing
Positive numbers in two’s complement look exactly like plain binary — the representation only differs from ordinary binary for negative values, where the leading bit flips to signal a negative sign.
A value outside the representable range for the given bit count has no valid encoding. 8 bits can only represent −128 to 127, so 200 falls outside that range and the calculator declines to show a result.
Frequently asked questions
Why do computers use two’s complement instead of just a sign bit?
Two’s complement lets addition and subtraction use the exact same circuitry for both positive and negative numbers, without special-casing the sign — a major efficiency advantage in hardware design.
Why does bit width matter?
It determines the range of representable values — an 8-bit value can only represent numbers from −128 to 127, while wider bit widths allow a larger range.
What happens if I enter a number outside the representable range?
The calculator declines to show a result, since that number can’t be correctly represented in the chosen bit width without overflow.