Binary Calculator

Perform binary addition, subtraction, multiplication, and division with step-by-step solutions, bit-level analysis, and computer science explanations.

Binary Operands

= 10
= 12
Quick examples:

Binary Number System

What Is the Binary Number System?

Binary is the base-2 numeral system that underpins every modern digital computer. Where decimal uses ten digits (0–9), binary uses just two — 0 and 1 — to represent every possible number. Each binary digit, or bit, corresponds to one of two electrical states (off or on, low or high voltage), which makes binary uniquely suited to the physics of transistors and the logic of digital circuits.

How Binary Works

Each bit in a binary number carries a place value that is a power of 2. The rightmost bit is 2⁰ = 1, the next is 2¹ = 2, then 4, 8, 16, 32, 64, 128, and so on. To convert any binary value to decimal, add the place values wherever a 1 appears. For example, 1011 = 8 + 0 + 2 + 1 = 11. This same place-value scheme — adapted from decimal — is what makes binary arithmetic so similar to the math you already know.

Why Computers Use Binary

Digital circuits reliably distinguish two voltage states but struggle with anything more nuanced. Mapping 0 and 1 to off/on gives modern hardware excellent noise tolerance, fast switching speeds, and a clean correspondence with Boolean algebra. Every higher-level abstraction — integers, floats, characters, images, audio, even neural-network weights — eventually compiles down to a stream of binary bits inside the CPU.

Four Ways to Use This Binary Calculator

1

Add binary numbers

Combine two binary values column-by-column with full carry handling. Useful for studying ALU adders, modeling overflow, or quickly summing register values.

2

Subtract & two's complement

Subtract one binary value from another and see how two's complement encodes negative numbers. Perfect for hands-on work with signed integer math.

3

Multiply via shift-and-add

See how binary multiplication reduces to a sequence of shifts and additions — the algorithm every CPU multiplier implements in silicon.

4

Long-divide & remainders

Perform binary long division with quotient and remainder, just like in elementary school but with only two outcomes per bit position.

5

Convert to hex & octal

Every result also displays in hexadecimal (base 16) and octal (base 8). Hex is preferred by programmers because 4 bits map cleanly to one hex digit.

6

Analyze bit storage

See exactly how many bits a value needs and which standard CPU width (8, 16, 32, 64 bits) it occupies — critical for embedded systems and protocol design.

Binary Arithmetic Rules at a Glance

Addition

0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 10 (carry 1) 1 + 1 + 1 = 11 (carry 1)

Subtraction (with borrow)

0 − 0 = 0 1 − 0 = 1 1 − 1 = 0 0 − 1 = 1 (borrow 1)

Multiplication

0 × 0 = 0 1 × 0 = 0 0 × 1 = 0 1 × 1 = 1

Division

Long division with two outcomes per step — the divisor either fits (write 1, subtract) or it doesn't (write 0, bring down). Same procedure as decimal long division, just simpler.

Bits, Bytes, and Storage Units

UnitBitsMax UnsignedTypical Use
Bit11Boolean flag, on/off switch
Nibble415Hex digit, BCD packed digit
Byte8255ASCII char, RGB color channel, register byte
Word1665,535Unicode BMP code point, audio sample
Doubleword324,294,967,295IPv4 address, default C int, RGBA color
Quadword6418,446,744,073,709,551,615Pointer, timestamp, large counter

Common Mistakes When Doing Binary Math

  • Forgetting the carry. 1 + 1 in binary equals 10 (decimal 2), not 0 — and the carry must propagate to the next column.
  • Confusing 0b and 0x prefixes. 0b101 means binary 101 (decimal 5); 0x101 means hex 101 (decimal 257).
  • Treating signed and unsigned the same. An 8-bit value of 11111111 is 255 unsigned but −1 in two's complement signed.
  • Off-by-one bit counts. An N-bit unsigned integer represents 2ᴺ distinct values, not 2ᴺ − 1.
  • Ignoring overflow. Adding two 8-bit values can produce a 9-bit result; CPUs raise an overflow flag rather than silently truncating.

Frequently Asked Questions

Common Questions

What is a binary calculator?

A binary calculator performs arithmetic — addition, subtraction, multiplication, and division — directly on binary (base-2) numbers and shows the result in binary, decimal, hexadecimal, and octal. Our calculator also generates step-by-step solutions, a bit-by-bit visualization, and storage-size analysis so you can see exactly how the CPU would handle the calculation.

How do you add binary numbers?

Add column by column from right to left, exactly like decimal addition, but using only the rules 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (write 0, carry 1), and 1 + 1 + 1 = 11 (write 1, carry 1). For example, 1010 + 1100 = 10110: rightmost bits 0 + 0 = 0, then 1 + 0 = 1, then 0 + 1 = 1, then 1 + 1 = 10 (write 0, carry 1), leaving a final 1 in the new high column.

How do you subtract binary numbers?

Computers subtract by adding the two's complement of the second operand. To compute A − B, invert every bit of B, add 1, then add that result to A. The carry out of the highest bit is discarded. This avoids needing dedicated subtraction hardware — the same adder handles both addition and subtraction.

How does binary multiplication work?

Binary multiplication uses the same shift-and-add method as long multiplication in decimal — but is dramatically simpler because every digit is 0 or 1. For each bit of the multiplier that is 1, copy the multiplicand shifted left by that bit's position; for each 0 bit, write zeros. Sum all the partial products to get the final binary product.

How is binary division performed?

Binary long division is the same as decimal long division but with only two outcomes per step: the divisor either fits into the current portion of the dividend (write a 1 and subtract) or it does not (write a 0 and bring down the next bit). The process continues until every bit of the dividend has been used. The leftover value is the remainder.

What is a bit, a nibble, and a byte?

A bit is a single binary digit — 0 or 1. A nibble is 4 bits and represents one hexadecimal digit. A byte is 8 bits and can represent 256 distinct values (0–255 unsigned, or −128 to 127 signed using two's complement). Most computer memory is addressed at the byte level, and all standard data types (int, float, char) are multiples of one byte.

Why do computers use binary instead of decimal?

Electronic circuits are reliable at distinguishing exactly two voltage states — high and low — which map directly to 1 and 0. Building a decimal computer would require detecting ten different voltage levels, which is both harder to engineer and far less noise-resistant. Binary also pairs perfectly with Boolean logic, the foundation of all digital circuits.

Can this calculator handle negative binary numbers?

Yes — prefix any binary input with a minus sign (e.g. -1010) and the calculator treats it as a signed value. Internally it uses arbitrary-precision BigInt arithmetic, so results stay exact even for numbers far larger than 64 bits. The bit-analysis panel reports the storage width a CPU would need to hold each result.

What is two's complement?

Two's complement is the standard encoding for signed integers in nearly every modern CPU. To represent a negative number in N bits, invert every bit of its magnitude and add 1. This makes the most significant bit the sign bit (1 = negative), gives exactly one representation for zero, and lets the same addition hardware handle both positive and negative operands.

How big a number can the calculator handle?

The calculator uses JavaScript BigInt, so there is no fixed bit limit — you can multiply two 200-bit numbers and the result is still exact. The result card always reports the actual bit length needed and rounds up to the nearest standard storage size (8, 16, 32, 64, or 128 bits) so you can see whether the answer would fit in an int8, int16, int32, or int64.