How to use the binary calculator
- Type the First binary number, for example 1011.
- Choose the Operation: add, subtract, multiply, divide, AND, OR, XOR, or a left or right shift.
- Type the Second binary number. For shifts, this is how many places to move, written in binary.
- Read the Result (or Quotient and Remainder for division), with the same value in Decimal and Hexadecimal.
- Look at Check in decimal to confirm the answer with ordinary numbers.
What it does and when to use it
Binary is base 2: each place is worth twice the one to its right (1, 2, 4, 8, 16…). Computer science and digital electronics courses ask you to add, subtract and divide in binary by hand, and to use bitwise operations for masks and flags. This tool checks that work and shows the decimal meaning of every step.
If you need to convert a number between bases rather than calculate with it, use the number base converter. For logic expressions written with letters, the Boolean algebra simplifier and the truth table generator are the right tools.
How it works
Both inputs are read as base-2 whole numbers of any length. The tool then applies the operation to the values and writes the answer back in base 2 and base 16:
- +, −, ×: ordinary arithmetic.
- ÷: whole-number quotient, with the remainder = a − b × quotient.
- AND, OR, XOR: compare the numbers bit by bit. AND gives 1 where both bits are 1, OR where either is 1, XOR where exactly one is 1.
<<and>>: move all bits left or right. Shifting left by k multiplies by 2ᵏ; shifting right by k divides by 2ᵏ and drops the remainder.
Step by step for 1011 + 110 (column addition):
1 0 1 1
+ 0 1 1 0
---------
1 0 0 0 1
- Rightmost column: 1 + 0 = 1.
- Next: 1 + 1 = 10 in binary. Write 0, carry 1.
- Next: 0 + 1 + carry 1 = 10. Write 0, carry 1.
- Next: 1 + 0 + carry 1 = 10. Write 0, carry 1.
- Bring down the last carry: 10001.
The tool agrees: result 10001 and 11 + 6 = 17.
Worked examples
Addition. 1011 + 110 = 10001, with the check 11 + 6 = 17 and hexadecimal 11.
Division. 1101 ÷ 11 gives quotient 100 and Remainder: 1, which is 13 ÷ 3 = 4 r 1.
Bit mask. 1100 AND 1010 = 1000, shown in decimal as 12 AND 10 = 8.
Shift. 101 << 11 shifts 5 left by 3 places: 101000, so 5 << 3 = 40.
Limits and tips
- Bitwise operations with a negative number act as if the number had infinitely many leading 1s (two’s complement), and the tool adds a note when that happens.
- To multiply by a power of two quickly, shift left; 101 << 1 doubles 5 to 10.
- Everything is calculated in your browser.
Frequently asked questions
Can I enter negative binary numbers?
Is the shift amount binary too?
How does binary division handle remainders?
How long can the numbers be?
Can I paste numbers like 0b1011 or 1010 1100?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.