Free · No signup · Runs in your browser
Binary Calculator
Add, subtract, multiply and divide binary numbers, or apply AND, OR and XOR. Results are shown in binary, decimal and hex, with the working.
This tool needs JavaScript. Please enable it in your browser to use it.
- Instant results as you type
- Step-by-step working
- Private: input stays in your browser
- Free, no signup
A binary calculator performs arithmetic directly on base-2 numbers. For example, 1011 + 110 = 10001 in binary, which is 11 + 6 = 17 in decimal.
How to use the binary calculator
- Enter the first and second binary numbers.
- Choose an operation: add, subtract, multiply, divide, AND, OR or XOR.
- Read the answer in binary, decimal and hex, and open the steps to check the working.
Examples
| Operation | Binary | Decimal check |
|---|---|---|
| 1011 + 110 | 10001 | 11 + 6 = 17 |
| 1101 – 101 | 1000 | 13 – 5 = 8 |
| 101 x 11 | 1111 | 5 x 3 = 15 |
| 1100 / 11 | 100 | 12 / 3 = 4 |
| 1100 AND 1010 | 1000 | 12 AND 10 = 8 |
| 1100 OR 1010 | 1110 | 12 OR 10 = 14 |
| 1100 XOR 1010 | 110 | 12 XOR 10 = 6 |
Binary arithmetic rules
Addition
| Sum | Result |
|---|---|
| 0 + 0 | 0 |
| 0 + 1 | 1 |
| 1 + 0 | 1 |
| 1 + 1 | 10 (write 0, carry 1) |
| 1 + 1 + 1 | 11 (write 1, carry 1) |
Example: 1011 + 0110. Work from the right, column by column, carrying a 1 whenever a column adds up to two or more. The result is 10001.
Subtraction
Subtract bit by bit and borrow from the next column when you need to take 1 from 0. A shortcut is to add the two’s complement of the number being subtracted.
Multiplication and division
Binary multiplication is shift and add: for each 1 in the multiplier, add a copy of the multiplicand shifted left. Division is long division with only two possible quotient digits, 0 and 1.
Bitwise operators
| 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 |
Bitwise operators are used for flags, masks and permissions in programming. For negative numbers see the two’s complement calculator.
Binary calculator FAQ
Can it handle negative results?
Yes. A subtraction that goes below zero shows a leading minus sign.
How large can the numbers be?
There is no fixed limit; arbitrary-precision integers are used.
What does XOR mean?
XOR gives 1 when the two bits are different and 0 when they are the same.
What is 1 + 1 in binary?
It is 10, which is 2 in decimal.
Can I check the answer in decimal?
Yes, the decimal value of every result is shown.
