Two's Complement

How a computer stores negative integers: step-by-step conversion, a number circle of 4-bit patterns, addition with overflow, and practice with checking.

Open the app

Free, runs in the browser, no sign-in or installation.

Subject
Computer Science
Area
Data Representation
Level
Secondary school
The number circle of all 4-bit two's complement patterns, from −8 to 7, with −5 highlighted

What you can do

  • Type an integer, choose 4, 8 or 16 bits and follow the steps: write the absolute value in binary, invert every bit and add 1.
  • Click a bit to change it and check the value of the pattern with place values, where the highest bit has a negative weight.
  • A table and a number circle show all 16 four-bit patterns with their unsigned and two's complement values.
  • Add two numbers as bit patterns with carries; the app marks the discarded carry and warns about overflow.
  • Practise converting numbers to two's complement and back, with answer checking, a worked method and a count of correct answers.

Worksheets and lessons

Lessons with worksheets that use this app.

More apps: Data Representation

All apps →