Binary Calculator

Binary result—
Decimal result—

How Binary Calculator is calculated: Binary uses base 2: each digit is 0 or 1, and place values are 1, 2, 4, 8, 16, and so on

What is a binary calculator?

A binary calculator does arithmetic in base 2, the number system of computers, where the only digits are 0 and 1. Enter two binary numbers, pick add, subtract, or multiply, and it shows the answer in binary and in ordinary decimal, so you can check the result in the system you already know. This page gives you that answer in a second, with the working shown beside the result, and everything runs entirely in your browser with no sign-up and no data sent anywhere.

Computer science students use binary arithmetic in their first courses, and programmers, electronics engineers, and network technicians use it at work, whenever an address, a flag, or a bit pattern needs adding or comparing. It is the number system underneath every digital device. Students meet it in school maths, programmers meet it in code, and shopkeepers and clerks meet it whenever a total has to be split fairly or checked by hand.

The results box shows the answer first, in large type, and then the supporting numbers underneath it, so you can see both the headline and the working at a glance. Change any input and the answer updates at once, which makes it easy to test a few values and build a feel for how the numbers behave.

How binary arithmetic works

Binary works like decimal addition, but with only two digits, so 1 plus 1 is 10 in binary, which means write 0 and carry 1. For the default example, 1010 plus 1100, the columns from the right give 0, then 1 with a carry, then 1, then 0, then 1, producing 10110. The decimal check is 10 plus 12, which is 22, and 22 in binary is 10110.

Binary uses base 2, so the place values are 1, 2, 4, 8, 16, and so on, doubling at each step to the left. For 1010, the digits mean 8 plus 0 plus 2 plus 0, which is 10, and for 1100 they mean 8 plus 4 plus 0 plus 0, which is 12. Add the decimal values, 10 plus 12 is 22, and convert back to binary to get 10110.

Binary strings can only contain 0 and 1, so any other digit makes the input invalid, and this calculator shows a dash instead of guessing. Subtracting a larger binary number from a smaller one gives a negative decimal result, and the binary answer is shown as a dash, because negative numbers need a separate sign convention in binary.

A quick check is to convert both numbers to decimal in your head using the place values 1, 2, 4, 8, and 16, do the arithmetic in decimal, and convert the answer back. If the decimal arithmetic and the binary arithmetic disagree, the binary addition has a carried 1 in the wrong column, which is the most common slip.

Carrying is where binary addition goes wrong

Carrying is the step people get wrong, because 1 plus 1 in binary is 10, not 2, and the carried 1 changes the next column. In 1010 plus 1100, the second column from the right is 1 plus 0 plus a carried 1, which is 10 in binary, so you write 0 and carry 1 again. Forgetting a carry, or carrying a 2 instead of a 1, breaks the whole sum.

Compare adding 101 and 11 to see carrying in a small case: 101 is 5 and 11 is 3, and 5 times 3 is 15, which is 1111 in binary. The multiplication is done as repeated addition in binary, and each partial product is shifted left, exactly as in decimal long multiplication, only with fewer digits to track.

The safe habit is to read the input back before trusting the output: check the digits, check the sign, and check that you have not swapped the two numbers round. A calculator only repeats the question you actually asked it, so a careful ten seconds on the input saves a wrong answer later.

A worked example: add, subtract, and multiply in binary

First, the default example: 1010 plus 1100. In decimal, 1010 is 10 and 1100 is 12, and 10 plus 12 is 22. In binary, 22 is 10110, because 16 plus 4 plus 2 is 22, so the binary result is 10110 and the decimal result is 22.

Second, 1100 minus 1010. In decimal, 1100 is 12 and 1010 is 10, and 12 minus 10 is 2. In binary, 2 is 10, so the binary result is 10 and the decimal result is 2. Subtraction in binary borrows 2 instead of 10, which is the only difference from decimal borrowing.

Third, 101 times 11. In decimal, 101 is 5 and 11 is 3, and 5 times 3 is 15. In binary, 15 is 1111, because 8 plus 4 plus 2 plus 1 is 15, so the binary result is 1111 and the decimal result is 15.

The pattern is that every binary operation can be checked in decimal: convert the inputs, do the arithmetic, and convert the answer back. The binary and decimal answers must agree, and when they do not, the binary working has a slip in it, usually a carry.

Where binary arithmetic is used

Binary arithmetic runs inside every computer, phone, and digital camera, because the hardware stores everything as patterns of on and off. Adding, comparing, and shifting binary numbers is what a processor does billions of times a second, and this calculator shows the same operations at human speed.

Network engineers read binary when they work with IP addresses and subnet masks, and electronics students read it when they work with logic gates and counters. An exponent calculator and a power calculator help with the place values, since each binary place is a power of 2, and a scientific calculator handles the decimal side. A exponent calculator and a power calculator sit next to this kind of work in most maths toolboxes, and people often use two or three of them together on the same problem.

In school, binary is usually the first number system students meet after decimal, and it teaches place value by contrast: the same digits mean different things in different bases. A student who can convert 1010 to 10 understands place value properly, not just as a habit.

Try a few values yourself once you have read the worked examples, changing one input at a time and watching how the answer moves, then check one result by hand with the method above before you trust the screen. That habit, one hand check for every new kind of problem, is what turns a quick answer into real understanding, and it catches the typing slips that no calculator can catch for you.

Binary calculator vs a decimal calculator

A binary calculator works in base 2, with digits 0 and 1, while a decimal calculator works in base 10, with digits 0 to 9. The arithmetic is the same in structure, adding, subtracting, and multiplying column by column, but the carries and borrows are different, because binary carries at 2 and decimal carries at 10. A scientific calculator answers a different question, so the two tools complement each other rather than competing.

Use this calculator when the numbers are binary, for a computing course, a networking problem, or an electronics exercise. Use a decimal calculator for ordinary money, measurements, and school maths. The base decides the tool, and converting between bases is a separate step from the arithmetic itself.

Binary pairs naturally with logarithms and exponents, since binary place values are powers of 2, and a logarithm to base 2 answers how many bits a number needs, which is a question that comes up constantly in computing. A logarithm calculator is another tool people reach for on the same kind of problem, and keeping the three together covers most everyday cases.

Common binary mistakes

The most common mistake is writing 1 plus 1 as 2 in binary. In binary, 1 plus 1 is 10, which means write 0 and carry 1, because there is no digit 2 in base 2. Any binary answer containing a 2 is wrong by definition.

The second mistake is forgetting a carry. In 1010 plus 1100, the carries ripple through three columns, and missing one of them changes the answer by a power of 2. Working column by column from the right, and writing the carry down, prevents this.

The third mistake is reading a binary string as a decimal number. 1010 looks like one thousand and ten, but in binary it is 10, and 101 is 5, not one hundred and one. Always check which base a number is written in before doing anything with it.

The fourth mistake is mixing bases in one calculation, adding a binary number to a decimal number without converting first. 1010 in binary plus 12 in decimal is 22 only because 1010 in binary is 10 in decimal; adding the digits as if both were decimal gives a meaningless result.

How to use this binary calculator

Type the first binary number in the top box and the second in the next box, using only the digits 0 and 1, then pick Add, Subtract, or Multiply. The binary result and the decimal result appear at once, and both update live as you type.

Read the binary result first, then the decimal result underneath it, which is the same answer in ordinary numbers. If the binary result shows a dash, check the inputs for a digit other than 0 or 1, or for a subtraction that goes below zero.

If an answer surprises you, check the input first, then run the worked example from this page through the calculator and confirm it gives the same result. When the known example is right and your own input is right, the answer is right, and that two-step check settles almost every disagreement between a person and a calculator.

Nothing you type leaves your device, so you can use the binary calculator as often as you like, for homework, for work, or just to settle an argument. Bookmark the page and it is ready whenever the next number needs checking.

Frequently Asked Questions

1010 plus 1100 is 10110 in binary. In decimal, 1010 is 10 and 1100 is 12, and 10 plus 12 is 22, which is 10110 in binary: 16 plus 4 plus 2. The calculator shows both the binary and the decimal answer.

Add them column by column from the right, just like decimal addition, but 1 plus 1 is 10 in binary, so you write 0 and carry 1. For 1010 plus 1100, the columns give 10110. The decimal check is 10 plus 12 is 22.

1010 in binary is 10 in decimal. The place values are 8, 4, 2, and 1, and the digits 1, 0, 1, 0 mean 8 plus 0 plus 2 plus 0, which is 10. Each 1 in the string adds its place value to the total.

Computers use binary because their circuits have two stable states, on and off, which map naturally to 1 and 0. Every number, letter, picture, and sound in a computer is stored as a pattern of those two states, and binary arithmetic is how the machine adds them.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.