Binary Calculator

Binary arithmetic and bitwise operations.

Loading calculator…

Adding 101101 and 1101 by hand means carrying across six columns, but a binary calculator does it instantly, along with other arithmetic and bitwise operations. It adds, subtracts, multiplies and divides, and also runs AND, OR, XOR and left and right bit shifts. Each answer is shown in binary (grouped in fours for easy reading), decimal, hexadecimal and octal, and division gives the remainder too. It handles very long numbers without losing precision.

How to Use the Binary Calculator

  1. Type binary number A using only 0s and 1s, such as 101101.
  2. Choose an operation: + Add, − Subtract, × Multiply, ÷ Divide, AND, OR, XOR, Shift left (A << B) or Shift right (A >> B).
  3. Type binary number B.
  4. Read the result in binary, decimal, hex and octal, and follow the steps.

For shifts, B is the number of places to shift, written in binary. To shift by 2, enter 10.

How Binary Numbers Work

Binary is base 2. Each place is worth twice the place to its right: 1, 2, 4, 8, 16, 32 and so on. 101101 means 32 + 0 + 8 + 4 + 0 + 1 = 45 in decimal.

Binary Arithmetic Rules

Binary addition

  • 0 + 0 = 0
  • 0 + 1 = 1
  • 1 + 1 = 10 (write 0, carry 1)
  • 1 + 1 + 1 = 11 (write 1, carry 1)

Binary subtraction

  • 0 − 0 = 0, 1 − 0 = 1, 1 − 1 = 0
  • 0 − 1: borrow 1 from the next place, making 10 − 1 = 1

Multiplication works like long multiplication in decimal, but each partial row is either 0 or a shifted copy of the top number. Division is long division, where each step only asks whether the divisor fits once or not at all.

Binary Examples

Addition: 101101 + 1101 45 + 13 = 58. Result: 111010 (hex 3A, octal 72).

Subtraction with a negative result: 1101 − 10110 13 − 22 = −9. Result: −1001.

Division: 10110 ÷ 11 22 ÷ 3 = 7 remainder 1. Result: 111, remainder 1.

Shift left: 1011 << 10 (shift 1011 left by 2 places) Result: 101100, which is 11 × 4 = 44. Each left shift doubles the number.

Bitwise Operations

Bitwise operations compare the two numbers one bit at a time:

ABANDORXOR
00000
01011
10011
11110

For 1100 and 1010: AND = 1000, OR = 1110, XOR = 0110 (shown as 110).

  • AND keeps a bit only where both numbers have a 1. Programmers use it to test or clear bits with a mask.
  • OR sets a bit where either number has a 1. It is used to switch flags on.
  • XOR sets a bit where the numbers differ. It is used to flip bits and in simple checksums.
  • Shift right halves the number for each place and drops any remainder.

Where Binary Maths Is Used

  • Networking. An IP address ANDed with its subnet mask gives the network address. This is how routers decide whether two devices are on the same network.
  • File permissions and settings. Many systems store on/off options as single bits. OR switches a flag on, AND with a mask checks it, and XOR flips it.
  • Fast multiplying and dividing. Shifting left by one place doubles a number, and shifting right halves it. Programs use this for quick maths with powers of 2.
  • Computer science courses. Binary addition, subtraction and bitwise logic are core topics in introductory computing and digital electronics.

Converting Rather Than Calculating

  • To convert a single number between binary, decimal, hex and other bases, use the number base converter.
  • For decimal sums with fractions, use the fraction calculator.
  • To break a decimal number into primes, use the prime factorization calculator.

Binary Calculator Questions

How are negative results shown?

Negative results are shown with a minus sign, such as −1001, rather than in two’s complement. This keeps the answer the same whatever bit width you are working with.

Is there a size limit?

No fixed limit. The calculator uses arbitrary-precision integers, so long binary numbers are handled exactly.

Does it support fractional binary numbers?

No. It works with whole numbers. Division gives a whole-number answer and a remainder.

Why is the result grouped in fours?

Each group of four binary digits matches one hexadecimal digit, which makes long results easier to read and to check against the hex value.

How we checked this page: every example was converted to decimal, worked out, and converted back, and each one matches the calculator’s binary, hex and octal output.

Scroll to Top