Binary Calculator
- Value 1 in decimal: 101001001 in binary = 329.
- Value 2 in decimal: 011001000 in binary = 200.
- Add the decimal values: 329 + 200 = 529.
- In binary the same sum reads 101001001 + 11001000 = 1000010001.
- Write the result in binary: 529 = 1000010001.
- Changing base: each digit is multiplied by a power of the base, and the products are added to get the decimal value.
- Binary addition: 0+0=0, 0+1=1, 1+1=10 (write 0, carry 1) and 1+1+1=11 (write 1, carry 1).
- The decimal check 329 + 200 = 529 matches the binary answer.
- Converting back: 10 0001 0001 in binary = 529 in decimal.
- The result needs 10 bits.
Binary Calculator: Add, Subtract, Multiply and Divide in Base 2
This free binary calculator does arithmetic on numbers written with only 0s and 1s. Type two values, pick an operation and the answer appears straight away, along with the working, the same result in decimal, octal and hexadecimal, and a row-by-row picture of the bits. It also handles the bitwise operations AND, OR and XOR that programmers use every day.
Quick answer: 101001001 + 011001000 = 1000010001 in binary, which is 329 + 200 = 529 in decimal.
What Is Binary?
Binary is the number system computers use. It has two digits, 0 and 1, and each place is worth twice the place to its right: 1, 2, 4, 8, 16 and so on. The binary number 101001001 is 256 + 64 + 8 + 1, which makes 329. Everyday decimal counting works the same way with powers of ten instead of powers of two. If you only need to switch between systems, the base buttons convert the number in the box for you.
How Binary Addition and Subtraction Work
Addition is done column by column from the right. 0 + 0 is 0, 0 + 1 is 1, and 1 + 1 is 10, so you write 0 and carry a 1 into the next column. Subtraction follows the same idea in reverse. When a 0 has to take away a 1 you borrow from the next column, which turns the 0 into 10. If Value 2 is larger than Value 1 the answer is negative and is shown with a minus sign.
Binary Multiplication and Division
To multiply, take a copy of the first number for every 1 in the second number, shift each copy left to match its place, and add the copies. Multiplying by 2 just adds a 0 to the end. Division here is whole-number division, so you get a quotient and a remainder. Dividing by 2 moves every bit one place to the right. For decimal fractions or longer expressions you can use the scientific calculator or the math solver.
AND, OR and XOR
Bitwise operations line the two numbers up and compare them bit by bit. AND keeps a 1 only where both numbers have a 1, which is handy for masking out bits. OR gives a 1 where either number has one, which switches bits on. XOR gives a 1 only where the bits differ, so a number XOR itself is always 0. These are common in networking, graphics and low-level code.
| Operation | Binary | Decimal |
|---|---|---|
| Add | 101001001 + 011001000 = 1000010001 | 329 + 200 = 529 |
| Subtract | 1100 − 101 = 111 | 12 − 5 = 7 |
| Multiply | 1011 × 11 = 100001 | 11 × 3 = 33 |
| Divide | 1101 ÷ 10 = 110 remainder 1 | 13 ÷ 2 = 6 remainder 1 |
| AND | 1100 AND 1010 = 1000 | 12 AND 10 = 8 |
| OR | 1100 OR 1010 = 1110 | 12 OR 10 = 14 |
| XOR | 1100 XOR 1010 = 110 | 12 XOR 10 = 6 |
Working Across Number Systems
Hexadecimal is popular because one hex digit stands for exactly four bits, so long binary strings become short and readable. Octal does the same with three bits per digit. You can set each value to its own system, for example a hex colour mask against a binary flag, and choose any system for the answer. For related number work see the GCD / LCM calculator, the prime factorization calculator and the radian and degree calculator.
Where Binary Arithmetic Is Used
Every processor adds, shifts and compares binary numbers. Programmers use it to check bit flags, set file permissions, work out subnet masks and debug memory values. Students meet it in computer science courses when learning how integers are stored. A quick check with a calculator saves a lot of slow, error-prone column work on paper.
How to Use This Binary Calculator
Enter two values
Type or paste a number in Value 1 and Value 2. Choose Binary, Decimal, Octal or Hex under each box.
Pick an operation
Press +, −, ×, ÷, AND, OR or XOR. The answer updates as you type.
Choose the result format
Use Show result in to see the answer as binary, decimal, octal or hex.
Read the working
Check the steps, the bit view and the other number systems to confirm the answer.