Binary Calculator
Enter two binary numbers and pick an operation. This binary calculator adds, subtracts, multiplies and divides, writes out the carries, borrows or partial products, and gives the answer in binary, decimal and hex.
Binary calculator
Binary
Rules of binary arithmetic
| Operation | Result | Note |
|---|---|---|
| 0 + 0 | 0 | |
| 0 + 1 | 1 | |
| 1 + 1 | 10 | Write 0, carry 1 |
| 1 + 1 + 1 | 11 | Write 1, carry 1 |
| 1 − 0 | 1 | |
| 0 − 1 | 1 | Borrow 1 from the next column |
| 1 × 1 | 1 | |
| 1 × 0 | 0 | Anything × 0 is 0 |
How to use the binary calculator
- 01
Type two numbers
Enter binary in both boxes. Spaces are ignored, and the shorter number is padded with zeros on the left.
- 02
Pick the operation
Choose +, −, × or ÷, or AND, OR and XOR to combine the bits one column at a time.
- 03
Read the working
Under the answer, the sum is written out as on paper: carries over an addition, borrows over a subtraction, one row per bit for a multiplication.
Signed numbers
Tick Signed (two's complement) to read both numbers as two's complement, where a leading 1 makes a number negative. 1011 is then −5, so 1011 + 0011 is −2, written 1110.
If the true answer doesn't fit in the same number of bits, the calculator says so and shows it one bit wider. To convert a single number, use the two's complement calculator.
Division and remainders
Division gives a whole-number quotient and a remainder, the same as long division on paper: 1101 ÷ 10 is 110 remainder 1, because 13 ÷ 2 is 6 remainder 1.
Frequently asked questions
How do you add binary numbers?
Add column by column from the right, as in decimal. 0 + 0 is 0, 0 + 1 is 1, and 1 + 1 is 10: write 0 and carry 1 to the next column. So 1011 + 0110 is 10001, or 11 + 6 = 17. The binary addition guide has practice problems.
How does binary subtraction work?
Subtract column by column from the right. To take 1 from 0, borrow 1 from the next column to the left, which turns the 0 into 10 (two), and 10 − 1 = 1. 1010 − 0011 is 0111, or 10 − 3 = 7. The binary subtraction guide walks through the borrowing.
Can I calculate signed binary numbers?
Yes. Tick Signed (two's complement) and both numbers are read as two's complement, where a leading 1 means negative. The answer comes back the same way, with a note if it overflows.