Binary Carry Calculator – Free

Add two binary numbers and this binary carry calculator shows the carry entering and leaving each bit position, from the least significant bit upward.

How to use the Binary Carry Calculator tool

  1. Type the first addend into the First binary number box.
  2. Type the second addend into the Second binary number box, or select Example for 1011 and 11.
  3. Select Show steps to run the addition.
  4. Read the sum on the Result line and the carries on the Bit lines underneath. Bit 0 is the rightmost position.
  5. Select Copy to copy the trace, or Clear to reset both boxes.

What a carry is in binary addition

A single binary column can hold 0 or 1. When the bits in a column add up to 2 or 3, the column keeps the low bit of that total and sends a 1 to the next column on the left. That 1 is the carry. Since each column can receive a carry from its right, three bits may be added at once: one from each number and the carry in.

The calculator pads the shorter number with leading zeros, then processes the columns from right to left. For each one it records the two operand bits, the carry that arrived (in) and the carry that leaves (out). Bit 0 always has in 0. The work is done by JavaScript in the page.

Worked example: tracing 1011 + 11

This is the example built into the binary carry calculator. Bit 0 adds 1 + 1 and produces a carry. Bit 1 adds 1 + 1 plus that carry, a total of 3, so it carries again. Bit 2 has only the incoming carry, which it absorbs. Bit 3 passes nothing on. The sum is 1110, or 14.

Result: 1110

Bit 0: 1 + 1, in 0, out 1
Bit 1: 1 + 1, in 1, out 1
Bit 2: 0 + 0, in 1, out 0
Bit 3: 1 + 0, in 0, out 0

Full adders and the ripple carry chain

Each line of the trace matches one full adder in hardware. A full adder takes bits a and b and a carry in. Its sum output is a XOR b XOR in, and its carry out is 1 when at least two of the three inputs are 1. The trace prints the carry and leaves the sum bit for you to read from the Result line.

Wiring full adders in a row, carry out to carry in, makes a ripple carry adder. Its speed depends on the longest carry chain. Adding 1 to 11111111 is the worst case for eight bits: the carry starts at bit 0 and travels through every position. Carry-lookahead adders avoid the wait by computing for each bit whether it generates a carry (a AND b) or propagates one (a XOR b).

The final carry and the result width

When the last line ends with out 1, the sum needs one more bit than the inputs. The calculator keeps it: 1111 + 1 gives Result: 10000 even though the trace has four lines. A fixed-width register would drop that bit and raise the carry flag, which is how multi-word addition passes a carry from one word to the next.

Accepted input for the binary carry calculator

The two boxes follow the same rules, which differ slightly from the Binary Addition Calculator.

  • Between 1 and 65,536 binary digits per number.
  • Spaces are ignored, so you can group bits as 1011 0110.
  • A leading 0b prefix is removed.
  • Minus signs are not allowed. The trace is for unsigned bit strings.
  • The Result line drops leading zeros, while the trace covers every column of the wider input.

Frequently asked questions

When does binary addition produce a carry?

Whenever a column's total is 2 or more. That happens when both operand bits are 1, or when one of them is 1 and a carry arrives from the column to the right.

What is the longest possible carry chain?

A chain can run the full width of the numbers. Adding 1 to a value made entirely of ones, such as 11111111, carries out of every position and produces a 1 followed by zeros.

Is the carry flag the same as overflow?

No. The carry flag reports a carry out of the top bit, which signals overflow for unsigned numbers. Signed overflow is a separate condition: it occurs when the carry into the top bit differs from the carry out of it.

Can I trace an addition with negative numbers?

Not directly. The tool rejects a minus sign. To study signed addition, enter the two's complement bit patterns of your operands at a fixed width and ignore any carry beyond that width.

Related tools