➕ Binary Addition Calculator
Add two binary numbers with step-by-step solution
How to Use This Calculator
Enter Binary Numbers
Input two binary numbers you want to add. The calculator accepts only 0s and 1s. Examples: 1010, 1100, 1111. You can enter numbers of different lengths.
Click Calculate Addition
Press the "Calculate Addition" button to perform binary addition. The calculator will automatically align the numbers and show the step-by-step process with carry operations.
Review Results
The result shows the binary sum, decimal equivalent, and a detailed step-by-step breakdown showing how each bit position was calculated, including carry operations.
Formula
Binary Addition: Add from right to left, carry when sum ≥ 2
Result = (sum % 2), Carry = floor(sum / 2)
How it works:
Binary addition works similarly to decimal addition, but uses base 2 instead of base 10. You add bits from right to left, and when the sum is 2 or more, you write the remainder (0 or 1) and carry 1 to the next position.
Binary Addition Rules:
- 0 + 0 = 0 (no carry)
- 0 + 1 = 1 (no carry)
- 1 + 0 = 1 (no carry)
- 1 + 1 = 0 (carry 1)
- 1 + 1 + 1 = 1 (carry 1)
Example 1: 1010 + 1100
1010
+ 1100
------
Step 1: 0 + 0 = 0 (no carry)
Step 2: 1 + 0 = 1 (no carry)
Step 3: 0 + 1 = 1 (no carry)
Step 4: 1 + 1 = 0 (carry 1)
Step 5: 0 + 0 + carry 1 = 1
Result: 10110 (binary) = 22 (decimal)
Example 2: 1111 + 0001
1111
+ 0001
------
Step 1: 1 + 1 = 0 (carry 1)
Step 2: 1 + 0 + carry 1 = 0 (carry 1)
Step 3: 1 + 0 + carry 1 = 0 (carry 1)
Step 4: 1 + 0 + carry 1 = 0 (carry 1)
Step 5: 0 + 0 + carry 1 = 1
Result: 10000 (binary) = 16 (decimal)
Frequently Asked Questions
How does binary addition differ from decimal addition?
Binary addition uses base 2, so you carry when the sum is 2 or more (instead of 10 in decimal). The process is the same: add from right to left, carry when needed. The only difference is the base number.
What happens when I add 1 + 1 in binary?
In binary, 1 + 1 = 10 (binary), which equals 2 in decimal. You write 0 and carry 1 to the next position. This is similar to how 9 + 1 = 10 in decimal.
Can I add binary numbers of different lengths?
Yes! The calculator automatically pads the shorter number with leading zeros to match the length of the longer number before performing the addition.
What is a carry in binary addition?
A carry occurs when the sum of two bits (plus any previous carry) is 2 or more. In binary, this means you write 0 or 1 as the result and move 1 to the next position. This is exactly like carrying in decimal addition when the sum exceeds 9.
Why is binary addition important in computer science?
All arithmetic operations in computers are performed using binary. Processors use binary addition circuits to perform addition, subtraction (using two's complement), multiplication, and division. Understanding binary addition is fundamental to understanding how computers work.
What's the maximum number of bits I can add?
JavaScript supports up to 53 bits for integers. For practical purposes, this calculator works well with numbers up to 32 bits (4 bytes), which covers most common use cases in programming and computer architecture.