Skip to content

Calculator Tools

Binary Calculator

Add, subtract, multiply, or run AND/OR/XOR on two binary values, with the decimal equivalent shown too.

  • Free
  • No sign-up
  • Runs in your browser

Guide

Binary numbers and bitwise operations

Binary is the base-2 number system, using only the digits 0 and 1. Each position is worth a power of two, counting from the right: 1, 2, 4, 8 and so on. The binary number 1010 is therefore 8 + 0 + 2 + 0 = 10 in decimal.

Arithmetic works like decimal arithmetic with carries at 2 instead of 10. Bitwise operations are different: they compare two numbers bit by bit. AND gives 1 only where both bits are 1. OR gives 1 where at least one bit is 1. XOR gives 1 where the bits differ.

For example, with 1010 and 0110: AND gives 0010 (decimal 2), OR gives 1110 (14) and XOR gives 1100 (12).

Who needs a binary calculator

Students in computer science and electronics courses use binary arithmetic constantly, and checking homework by hand is slow and error prone. Programmers working with flags, permissions, masks and low-level protocols often want to see what an AND or XOR does to a pair of values without writing a throwaway script.

It is also a useful way to build intuition. Seeing that 1010 + 0110 equals 10000 (10 + 6 = 16) makes carrying and place value much clearer than reading a definition.

The tool always shows the decimal equivalent beside the binary answer, so you can confirm a result against ordinary arithmetic at a glance.

How to use the binary calculator

  1. Enter a binary number in the Binary A field. It starts with 1010.
  2. Enter a second binary number in Binary B. It starts with 0110.
  3. Choose the operation from the dropdown between them: +, -, *, AND, OR or XOR.
  4. The result appears below in large type as a binary number, followed by "= ... in decimal".

The result updates as you type. If either field contains anything other than 0 and 1, the tool shows an error message instead of a result. All of the work happens in your browser.

Limits and practical notes

The tool converts your inputs to ordinary numbers, performs the operation, and converts the answer back. Leading zeros are not kept in the answer, so 1010 AND 0110 displays as 10 (which is 0010 with the zeros trimmed).

Subtraction can go below zero. In that case the answer is shown with a minus sign, such as -100, rather than as a two's complement bit pattern.

Bitwise operations (AND, OR, XOR) use 32-bit integer behavior, so they are only reliable for inputs up to 31 bits. Very long inputs also lose precision in addition and multiplication once the values become extremely large. There is no division, no fractional binary, and no hexadecimal or decimal input. If you need general number work, the scientific calculator covers more functions.

Frequently asked questions

Can I enter a decimal number?

No. Both fields accept only 0s and 1s. Anything else triggers the error message, so convert a decimal number to binary first.

How does it show a negative result?

A negative answer is shown with a leading minus sign and the binary digits of its absolute value. It does not display two's complement notation.

Why did the leading zeros disappear?

The answer is produced from a numeric value, so leading zeros carry no meaning and are dropped. 0010 appears as 10, with the decimal value shown below as 2.

Does it support division?

No. The available operations are addition, subtraction, multiplication, AND, OR and XOR.