Binary Arithmetic Calculator

Add, subtract, multiply, divide and bitwise on binary numbers.

Free binary arithmetic calculator — add, subtract, multiply and divide two binary numbers, or run bitwise AND, OR and XOR, with decimal and hex output. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How do I add two binary numbers?

Enter both operands, choose Add, and read the binary result. Internally each operand is parsed to a number, summed, and converted back to binary — for example 1010 + 0110 = 10000 (10 + 6 = 16).

Binary arithmetic calculator

Run arithmetic and bitwise operations on two binary numbers: add, subtract, multiply, divide (integer quotient), plus the bitwise AND, OR and XOR. Every result is shown at once in binary, decimal and hexadecimal — useful for learning binary maths or debugging bit flags.

How it works

Each operand is validated to contain only 0 and 1, then parsed into an arbitrary-precision integer (BigInt) by accumulating value × 2 + bit. The selected operation is applied directly to those integers — +, , ×, integer ÷, or the bitwise &, |, ^. The result is then formatted back into binary, decimal and hex. Because BigInt is used, even long strings compute exactly with no overflow.

Example

With A = 1010 (10) and B = 0110 (6):

OperationBinaryDecimalHex
Add10000160x10
Subtract10040x4
Multiply111100600x3C
Divide110x1
AND1020x2
OR1110140xE
XOR1100120xC

Everything runs locally in your browser — nothing is uploaded.

Understanding binary arithmetic step by step

Addition and the carry bit

Binary addition follows the same rules as decimal addition, but with only two digits. When two 1 bits are added the result is 10 in binary (decimal 2), so the 1 carries into the next column — exactly like carrying a 10 into the next column in decimal arithmetic. For example:

  1010   (10)
+ 0110   ( 6)
------
 10000   (16)

Reading right to left: 0+0=0, 1+1=10 (write 0 carry 1), 0+1+1=10 (write 0 carry 1), 1+0+1=10 (write 0 carry 1), then the final carry gives the leading 1.

Subtraction: borrowing in base 2

Subtraction borrows from the next column just like decimal, but the borrowed amount is 2 (since the base is 2). When you borrow, the column you borrowed from decrements by 1. This can cascade through multiple columns of zeros.

Multiplication by repeated shifting

Binary multiplication uses the same long-multiplication pattern as decimal: multiply by each digit and shift left one position per digit. Multiplying by a binary digit is trivial — it is either the number (×1) or zero (×0) — so binary multiplication reduces to a series of conditional shifts and additions.

Bitwise vs arithmetic: a key distinction

The three bitwise operations work column by column with no carry between columns. Each output bit depends only on the two input bits in the same position:

A bitB bitANDORXOR
00000
01011
10011
11110

Practical uses in programming: AND with a mask extracts specific bits (flags & 0b1111 keeps only the lowest four); OR sets specific bits; XOR toggles bits or checks whether two values differ in a specific position.

When this calculator is useful

  • Computer architecture coursework — verifying hand-calculated binary addition and multiplication answers
  • Embedded and systems programming — checking bit masks and flag operations before writing C or assembly code
  • Interview preparation — binary arithmetic questions appear frequently in software engineering interviews, and seeing the decimal and hex alongside the binary result builds intuition
  • Base conversion — the simultaneous binary, decimal, and hex output makes it easy to check that a binary string means what you think it means