Add binary numbers
Binary addition with carry
Carry bits are shown above the columns. For a fixed-width result, any carry beyond the selected width is reported separately.
Binary addition rules
No carry is generated.
No carry is generated.
No carry is generated.
Write 0 in the current column and carry 1 to the next column.
What about 1 + 1 + carry?
When the incoming carry is also 1, the total is 3 in decimal,
which is 11 in binary. Write 1 and carry 1.
The calculator uses arbitrary-precision integer arithmetic for the underlying calculation, avoiding JavaScript's ordinary 32-bit bitwise limitations.
How binary addition works
Binary numbers use only two digits: 0 and 1. Addition works much like decimal addition, except each column has a base of two. When a column's total reaches two, a carry moves into the next column to the left.
Example: 1011 + 1101
The decimal equivalents are 11 and 13. Their sum is 24, which is
11000 in binary.
| Binary operation | Sum bit | Carry out |
|---|---|---|
0 + 0 + 0 | 0 | 0 |
0 + 0 + 1 | 1 | 0 |
0 + 1 + 0 | 1 | 0 |
1 + 1 + 0 | 0 | 1 |
1 + 1 + 1 | 1 | 1 |
Unsigned and signed binary addition
Unsigned binary
Unsigned binary represents non-negative integers. With a fixed width of \(n\) bits, its range is from 0 to \(2^n - 1\). For example, an 8-bit unsigned number ranges from 0 to 255.
Two's-complement signed binary
Two's complement represents both positive and negative integers. With \(n\) bits, its range is from \(-2^{n-1}\) to \(2^{n-1}-1\). In an 8-bit representation, that range is -128 to 127.
Frequently asked questions
How do I add two binary numbers?
Align the least significant bits, add each column from right to left, and carry 1 to the next column whenever the total is 2 or 3. Continue until all bits and any remaining carry have been processed.
What does a carry mean in binary addition?
A carry is a value passed to the next column when the current column's sum is at least 2. The sum bit is the column total modulo 2, and the carry is the integer part of the total divided by 2.
Can binary addition produce more bits than the inputs?
Yes. Adding two binary numbers can require an extra leading bit. For example, 1111 plus 0001 equals 10000. In fixed-width arithmetic, that extra carry may be discarded from the stored result and reported separately.
What is the difference between carry and overflow?
Carry out indicates that a result extends beyond the most significant bit in unsigned fixed-width addition. Signed overflow indicates that a two's-complement result is outside the signed range. These are different conditions.
How do you add negative binary numbers?
Computers commonly represent negative integers with two's complement. Choose signed two's-complement mode and a fixed width, then enter the bit patterns. The calculator interprets each input using that width.
Does this calculator support large binary numbers?
The underlying calculation uses JavaScript BigInt, so ordinary arithmetic is not limited to 32-bit integers. Fixed-width display options are provided for common 4-, 8-, 16-, 32- and 64-bit values.