Binary Add / Subtract
Fixed-width binary add/subtract — with carry/borrow, mixed bin/hex/dec input.
What it does: Performs fixed-width binary addition and subtraction and shows carry/borrow.
When to use it: Learning computer arithmetic or debugging register operations.
MEANS The result wraps around within the bit width; a carry/borrow means it exceeded the range that bit width can represent.
No history yet. Each calculation is automatically saved to this device.
How to use the binary add/subtract calculator
Enter two numbers and pick an operation.
- 01
Enter two operands
Mix binary 0b, hexadecimal 0x and decimal freely.
- 02
Pick operation and bit width
Addition or subtraction; the bit width determines wraparound and the carry/borrow decision.
- 03
Read the result
Gives binary / decimal / hex results, and flags whether a carry/borrow occurred (overflow of the bit width).
Common questions, answered in 3 minutes
What are carry and borrow?
When an addition result exceeds the largest value the bit width can hold, there is a "carry" (the top bit overflows out); when a subtraction does not have enough to subtract, there is a "borrow" (the result wraps around as unsigned).
Why does 3−5 give 254?
In 8-bit unsigned there is not enough to subtract, so after borrowing it wraps to 2⁸+(3−5)=254, which is exactly the 8-bit two's complement of −2.
How are negative numbers handled?
This tool displays values wrapped around within the unsigned bit width; the two's complement of a negative result is the corresponding unsigned value (see the sign-magnitude / one's / two's complement tool).
Standards and sources referenced by this tool
| Item | Value / Formula | Source |
|---|---|---|
| Fixed-width binary arithmetic | Wraparound + carry/borrow | Binary arithmetic |
Exact BigInt + bit-width wraparound, no external API.