Binary calculator — add, subtract, multiply, divide and bitwise

Enter two binary numbers and an operation to get the result in binary, decimal and hexadecimal, with a check line that repeats the sum in ordinary decimal numbers.

Live demo · real result from this tool
Result10001
Decimal
17
Hexadecimal
11

Check in decimal

1011 + 110 = 1000111 + 6 = 17

Processed on your device — nothing is uploaded.

How to use the binary calculator

  1. Type the First binary number, for example 1011.
  2. Choose the Operation: add, subtract, multiply, divide, AND, OR, XOR, or a left or right shift.
  3. Type the Second binary number. For shifts, this is how many places to move, written in binary.
  4. Read the Result (or Quotient and Remainder for division), with the same value in Decimal and Hexadecimal.
  5. 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
  1. Rightmost column: 1 + 0 = 1.
  2. Next: 1 + 1 = 10 in binary. Write 0, carry 1.
  3. Next: 0 + 1 + carry 1 = 10. Write 0, carry 1.
  4. Next: 1 + 0 + carry 1 = 10. Write 0, carry 1.
  5. 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?
Yes, with a minus sign, such as -101. Results below zero are also shown with a minus sign, for example 110 − 1011 = -101. The tool does not use a fixed bit width; for two's complement patterns, use the number base converter.
Is the shift amount binary too?
Yes. The second box is always read as binary, so to shift by 3 you type 11. The check line shows the shift in decimal, such as 5 << 3 = 40.
How does binary division handle remainders?
It gives a whole-number quotient and a remainder, like long division at school. 1101 ÷ 11 is 100 remainder 1, which is 13 ÷ 3 = 4 remainder 1.
How long can the numbers be?
There is no fixed limit like 8 or 32 bits; the tool uses whole-number arithmetic of any size. Left shifts are limited to 4096 places.
Can I paste numbers like 0b1011 or 1010 1100?
Yes. A 0b prefix, spaces and underscores are removed before the calculation. Any digit other than 0 or 1 gives an error message.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close