DIGITAL · TOOL

Binary Add / Subtract

Fixed-width binary add/subtract — with carry/borrow, mixed bin/hex/dec input.

Basic No backend · 100% client-side

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.

→ 1111 (15)
Next

You might also need

How to

How to use the binary add/subtract calculator

Enter two numbers and pick an operation.

  1. 01

    Enter two operands

    Mix binary 0b, hexadecimal 0x and decimal freely.

  2. 02

    Pick operation and bit width

    Addition or subtraction; the bit width determines wraparound and the carry/borrow decision.

  3. 03

    Read the result

    Gives binary / decimal / hex results, and flags whether a carry/borrow occurred (overflow of the bit width).

FAQ

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).

Data Provenance

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.

⚡ Powered by Circflow