Binary Calculator

Perform binary calculations—add, subtract, multiply, or divide binary values. Convert between binary and decimal values with ease.

Binary Calculation—Add, Subtract, Multiply, or Divide

Convert Binary Value to Decimal Value

Binary Value:

Convert Decimal Value to Binary Value

Decimal Value:

The Binary Number System

The binary system is a numerical system that functions virtually identically to the decimal number system that people are likely more familiar with. While the decimal number system uses the number 10 as its base, the binary system uses 2. Furthermore, although the decimal system uses the digits 0 through 9, the binary system uses only 0 and 1, and each digit is referred to as a bit. Apart from these differences, operations such as addition, subtraction, multiplication, and division are all computed following the same rules as the decimal system.

Almost all modern technology and computers use the binary system due to its ease of implementation in digital circuitry using logic gates. It is much simpler to design hardware that only needs to detect two states, on and off (or true/false, present/absent, etc.). Using a decimal system would require hardware that can detect 10 states for the digits 0 through 9, and is more complicated.

Binary/Decimal Conversion

DecimalBinary
00
11
210
311
4100
7111
81000
101010
1610000
2010100

Binary Addition

Binary addition follows the same rules as addition in the decimal system except that rather than carrying a 1 over when the values added equal 10, carry over occurs when the result of addition equals 2. Refer to the example below for clarification.

Note that in the binary system:

0 + 0 = 0

0 + 1 = 1

1 + 0 = 1

1 + 1 = 0, carry over the 1, i.e. 10

Example:

1 0 1 1

+ 0 1 1 0

= 1 0 0 0 1

Binary Subtraction

Similar to binary addition, there is little difference between binary and decimal subtraction except those that arise from using only the digits 0 and 1. Borrowing occurs in any instance where the number that is subtracted is larger than the number it is being subtracted from. In binary subtraction, the only case where borrowing is necessary is when 1 is subtracted from 0.

Note that in the binary system:

0 - 0 = 0

0 - 1 = 1, borrow 1, resulting in -1 carried over

1 - 0 = 1

1 - 1 = 0

Example:

1 0 1 0

- 0 1 1 0

= 0 1 0 0

Binary Multiplication

Binary multiplication is arguably simpler than its decimal counterpart. Since the only values used are 0 and 1, the results that must be added are either the same as the first term, or 0. Note that in each subsequent row, placeholder 0's need to be added, and the value shifted to the left, just like in decimal multiplication.

Note that in the binary system:

0 × 0 = 0

0 × 1 = 0

1 × 0 = 0

1 × 1 = 1

Example:

1 0 1

× 1 1

-----

1 0 1

1 0 1

-----

1 1 1 1

Binary Division

The process of binary division is similar to long division in the decimal system. The dividend is still divided by the divisor in the same manner, with the only significant difference being the use of binary rather than decimal subtraction.

Example:

Divide 11011 (27 in decimal) by 101 (5 in decimal)

101 ) 11011

-101

---

111

-101

---

101

-101

---

0

Result: 101 (5 in decimal) with remainder 0

Binary Quick Facts

  • Binary is base-2, using only digits 0 and 1
  • Each binary digit is called a bit
  • 8 bits make a byte (can represent 256 values)
  • Modern computers process data in binary format
  • Binary is fundamental to digital electronics and computing

Frequently Asked Questions

Why do computers use binary instead of decimal?

Computers use binary because it's easier to implement in electronic circuits. Binary only requires distinguishing between two states (on/off, high/low voltage), which is more reliable and simpler to build than circuits that would need to distinguish between 10 different states for decimal.

How do I convert a large decimal number to binary?

For large numbers, you can repeatedly divide the number by 2 and record the remainders. The binary representation is the remainders read in reverse order. For example, to convert 45 to binary: 45 ÷ 2 = 22 remainder 1, 22 ÷ 2 = 11 remainder 0, 11 ÷ 2 = 5 remainder 1, 5 ÷ 2 = 2 remainder 1, 2 ÷ 2 = 1 remainder 0, 1 ÷ 2 = 0 remainder 1. Reading the remainders from bottom to top gives 101101, which is 45 in binary.

What is two's complement in binary?

Two's complement is a method for representing signed numbers in binary. To get the two's complement of a number, you invert all the bits (change 0s to 1s and vice versa) and then add 1. This representation makes it easy to perform arithmetic operations on both positive and negative numbers using the same circuitry.

How does binary relate to hexadecimal?

Hexadecimal (base-16) is often used as a shorthand for binary because each hexadecimal digit corresponds to exactly 4 binary digits (bits). This makes it easier to work with large binary numbers. For example, the binary number 11010110 can be represented as D6 in hexadecimal.

What are some common uses of binary in computing?

Binary is used throughout computing for representing all types of data: numbers, text (through encoding systems like ASCII or Unicode), images (pixel values), sound (digital samples), and instructions (machine code). It's also used in digital circuits for logic operations, memory storage, and data transmission.