Binary Calculator

Add, subtract, multiply, divide and modulo binary numbers with decimal and hex results.

What it does

Adds, subtracts, multiplies, divides and finds the remainder of binary numbers, and shows the result in decimal and hex too.

Where it's used

Digital-electronics coursework, checking register arithmetic and learning how computers do sums.

How to use it

  1. Type binary A using only 0s and 1s.
  2. Choose the operation.
  3. Type binary B.
  4. Compare the binary, decimal and hex results.

The formula explained

1 + 1
= 10₂ (write 0, carry 1)
Borrow
in subtraction a borrowed 1 is worth 2
×
shift-and-add: each 1 in B adds a shifted copy of A

Worked example

11001₂ × 101₂.

Inputs:

The calculator gives:

Tips and common mistakes

Questions people ask

How do I add binary numbers by hand?

Work right to left like decimal: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (write 0, carry 1) and 1 + 1 + 1 = 11 (write 1, carry 1). For example 1011 + 0110 = 10001, which is 11 + 6 = 17.

How do I read a binary number as decimal?

Each place is worth double the one to its right: 1, 2, 4, 8, 16 … Add the places that hold a 1. 11001 is 16 + 8 + 1 = 25.

How do computers subtract in binary?

They add the two’s complement of the second number instead: A − B = A + (NOT B) + 1. That way one adder circuit handles both addition and subtraction.

Related Digital Logic calculators

Enter your values to get the result with the formula, substituted values and an explanation of each step.

All engineering calculators