Binary Number Multiplier
Multiply two binary numbers with step-by-step long multiplication breakdown. See partial products, shifts, and decimal verification instantly.
About
Binary multiplication follows the same shift-and-add algorithm taught for decimal long multiplication, but each partial product is trivially 0 or a shifted copy of the multiplicand. This simplicity is exactly why hardware ALUs implement multiplication as iterated addition with bit-shifting. A single misaligned partial product, however, propagates carry errors through every subsequent bit position. For inputs exceeding 53 bits the IEEE 754 double-precision mantissa overflows, silently truncating your result in naive implementations. This tool uses arbitrary-precision integer arithmetic internally, so it handles operands of any practical length without loss.
The calculator renders each partial product row, its positional shift, and the running summation so you can trace exactly where each output bit originates. Decimal equivalents of both operands and the product are displayed for cross-verification. Note: the tool assumes unsigned (non-negative) binary integers. Two's complement signed multiplication requires additional sign-extension logic not covered here.
Formulas
Binary long multiplication mirrors decimal long multiplication. For two unsigned binary numbers A (multiplicand) and B (multiplier), the product P is computed as:
where n is the number of bits in B, Bi is the i-th bit of the multiplier (from LSB), and « denotes a left bit-shift by i positions (equivalent to multiplication by 2i). Each partial product is either 0 (when Bi = 0) or A shifted left by i places (when Bi = 1).
The maximum bit-width of the product is len(A) + len(B). Carry propagation during summation of partial products follows standard binary addition: 1 + 1 = 102, producing a carry of 1 into the next bit position.
Reference Data
| Decimal | Binary | Bit Width | Max Unsigned Value | Common Use |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | Boolean flag |
| 15 | 1111 | 4 (nibble) | 15 | Hex digit, BCD |
| 255 | 11111111 | 8 (byte) | 255 | Pixel channel, ASCII |
| 1023 | 1111111111 | 10 | 1023 | ADC resolution |
| 4095 | 111111111111 | 12 | 4095 | 12-bit sensor data |
| 65535 | 1111111111111111 | 16 | 65,535 | TCP port, UInt16 |
| 16777215 | 111111111111111111111111 | 24 | 16,777,215 | RGB color |
| 232 − 1 | 32 × 1 | 32 | 4,294,967,295 | IPv4 address, UInt32 |
| 253 − 1 | 53 × 1 | 53 | 9,007,199,254,740,991 | JS Number.MAX_SAFE_INTEGER |
| 264 − 1 | 64 × 1 | 64 | 18,446,744,073,709,551,615 | UInt64, memory addressing |
| 2128 − 1 | 128 × 1 | 128 | ≈ 3.4 × 1038 | IPv6 address, UUID |
| 2256 − 1 | 256 × 1 | 256 | ≈ 1.16 × 1077 | SHA-256 hash space |