Binary Calculator
Use the following calculators to perform the addition, subtraction, multiplication, or division of two binary values, as well as convert binary values to decimal values, and vice versa.
Binary Calculation — Add, Subtract, Multiply, or Divide
Convert Binary Value to Decimal Value
Convert Decimal Value to Binary Value
The Binary System
The binary system works almost identically to the decimal number system most people use every day. The difference is the base: decimal counts in powers of 10 and uses the digits 0 through 9, while binary counts in powers of 2 and uses only the digits 0 and 1. Each binary digit is called a bit. Apart from that, addition, subtraction, multiplication, and division all follow the same rules as in decimal.
Almost all modern technology and computers use binary because it maps directly onto digital circuitry built from logic gates: a circuit only has to detect two states, on and off (equivalently true/false, or voltage present/absent). A decimal machine would need hardware able to distinguish 10 states per digit, which is far more complicated to build.
Binary/Decimal Conversion
| Decimal | Binary |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
| 4 | 100 |
| 7 | 111 |
| 8 | 1000 |
| 10 | 1010 |
| 16 | 10000 |
| 20 | 10100 |
Place values
Each binary place represents 2n, just as each decimal place represents 10n. In decimal, 18 is (1 × 101) + (8 × 100) = 10 + 8. In binary, 18 is written 10010, because 18 = 16 + 2 = 24 + 21:
10010 = (1 × 24) + (0 × 23) + (0 × 22) + (1 × 21) + (0 × 20) = 18
To convert a decimal number to binary: find the largest power of 2 within the number, subtract it, and repeat with the remainder until there is no remainder; then write a 1 in every place value that was used and a 0 in the rest. Converting back is simpler still — just add up the place values wherever a 1 occurs: 10111 = 16 + 4 + 2 + 1 = 23.
Binary Addition
Binary addition follows the decimal rules, except the carry happens when a column reaches 2 rather than 10: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 0 with a 1 carried over. Watch out for columns where 1 + 1 = 0 also receives a carried 1 from the column to its right — the result there is 1, not 0.
Binary Subtraction
Subtraction likewise mirrors decimal, with borrowing needed only when subtracting 1 from 0: the 0 then becomes "2" (2 − 1 = 1) and the column to its left is reduced by 1, cascading further left through any run of 0s until a 1 can be reduced: 0 − 0 = 0, 1 − 0 = 1, 1 − 1 = 0, and 0 − 1 = 1 with a borrow.
Binary Multiplication
Multiplication is simpler than in decimal: each digit of the multiplier is only 0 or 1, so every partial row is either zero or the multiplicand itself, shifted one place left per row (0 × 0 = 0, 0 × 1 = 0, 1 × 0 = 0, 1 × 1 = 1). The partial rows are then added. The tedium of adding many rows is where mistakes creep in — and remember that a 0 to the right of a 1 is significant, while leading 0s are not: 10101100 = 0010101100 ≠ 1010110000.
Binary Division
Binary division is long division with binary subtraction: at each step the divisor either fits into the current part of the dividend (quotient bit 1) or it does not (quotient bit 0), and the remainder carries on. The calculator above reports the quotient together with any remainder, just as in whole-number long division.
Frequently Asked Questions
How do you convert binary to decimal?
Read the binary number from right to left: the rightmost digit is worth 20, the next 21, then 22, and so on. Add up the values of the positions that hold a 1. For example, 10111 = 16 + 4 + 2 + 1 = 23.
How do you convert decimal to binary?
Find the largest power of 2 that fits in the number, subtract it, and repeat with the remainder until nothing is left. Write 1 in each place value that was used and 0 in the rest: 18 = 16 + 2, so 18 is 10010 in binary.
How does binary addition work?
Exactly like decimal addition, except you carry when a column adds up to 2 instead of 10: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 0 with a 1 carried to the next column.
Why do computers use binary?
Because digital circuits only need to distinguish two states — on and off, true and false, voltage present or absent. Hardware that detects 2 states is far simpler and more reliable than hardware that would need to detect the 10 states of decimal digits.