Home · Everyday · Bases, Binary & Logic · Two's Complement Calculator
Two's Complement Calculator
Two's complement representation of a number in 8, 16 or 32 bits — the encoding every modern CPU uses.
What this calculator does
Two's complement representation of a number in 8, 16 or 32 bits — the encoding every modern CPU uses. Where a measure is involved, US and metric units are both accepted — flip the unit toggle and the figures convert with the same definitions the formula uses. Every result on this page is computed from the formula stated below, with no hidden rounding steps.
The formula and method
Digits are validated against the chosen base — a binary field rejects the digit 2.
Conversion goes through the exact integer value, so results are exact for the sizes accepted.
Negative values keep their sign in every base.
Worked example
With the example inputs this page opens with (signed value -10), the result is 11110110 — two's complement (8-bit). Two's complement negates by flipping every bit and adding 1 — one zero, one extra negative value, and ordinary addition just works, which is why every modern CPU uses it. The headline figure is the unsigned value of the bit pattern.
Quick reference
| Signed value | Two's complement (8-bit) |
|---|---|
| -5 | 11111011 |
| -8 | 11111000 |
| -10 | 11110110 |
| -12.5 | 11110100 |
| -15 | 11110001 |
| -20 | 11101100 |
Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.
Common questions
How does the Two's Complement Calculator work?
Two's complement representation of a number in 8, 16 or 32 bits — the encoding every modern CPU uses. Value · Width → Bit pattern. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.
What inputs does the Two's Complement Calculator need?
Value · Width → Bit pattern. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.
Is the Two's Complement Calculator free to use?
Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.