Binary Calculator: Perform Binary Number Operations

An error occurred while performing the calculations. Please contact us through the form located on our contact page so we can fix it as soon as possible. Thank you very much.

How to Use the Binary Calculator

Table of Contents

Perform operations with binary numbers easily, quickly, and for free using our tool.

To do this, simply follow these steps:

  1. Enter the first binary number in the first box.
  2. Select the operation you wish to perform (addition, subtraction, multiplication, or division).
  3. Enter the second binary number.
  4. Press “Calculate”.

If you want to learn how to do binary operations by hand, then keep reading this article.

What is the Binary Number System

The binary system, or binary numeral system, is a positional numeral system with base 2.

Unlike the decimal system (which has 10 as its base), the only digits that make up binary numbers are 0 and 1, which is why they are called binary numbers.

Of all numeral systems, this is, after the decimal system, the one you will find most often, because computing is based on this system.

To indicate that a number has been written using the binary system, the subscript 2 is included, which indicates base 2 or binary:

(0100)2 (0100)_{2}

Here, by introducing the number 2 as a base, we are indicating that it should be read: “zero one zero zero”, that is, the digits will be read individually and not interpreted as if they were the number “one hundred” in the decimal system.

How to Convert from Binary System to Decimal System

Now that we have covered these basics, let's explain how we can convert a number written in base 2 to base 10 and vice versa.

To convert a binary number into a decimal one we must perform the procedure described in the following example:

(1101)2 to decimal(1101)_{2} \text{ to decimal}

Steps to follow:

  1. Write the digits of the binary number in a table, one digit per column.
  2. From right to left, write a power of 2 under each digit, starting with the power of zero (20).
  3. Multiply each digit by the corresponding power.
  4. Finally, add up the results of these multiplications to obtain the decimal number.

The following table summarizes the procedure described above:

Steps

1

Binary number

1

1

0

1

2

Powers of 2

23

22

21

20

3

Product:

(1)(23)

(1)(22)

(0)(21)

(1)(20)

4

Sum

8

4

0

1

= 13

How to Convert from Decimal System to Binary System

To convert a number from the decimal system to binary, you must repeatedly divide the number by two, each time dividing the quotient of the previous operation, until the quotient is the number 0.

N=(quotient)(2)+remainderN = (quotient)(2)+remainder

Here is an example to make the procedure easier to understand:

(75)10 to binary(75)_{10} \text{ to binary}

We start by dividing the number 76 by 2, which leaves us with a quotient of 36 and a remainder of 1.

Then we keep repeating the operation with the quotient until it equals 0.

Here is the result of the process:

Decimal Number

Quotient

Remainder

76

38

0

38

19

0

19

9

1

9

4

1

4

2

0

2

1

0

1

0

1

 

= 1001100

Therefore, we can conclude that the number 76 expressed in binary is 1001100, read from top to bottom; that is, the remainder of the division 1/2 is the first digit we write, from left to right, when expressing the number in binary code.

Operations with Binary Numbers

Binary Addition

Adding in binary can be done easily by following this table:

+010011010 \begin{array}{|c|c|} \hline +& 0 & 1 \\\hline 0 & 0 & 1\\\hline 1 & 0 & 10\\\hline \end{array}

Note that 12+12=102, which is equivalent to 2 in the decimal system.

Here are more examples:

Example 1: 10112 + 0102

1011+  0101011 \begin{array}{r} 1011 \\ + \,\,010\\ \hline 1011 \end{array}

Example 2: 1010112 + 1001112

101011+1001101010001 \begin{array}{r} 101011 \\ + 100110\\ \hline 1010001 \end{array}

Binary Subtraction

Subtraction is not commutative and therefore the elements involved in the operation must be distinguished: minuend and subtrahend. The minuend is the element from which the subtrahend is subtracted.

To perform binary subtraction, what is known as two's complement must be calculated.

To calculate the two's complement of a binary number, proceed as follows:

Consider the number N=41 as an example, whose binary representation is 41=1010012 where n=6 digits.

The two's complement of 41 is given by:

2n−N=26–41=23=0101112 2^n-N = 2^6 – 41 = 23 =010111_{2}

So, to subtract binary numbers, we must first calculate the two's complement of the subtrahend and then add. If there is a carry, it is discarded.

Example 1: 0101112 – 0001102

We take the two's complement of the subtrahend 000110.

000110=6 000110 = 6

26−6=58=01110102 2^6-6 = 58 = 0111010_2

Now we perform the addition:

010111+1110101010001 \begin{array}{r} 010111 \\ + 111010\\ \hline 1010001 \end{array}

We discard the carry bit, so the result of the subtraction is:

100011=1710001_{1}=17

Example 2: 0100112 – 1111002

We take the two's complement of 111100:

111100=60 111100 = 60

26−60=4=0001002 2^6 -60 = 4 = 000100_{2}

Now we perform the addition:

010011+000100010111 \begin{array}{r} 010011 \\ + 000100\\ \hline 010111 \end{array}

So the result of the operation is 23.

Binary Multiplication

In multiplication, the elements are called multiplicand and multiplier. The elements involved in the operation are called factors.

The multiplication table for binary numbers is as follows:

×01000101 \begin{array}{|c|c|} \hline \times& 0 & 1 \\\hline 0 & 0 & 0\\\hline 1 & 0 & 1\\\hline \end{array}

Binary multiplication works in the same way as decimal multiplication. Let's look at some examples.

Example 1: 1012 x 112

101×  11101101  1111 \begin{array}{r} 101 \\ \times \,\, 11\\\hline 101\\ 101\,\,\\\hline 1111 \end{array}

Example 2: 1101102x 1102

110110×  110000000110110  110110101000100 \begin{array}{r} 110110\\ \times \,\, 110\\\hline 000000\\ 110110\,\,\\ 110110\quad \\\hline 101000100 \end{array}

Binary Division

Binary division follows the same principle as decimal division.

In the following example, the procedure you should follow is described step by step.

Example: 111012 / 102

We take the first two digits of the dividend and look for a multiple of the divisor that is close to 102. In this case, that value is 1.

Binary division step 1

We proceed as in the previous step. We bring down the next digit (1), so the new dividend is 112, and again the multiple of 102 closest to 112 is the same value.

Binary division step 2

Finally, repeating the procedure we see that the result of the division is 11102, with a remainder of 1.

Binary division step 3

That is all you need to know to do operations with binary numbers. In this article, we have explained the addition, subtraction, multiplication, and division of binary numbers.

If you liked this article or the binary calculator, do not forget to share it on social media, so that others can learn too.

If you find errors in our calculators, we would appreciate it if you let us know using the contact form so we can fix them as soon as possible.

Román Ramos
Román Ramos
Bachelor's degree in Mathematics and Master's degree in Operations Research from UCV.

Related calculators