Binary Arithmetic Calculator

← Back to Engineering Library

Calculate with two binary integers

Enter up to 256 bits per operand using 0 and 1. A leading minus sign represents a negative integer. The result uses as many bits as needed. Division returns a whole-number quotient and a remainder.

Arithmetic result

Binary result: 10010

1101₂ + 101₂ = 10010₂. Decimal check: 13 + 5 = 18.

Place value and arithmetic

A bit at position k contributes its digit times 2k, counting from zero at the right. For example, 11012 = 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = 13. The operands are dimensionless integers. Changing the base changes how we write each integer while preserving its value.

With A = 11012 and B = 1012, addition gives 13 + 5 = 18 = 100102. Subtraction gives 13 − 5 = 8 = 10002. Multiplication gives 13 × 5 = 65 = 10000012.

For division, A = B × Q + R. Divide A by nonzero B and truncate toward zero to get the integer quotient Q. Subtract B × Q from A to get the remainder R. For 13 divided by 5, 13 = 5 × 2 + 3, so Q = 102 and R = 112.

Follow the carry

Add 1112 and 12 from the right. The ones column totals two, which writes a zero and carries one. The carry repeats in the twos and fours columns. The final carry creates an eights column, giving 10002. This is a useful test when sizing a counter that must represent the next count.

Compare the four operations

The same input pair, 1011 and 11, represents decimal 11 and 3. Read the binary result alongside its decimal check.

Arithmetic with binary operands 1011 and 11
Operation Binary result Decimal check
Addition 1110 11 + 3 = 14
Subtraction 1000 11 − 3 = 8
Multiplication 100001 11 × 3 = 33
Division Q = 11, R = 10 11 = 3 × 3 + 2

Download the Binary arithmetic table (PDF)

Using binary division to group samples

A buffer holds 11101₂ samples and a record uses 100₂ samples. In decimal, 29 = 4 × 7 + 1. Seven complete records fit, with one sample left. In binary the quotient is 111 and the remainder is 1.

Questions about binary arithmetic

Why did the result gain a bit?

Adding 1 to 11111111 produces 100000000, decimal 256. An unsigned eight-bit register only holds values through 255. This calculator displays the full sum, so you can see the extra bit before choosing a storage width.

How does borrowing work?

In 1000₂ − 1₂, the eight is exchanged for smaller powers of two. After subtracting one, four plus two plus one remain, giving 111₂.

Why does multiplying by 100 shift the digits?

100₂ equals four. Multiplying by four raises every place value by two powers of two, so 1011₂ × 100₂ becomes 101100₂.

Does 11111111 mean minus one?

Here it means 255. For negative one, enter -1. A fixed-width two’s-complement representation assigns a different meaning to the high bit and requires a specified word width.

What happens when the dividend is negative?

For −1011₂ divided by 11₂, the decimal quotient is −3 and the remainder is −2. The check is −11 = 3 × (−3) + (−2). A nonzero remainder follows the dividend’s sign under truncation toward zero.

Can I paste leading zeros or a binary fraction?

Leading zeros are accepted and count toward the 256-bit input limit. A radix point, a 0b prefix, and embedded spaces are rejected. Enter the digits of an integer, such as 00101 for five.

Reference: MDN’s BigInt reference describes the exact integer operations and quotient convention used here.

Related Engineering Calculators

Share This Article
Tags: