Binary Calculator – Binary Addition, Subtraction, Multiplication & Division
Add, subtract, multiply and divide binary numbers — with the decimal equivalents and the working shown, so you can check every step. Bitwise AND, OR and XOR are included, along with NOT and 1’s & 2’s complement. Free to use, no sign-up, and everything runs in your browser, so nothing you type leaves your device.
Add, subtract, multiply or divide binary numbers — with the decimal equivalents and the working shown. Bitwise AND, OR and XOR, plus NOT and 1's & 2's complement, are included below. Everything runs in your browser — nothing you type leaves your device.
Only 0s and 1s — spaces between groups are fine, e.g. 1010 0101. Your inputs are never changed by the tool; the answer appears in the read-only result box below.
At a fixed width the result is padded with leading zeros. If it does not fit, the tool shows the wrapped value and a plain overflow warning — the overflow is never hidden.
These use the first number (A) and the bit width above. On "Auto" the width is A's own length.
Limits, stated plainly: this calculator works with unsigned binary numbers. A subtraction that goes below zero is shown with a minus sign (for example 0 − 1 = −1) because a negative number cannot be shown as an unsigned value. At a fixed width, a result that does not fit is wrapped and flagged as an overflow — it is not the true value. Division gives a whole-number quotient and a remainder; it never rounds. To work the other way round, you can convert decimal to binary or convert binary to decimal.
How to Use the Binary Calculator
- Type your numbers — enter the first binary number in box A and the second in box B. Only 0s and 1s are allowed; spaces between groups are fine, so 1010 0101 works just as well as 10100101. If you type anything else, the tool tells you which character is not allowed.
- Choose an operation and a bit width — pick Add, Subtract, Multiply, Divide, AND, OR or XOR from the list, then choose Auto or a fixed width of 8, 16 or 32 bits. At a fixed width the answer is padded with leading zeros, and if it does not fit, the tool shows the wrapped value and says so plainly.
- Read the answer — the result appears in binary and in decimal, with the working for addition shown column by column. Division shows the quotient and the remainder. Use “Copy binary result” to copy the answer to your clipboard.
For NOT and the complements, use the separate buttons below the main calculator — they work on the first number (A) only, at the width you selected.
How to Add Binary Numbers
Binary addition follows four rules — the same as decimal addition, except that 1 + 1 has nowhere to go in a single binary digit, so it carries: 0 + 0 = 0; 0 + 1 = 1; 1 + 0 = 1; 1 + 1 = 10, carry 1.
Work from the rightmost column to the left, carrying 1 whenever a column adds to 2 or more. The classic example is 1 + 1 = 10 in binary — one plus one is two, and two in binary is written 10.
A fuller example: 1010 + 0101 = 1111. In decimal that is 10 + 5 = 15. Column by column from the right: 0 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, and 1 + 0 = 1 — no carries needed. The calculator above shows this working for every addition, so you can follow each column. If you need to work the other way round first, you can convert decimal to binary and then add the results here — or learn binary code from the beginning if the place values are new to you.
Subtraction, Multiplication and Division
Subtraction works like decimal subtraction, borrowing 1 from the next column when a digit is too small: 10 − 1 = 1, borrowing from the left. Worked example: 1010 − 0011 = 0111. In decimal that is 10 − 3 = 7. One honest limit: a subtraction that goes below zero cannot be shown as an unsigned binary number, so this calculator shows it with a minus sign — 0 − 1 = −1 — instead of pretending the wrapped bits are the answer.
Multiplication is the easiest of the four: multiply as in decimal, using the fact that 1 × 1 = 1 and anything × 0 = 0, then add the partial products. Worked example: 101 × 11 = 1111. In decimal that is 5 × 3 = 15. The partial products are 101 × 1 = 101 and 101 × 10 = 1010; adding them gives 1111.
Division is long division in base 2: at each step, ask whether the divisor fits into the part of the dividend you are looking at, write 1 if it does and 0 if it does not, then subtract and bring down the next bit. Worked example: 1010 ÷ 0011 = 11 remainder 1. In decimal that is 10 ÷ 3 = 3 remainder 1. Division always gives a whole-number quotient and a remainder — it never rounds, and dividing by zero is not allowed: the calculator says “Cannot divide by zero” rather than showing Infinity. If you want to check the decimal side of a division, use the step-by-step guide to convert the numbers first. Once you have a quotient, you can convert binary to decimal to check it in ordinary numbers.
Bitwise AND, OR and XOR
Bitwise operations compare two binary numbers bit by bit, one column at a time. AND gives 1 only when both bits are 1; OR gives 1 when at least one bit is 1; XOR gives 1 when the bits are different. The whole truth table is four rows:
| A | B | AND | OR | XOR |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 |
For example, 1010 AND 1100 = 1000, 1010 OR 1100 = 1110, and 1010 XOR 1100 = 0110. These operations are the building blocks of computer logic — AND masks bits off, OR turns bits on, and XOR flips bits — which is why they sit in the same tool as the arithmetic. When the two numbers have different lengths, the shorter one is padded with leading zeros on the left first, so the columns line up.
1's and 2's Complement
The 1’s complement of a binary number is made by flipping every bit: each 0 becomes 1 and each 1 becomes 0. It is the “opposite” of the number at a given width — for example, the 1’s complement of 00000111 is 11111000.
The 2’s complement is the 1’s complement plus 1, and it is how computers represent negative numbers: the 2’s complement of 00000111 is 11111001, which is −7 in 8-bit two’s complement. That is why the complement buttons ask for a bit width — the answer depends on it. Use the complement buttons above with A set to 00000111 and the width set to 8-bit to see both results. If you are working with other bases as well, the binary to hexadecimal converter is the next step once the binary side is clear. And if a binary result is really a character code rather than a number, the ASCII binary table lists every character with its binary value.
Frequently Asked Questions
10. One plus one is two, and two in binary is written 10 — the 1 carries into the next column, just as 9 + 1 = 10 carries in decimal.
Work from the rightmost column to the left using four rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10, carry 1. Whenever a column adds to 2, write 0 and carry 1 to the next column. Try 1010 + 0101 = 1111 in the calculator above to see each column worked out.
Yes — it gives a whole-number quotient and a remainder, for example 1010 ÷ 0011 = 11 remainder 1 (10 ÷ 3 = 3 remainder 1 in decimal). It never rounds, and dividing by zero shows "Cannot divide by zero" instead of an error value.
11111000. The 1's complement flips every bit: each 0 becomes 1 and each 1 becomes 0. The 2's complement of the same number is 11111001 (the 1's complement plus 1), which is −7 in 8-bit two's complement.
The calculator shows the wrapped 8-bit value and says plainly that it overflowed — for example, 11111111 + 1 at 8 bits shows 00000000 with an overflow warning, because the true answer 100000000 (256) needs 9 bits. The overflow is never hidden: switch the width to Auto or 16-bit to see the full answer.