Text Tools
Fancy Text
Calculators
Dev Tools
More
Blog Get the Chrome extension
Free · No sign-up · Nothing is uploaded

Binary Calculator: Math with Steps

Add, subtract, multiply and divide binary numbers and see every step. Bitwise operations and two’s complement included.

Mode

Operation

Two’s complement view (bits)

Group digits

Show the working

Looking to convert text? This page does math on binary numbers. To turn letters into 0s and 1s, use the text to binary translator, or decode binary back into words with the binary to text converter.

Private by design. Everything runs in your browser and is never uploaded.

The basics

What is a binary calculator?

A binary calculator does arithmetic on base-2 numbers, which use only the digits 0 and 1. It adds, subtracts, multiplies and divides binary values, and many also convert to decimal and run bitwise operations. This one works with binary numbers of any length and shows the carries, borrows and remainders behind each answer.

Binary is a place-value system like decimal, except each place is worth twice the place to its right, so 1011 means 8 + 0 + 2 + 1 = 11. The rules are the same as in school arithmetic with two digits: 1 + 1 = 10, which writes 0 and carries 1. This calculator is about numbers. If you want to turn words into binary, use the binary translator, or paste binary into the binary to text converter to read the message.

Binary arithmetic examples
Binary Decimal check
1 + 1 = 10 1 + 1 = 2
1011 + 110 = 10001 11 + 6 = 17
1010 – 11 = 111 10 – 3 = 7
101 × 11 = 1111 5 × 3 = 15
1101 ÷ 10 = 110 remainder 1 13 ÷ 2 = 6 remainder 1
10101010 + 11001100 = 101110110 170 + 204 = 374
11001100 AND 10101010 = 10001000 204 AND 170 = 136
How it works

How to use the binary calculator

Four steps, and the answer updates as you type.

01

Pick a mode

Arithmetic adds, subtracts, multiplies and divides. Bitwise runs AND, OR, XOR, NOT and shifts. Convert changes binary to decimal or decimal to binary.

02

Type your numbers

Use only 0 and 1. Leading zeros, spaces, underscores and a 0b prefix are fine. Tap the plus-minus button or type a minus sign for a negative number. Any other digit is named in a message.

03

Read the result

The answer appears in binary, decimal, hexadecimal and octal. Pick 8, 16, 32 or 64 bits to see the two’s complement pattern and whether the result overflows.

04

Follow the working

Open Show the working to see the carries, borrows, partial products, long-division table or place values. Copy the result, send it on as the next A, or share a link.

Reference

Binary arithmetic rules and tables

The single-bit rules behind every answer, plus the tables people look up most.

Single-bit rules for add, subtract and multiply
A and B A + B A – B A × B
0 and 0 0 0 0
0 and 1 1 1 (borrow 1 from the left) 0
1 and 0 1 1 0
1 and 1 10 (write 0, carry 1) 0 1
Powers of two
Power Decimal Binary
20 1 1
21 2 10
22 4 100
23 8 1000
24 16 10000
25 32 100000
26 64 1000000
27 128 10000000
28 256 100000000
29 512 1000000000
210 1,024 10000000000
211 2,048 100000000000
212 4,096 1000000000000
213 8,192 10000000000000
214 16,384 100000000000000
215 32,768 1000000000000000
216 65,536 10000000000000000
Binary 0 to 15 in decimal, octal and hexadecimal
Binary Decimal Octal Hexadecimal
0000 0 0 0
0001 1 1 1
0010 2 2 2
0011 3 3 3
0100 4 4 4
0101 5 5 5
0110 6 6 6
0111 7 7 7
1000 8 10 8
1001 9 11 9
1010 10 12 A
1011 11 13 B
1100 12 14 C
1101 13 15 D
1110 14 16 E
1111 15 17 F
Number range by bit width
Bits Signed (two’s complement) Unsigned
8 -128 to 127 0 to 255
16 -32,768 to 32,767 0 to 65,535
32 -2,147,483,648 to 2,147,483,647 0 to 4,294,967,295
64 -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 0 to 18,446,744,073,709,551,615
Comparison

How this binary calculator compares

Most online binary calculators stop at an answer. This one is built to explain it.

This calculator and a typical basic binary calculator
Feature This calculator Typical basic calculator
Shows the working Carries, borrows, partial products, a long-division table and place values Often the final answer only
Division Quotient and remainder, with the steps Often a single result
Negative numbers Minus sign or the plus-minus button, with the sign rules explained Often unsupported or not explained
AND, OR, XOR, NOT and shifts Same page, in 8, 16, 32 or 64 bits or an automatic width Usually a separate tool
Two’s complement Pick a width and see the pattern, the signed and unsigned values and any overflow Usually a separate tool
Number length Up to 4,096 digits, calculated exactly Often a limit that is not stated
Updates As you type, with no Calculate button Some need a Calculate button
Reuse and sharing Result becomes the next A in one tap, and a share link keeps your inputs Rarely
Use cases

What people use a binary calculator for

Computer science homework

Work a problem by hand, then compare every carry, borrow and partial product with the steps shown here.

Digital logic and CPU basics

See how an adder carries from column to column, how AND, OR and XOR combine bits, and what overflow looks like in 8 bits.

Bit masks and flags

Test a mask with AND, set a flag with OR, toggle one with XOR, and check which bits a shift drops before you write the code.

Registers and embedded work

Check 8, 16, 32 and 64-bit values in binary, decimal, hexadecimal and octal side by side, with the two’s complement reading.

Subnet mask practice

Applying a subnet mask to an address is a bitwise AND, so you can practise it one octet at a time with two 8-bit values.

Exam practice

Rehearse negative numbers in two’s complement and check long division with a remainder against a worked, step-by-step answer.

Good to know

Things worth knowing about binary math

A few details explain most surprises. Binary is one of several ways to write a number: the Morse code translator shows another code, and the calculators page lists the rest of our calculators.

  • Leading zeros do not change the value

    0001011 and 1011 are both 11. The result is shown without padding unless you choose a width or group the digits into nibbles or bytes.

  • Division gives a quotient and a remainder

    The quotient is a whole number, cut toward zero, so -1101 ÷ 10 is -110 with remainder -1. The remainder takes the sign of A.

  • The signed range is lopsided

    In 8 bits the signed range is -128 to 127. The most negative value has no positive twin, so negating -128 gives -128 again.

  • Bitwise results depend on the width

    NOT 00110101 is 11001010 in 8 bits but has 32 digits in 32 bits. Auto picks the smallest of 8, 16, 24 bits and so on that fits your numbers.

  • Two kinds of right shift

    A logical shift fills the left with zeros. An arithmetic shift copies the sign bit, so negative numbers stay negative and the result is rounded down.

  • Private and mostly offline

    Your browser does the maths and nothing is sent to a server. After the page has loaded it usually keeps working without a connection.

Limits

What this binary calculator does not do

Whole numbers only

There are no binary fractions or floating-point numbers. For fractions written in decimal, the fraction calculator is the better fit.

Integer division

Division returns a whole-number quotient and a remainder, so 1 ÷ 11 is 0 with remainder 1 rather than a binary point.

Size caps

Each number can have up to 4,096 digits. Column working is shown up to 128 digits for add and subtract and 64 for multiply and divide, and the answer above it stays exact.

Sources

Where the facts come from

The rules and ranges on this page come from these references. The calculator follows them, and the examples above were checked by hand in decimal.

FAQ

Binary calculator FAQ

Short answers to what people ask most.

How do you add binary numbers?

Add column by column from the right using 0 + 0 = 0, 0 + 1 = 1 and 1 + 1 = 10, which writes 0 and carries 1 into the next column. For example, 1011 + 110 = 10001, which is 11 + 6 = 17 in decimal.

How do you subtract binary numbers?

Subtract column by column from the right. When a column needs 0 – 1, borrow a 1 from the column on its left, which is worth 2 in the column you are working on. For example, 1010 – 11 = 111, which is 10 – 3 = 7.

How do you multiply binary numbers?

Write the first number shifted left once for every 1 in the second number, counting from the right, then add those rows. For example, 101 × 11 = 1111, which is 5 × 3 = 15.

How do you divide binary numbers?

Use long division: bring down bits one at a time, subtract the divisor whenever it fits and write a 1 in the quotient, otherwise write a 0. For example, 1101 ÷ 10 = 110 with remainder 1, which is 13 ÷ 2 = 6 remainder 1.

What is 1 + 1 in binary?

1 + 1 is 10 in binary, read as one-zero and not ten. It means 0 in the current column and a carry of 1 into the next column, and it equals 2 in decimal.

How do I convert binary to decimal?

Multiply each digit by the power of two for its place, counting from 2^0 on the right, and add the results. For example, 10101010 is 128 + 32 + 8 + 2 = 170.

How do I convert decimal to binary?

Divide the number by 2 again and again, write down each remainder, and read the remainders from last to first. For example, 170 gives the remainders 0, 1, 0, 1, 0, 1, 0, 1 from first to last, so the binary number is 10101010.

What is two’s complement?

Two’s complement is the usual way computers store negative whole numbers in a fixed number of bits. To get the negative of a number, flip every bit and add 1, so 6 is 00000110 and -6 is 11111010 in 8 bits.

What range does an 8-bit, 16-bit, 32-bit or 64-bit number cover?

Signed two’s complement covers -128 to 127 in 8 bits, -32,768 to 32,767 in 16 bits and -2,147,483,648 to 2,147,483,647 in 32 bits. In 64 bits it covers -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, and unsigned numbers run from 0 up to 255, 65,535, 4,294,967,295 and 18,446,744,073,709,551,615.

What do AND, OR, XOR and NOT do?

AND gives 1 only where both bits are 1, OR gives 1 where at least one bit is 1, and XOR gives 1 where the bits differ. NOT flips every bit inside the chosen width, so NOT 00110101 is 11001010 in 8 bits.

Can it handle negative numbers and very long binary numbers?

Yes. Type a minus sign or tap the plus-minus button, and use up to 4,096 digits per number because the maths uses exact whole-number arithmetic. Division gives a whole-number quotient and a remainder, with no binary fractions.

Is this the same as a binary translator?

No. This calculator does maths on binary numbers, while a binary translator turns letters and words into the binary codes of their characters. For text, use the binary translator or the binary to text converter on this site.