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

  1. Enter the first and second binary numbers.
  2. Choose an operation: add, subtract, multiply, divide, AND, OR or XOR.
  3. Read the answer in binary, decimal and hex, and open the steps to check the working.

Examples

OperationBinaryDecimal check
1011 + 1101000111 + 6 = 17
1101 – 101100013 – 5 = 8
101 x 1111115 x 3 = 15
1100 / 1110012 / 3 = 4
1100 AND 1010100012 AND 10 = 8
1100 OR 1010111012 OR 10 = 14
1100 XOR 101011012 XOR 10 = 6

Binary arithmetic rules

Addition

SumResult
0 + 00
0 + 11
1 + 01
1 + 110 (write 0, carry 1)
1 + 1 + 111 (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

ABANDORXOR
00000
01011
10011
11110

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.