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
- Enter a binary number in the Binary A field. It starts with 1010.
- Enter a second binary number in Binary B. It starts with 0110.
- Choose the operation from the dropdown between them: +, -, *, AND, OR or XOR.
- 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.