How to use the binary calculator
- Type a valid binary number (only 0s and 1s) into the First binary number field.
- Select the arithmetic operation you need from the dropdown menu.
- Type the second binary number into the Second binary number field.
- Read the answer immediately in both binary and decimal notation.
How binary arithmetic works
Binary numbers use base 2, meaning each digit represents a power of 2 instead of a power of 10. The rightmost digit is 20 (1), the next is 21 (2), then 22 (4), and so on. For example, the binary number 1010 equals 8 + 0 + 2 + 0 = 10 in decimal.
When using a binary calculator for addition, the rules are straightforward: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 (write 0, carry 1). Adding 1010 and 110 works like this:
- Rightmost column: 0 + 0 = 0
- Next column: 1 + 1 = 10 (write 0, carry 1)
- Next column: 0 + 1 + 1 (carry) = 10 (write 0, carry 1)
- Leftmost column: 1 + 0 + 1 (carry) = 10 (write 0, carry 1)
- Final carry: 1
The result is 10000, which is 16 in decimal.
Binary subtraction and negative results
Binary subtraction follows the same borrowing logic as decimal subtraction. When you subtract a larger bit from a smaller one, you borrow from the next higher position. For instance, computing 10000 minus 111 requires multiple borrows across positions. The decimal equivalents are 16 minus 7, yielding 9, which is 1001 in binary.
This binary calculator displays negative results with a leading minus sign rather than using two's complement notation. Two's complement is common in hardware design, but for everyday math problems, a simple minus sign is easier to read and verify against decimal values.
Binary multiplication and division
Binary multiplication is simpler than decimal multiplication because each digit is only 0 or 1. You either copy the multiplicand shifted by the appropriate number of places (when the multiplier bit is 1) or write zeros (when it is 0), then add all partial products together. Multiplying 101 by 11 means adding 101 shifted left by 0 and 101 shifted left by 1, giving 1111 (decimal 15).
Binary division uses repeated subtraction, much like long division in base 10. Dividing 11110 by 101 yields exactly 110 with no remainder. If a division does not resolve evenly, this tool truncates toward zero, matching standard integer division behavior.
Common binary values reference
Use this table to quickly check small powers of two and their binary representations when verifying your work with the binary calculator.
| Decimal | Binary | Power of 2 |
|---|---|---|
| 1 | 1 | 20 |
| 2 | 10 | 21 |
| 4 | 100 | 22 |
| 8 | 1000 | 23 |
| 16 | 10000 | 24 |
| 32 | 100000 | 25 |
| 64 | 1000000 | 26 |
| 128 | 10000000 | 27 |
| 255 | 11111111 | 28 - 1 |
Practical uses for binary arithmetic
Understanding binary math is essential in computer science, networking and electronics. Subnet masks in IPv4 addressing rely on bitwise operations over 32-bit binary numbers. When configuring network equipment, engineers frequently perform binary addition and binary subtraction to calculate address ranges and broadcast addresses. Tools like the subnet calculator automate this, but knowing the underlying math helps troubleshoot edge cases.
In programming, bit shifting is equivalent to binary multiplication or division by powers of two. Shifting a value left by one position multiplies it by 2; shifting right divides it by 2. Embedded systems developers working close to hardware often compute register values manually using these principles. For conversions between bases, the number base converter handles arbitrary radix transformations beyond just base 2 and base 10.
Worked examples
Each result below was produced by the same code the tool runs, so you can check your own numbers against them.
| Example | Input | Result |
|---|---|---|
| Binary addition | First binary number: 1010; Operation: add; Second binary number: 110 | Binary result: 10000; Decimal result: 16; Equation: 1010 + 110 = 10000 |
| Binary subtraction | First binary number: 10000; Operation: sub; Second binary number: 111 | Binary result: 1001; Decimal result: 9; Equation: 10000 - 111 = 1001 |
| Binary multiplication | First binary number: 101; Operation: mul; Second binary number: 11 | Binary result: 1111; Decimal result: 15; Equation: 101 × 11 = 1111 |
| Binary division | First binary number: 11110; Operation: div; Second binary number: 101 | Binary result: 110; Decimal result: 6; Equation: 11110 ÷ 101 = 110 |
FAQ
What is a binary calculator?
A binary calculator performs arithmetic operations such as addition, subtraction, multiplication and division on numbers expressed in base 2, using only the digits 0 and 1.
How do I add two binary numbers?
Add them column by column from right to left. If the sum in a column is 2 (which is 10 in binary), write down 0 and carry 1 to the next column.
Can this tool handle negative binary numbers?
Yes. You can enter a leading minus sign before the binary digits. The tool will compute the correct signed result and display it in both binary and decimal.
Why does binary division truncate instead of showing decimals?
This tool performs integer arithmetic. Fractional binary results require a floating-point format, which is beyond the scope of basic binary addition, subtraction, multiplication and division.
Is my data sent to a server when I use this tool?
No. All calculations happen locally in your browser. Nothing you type is uploaded anywhere.
What is the largest binary number this calculator supports?
It safely handles integers up to 53 bits in magnitude, which corresponds to JavaScript's maximum safe integer of 9,007,199,254,740,991.