ToolNimba

๐Ÿ”ข Binary Calculator: Add, Subtract, Multiply and Divide

By ToolNimba Math Team ยท Updated 2026-06-25

Result (binary)
-
Result (decimal)
-
First in decimal
-
Second in decimal
-

Enter two binary numbers (digits 0 and 1 only) and choose an operation.

A binary calculator lets you add, subtract, multiply and divide numbers written in base 2 (the 0s and 1s computers use) without converting them by hand. Type two binary numbers, choose an operation, and this tool shows the answer in both binary and decimal so you can check your working. It is handy for students learning number systems, programmers debugging bit-level logic, and anyone curious about how computers do arithmetic under the hood.

What is the Binary Calculator?

Binary is a base-2 positional number system: every digit (called a bit) is either 0 or 1, and each position is worth twice the one to its right. So the binary number 1011 means 1x8 + 0x4 + 1x2 + 1x1 = 11 in decimal. This is exactly how digital circuits store and process numbers, because a single wire can easily represent two states (off or on), and stringing wires together represents larger values. By contrast, the decimal system you use every day is base 10, where each position is worth ten times the one to its right.

Arithmetic in binary follows the same rules as decimal, just with only two digits to carry between. In addition, 1 + 1 equals 0 carry 1, so 1 + 1 = 10 in binary, and 1 + 1 + 1 = 11 (a 1 in this column and a 1 carried). Subtraction borrows in the same way: when you cannot take a larger bit from a smaller one, you borrow 1 from the next column, which is worth 2 in the current column. Multiplication is a series of shifts and adds, because multiplying by 2 simply shifts every bit one place to the left, and division works by repeated subtraction, just like long division in decimal.

Doing this fully by hand is error prone, so this calculator takes a reliable shortcut: it converts each binary input to a decimal whole number, performs the operation, and converts the answer back to binary. The conversion uses the same logic browsers and most programming languages use internally. The input string is read with a base-2 parser (the equivalent of parseInt(value, 2)) to get a decimal integer, the chosen operation runs on those integers, and the result is rendered back with a base-2 formatter (the equivalent of value.toString(2)). Because the intermediate value is a normal integer, the result is exact for any whole numbers within the safe integer range, and division returns the integer quotient with the remainder noted separately.

Plain binary, sometimes called unsigned binary, can only represent zero and positive whole numbers. To store negative values, computers use a scheme called two's complement, where the leftmost bit acts as a sign: 0 marks a positive number and 1 marks a negative one. To find the two's complement of a number, you invert every bit (turn each 0 into 1 and each 1 into 0) and then add 1. The clever part is that once numbers are stored this way, ordinary binary addition handles subtraction automatically, which is why processors use a single adder circuit for both. This calculator works with signed decimal values, so a subtraction that goes below zero is shown with a minus sign rather than as a raw two's complement pattern, but the reference and FAQ sections below explain how to read and build those patterns yourself.

Understanding binary also makes sense of the units that measure digital storage. A single bit holds one 0 or 1; four bits form a nibble, which maps neatly to one hexadecimal digit; and eight bits form a byte, the most common building block, able to represent 256 different values from 0 to 255. Larger units such as the kilobyte and megabyte build on these, and many computing limits (256 colors, 65,536 rows, the 32-bit and 64-bit labels on software) are simply powers of two in disguise. The place-value and units tables further down turn these abstract ideas into a quick lookup you can keep beside your work.

Whether you are a computer science student checking homework, an electronics learner studying logic gates, or a developer reasoning about bit masks and flags, this binary calculator removes the tedious manual conversion so you can focus on understanding the result. Every answer is shown in both binary and decimal, so you always have a familiar number to sanity-check against the base-2 output.

When to use it

  • Checking binary homework or exam answers in a computer science or digital electronics course.
  • Quickly summing or differencing register values, masks or flags while debugging low-level code.
  • Teaching how positional notation and carrying work when the base is 2 instead of 10.
  • Converting a binary arithmetic result straight into decimal to sanity-check it against a calculator.
  • Learning how two's complement represents negative numbers before tackling signed arithmetic by hand.
  • Reasoning about storage sizes by relating bits, nibbles and bytes to the powers of two they stand for.

How to use the Binary Calculator

  1. Type your first binary number using only the digits 0 and 1.
  2. Type your second binary number the same way.
  3. Choose an operation: add, subtract, multiply or divide.
  4. Read the result shown in both binary and decimal, with each input echoed in decimal below.
  5. For subtraction that goes negative, note the minus sign and check the magnitude in the decimal output.

Formula & method

Each binary input is converted to decimal as the sum of digit x 2^position (rightmost position is 0). The chosen operation runs on the two decimal integers, then the result is converted back to binary. Example: 1011 = 1x2^3 + 0x2^2 + 1x2^1 + 1x2^0 = 11.

Worked examples

Add the binary numbers 1010 and 11.

  1. Convert 1010 to decimal: 1x8 + 0x4 + 1x2 + 0x1 = 10
  2. Convert 11 to decimal: 1x2 + 1x1 = 3
  3. Add in decimal: 10 + 3 = 13
  4. Convert 13 back to binary: 8 + 4 + 1 = 1101

Result: 1010 + 11 = 1101 in binary (decimal 13)

Multiply the binary numbers 110 and 11.

  1. Convert 110 to decimal: 1x4 + 1x2 + 0x1 = 6
  2. Convert 11 to decimal: 1x2 + 1x1 = 3
  3. Multiply in decimal: 6 x 3 = 18
  4. Convert 18 back to binary: 16 + 2 = 10010

Result: 110 x 11 = 10010 in binary (decimal 18)

Divide the binary number 1111 by 11.

  1. Convert 1111 to decimal: 8 + 4 + 2 + 1 = 15
  2. Convert 11 to decimal: 2 + 1 = 3
  3. Divide in decimal: 15 / 3 = 5 with remainder 0
  4. Convert the quotient 5 back to binary: 4 + 1 = 101

Result: 1111 / 11 = 101 in binary (decimal 5), remainder 0

Subtract a larger number from a smaller one: 101 minus 1010.

  1. Convert 101 to decimal: 4 + 1 = 5
  2. Convert 1010 to decimal: 8 + 2 = 10
  3. Subtract in decimal: 5 - 10 = -5
  4. Convert the magnitude 5 back to binary: 4 + 1 = 101, then keep the minus sign

Result: 101 - 1010 = -101 in binary (decimal -5)

Binary, decimal and place values for the numbers 0 to 16

DecimalBinarySum of place values
000
111
2102
3112 + 1
41004
51014 + 1
61104 + 2
71114 + 2 + 1
810008
910018 + 1
1010108 + 2
1211008 + 4
1511118 + 4 + 2 + 1
161000016

The four single-bit addition results (with carry)

Bit ABit BSum bitCarry
0000
0110
1010
1101

Powers of two and common digital storage units

BitsPower of 2ValuesCommon name
12^12Bit
42^416Nibble (one hex digit)
82^8256Byte (0 to 255)
102^101024Kibi unit base (1 KiB)
162^166553616-bit word
322^324.29 billion32-bit integer range

Common mistakes to avoid

  • Typing digits other than 0 and 1. Binary only uses 0 and 1. A stray 2 or a letter is not a valid binary number, so the calculator asks you to remove it rather than guess what you meant.
  • Reading binary positions left to right. The rightmost bit is the smallest (worth 1), and each step left doubles the value. Reading 1000 as "one thousand" instead of 8 is the most common slip.
  • Expecting a fractional answer from division. This tool does whole-number (integer) division, so 1111 / 10 gives the quotient and notes the remainder separately. It does not produce binary fractions after a point.
  • Forgetting that subtraction can go negative. If the second number is larger, the result is negative. The calculator shows a minus sign and the binary of the magnitude, since plain binary has no built-in sign.
  • Confusing two's complement with a plain minus sign. Computers store negatives as two's complement bit patterns, not as a minus symbol. To find that pattern by hand you invert every bit and add 1, which is not the same as just writing a dash in front.
  • Mixing up kilobytes (1000) with kibibytes (1024). Powers of two give 1024, the binary kibibyte, while the decimal kilobyte is 1000. Treating them as equal causes small but real errors in storage and memory calculations.

Glossary

Binary
A base-2 number system that represents values using only the digits 0 and 1.
Bit
A single binary digit, either 0 or 1. It is the smallest unit of digital information.
Nibble
A group of 4 bits, which can hold 16 values and maps exactly to one hexadecimal digit.
Byte
A group of 8 bits, able to represent 256 values (0 to 255). It is the most common storage unit.
Decimal
The everyday base-10 number system using the digits 0 through 9.
Carry
A value passed to the next higher position when a column sum is too large for one digit, for example 1 + 1 = 10.
Place value
The weight of a digit based on its position. In binary each position is a power of 2: 1, 2, 4, 8 and so on.
Quotient
The whole-number result of a division, before any remainder.
Two's complement
A way to store negative numbers in binary by inverting every bit and adding 1, with the leftmost bit acting as a sign.

Frequently asked questions

How does the binary calculator work?

It converts each binary number you type into a decimal integer, performs the operation you choose (add, subtract, multiply or divide) on those integers, then converts the answer back into binary. Both the binary and decimal results are shown so you can verify the conversion.

How do I add two binary numbers?

Enter both binary numbers, leave the operation set to Add, and the tool returns the sum. By hand you add column by column from the right, carrying a 1 whenever a column totals 2, since 1 + 1 = 10 in binary. For example, 1 + 1 + 1 in one column gives 1 with a 1 carried to the next.

How do I subtract binary numbers by hand?

Subtract column by column from the right. When the top bit is smaller than the bottom one, borrow 1 from the next column to the left, which is worth 2 in the current column, then continue. Many people instead add the two's complement of the second number, because that turns subtraction into a single addition.

What happens when I subtract a larger number from a smaller one?

The result is negative. The calculator shows a minus sign followed by the binary of the absolute value, because standard binary notation has no built-in sign bit. The decimal result also shows the negative value so it is easy to read.

What is two's complement and why is it used?

Two's complement is how computers store negative numbers. You invert every bit of the positive value and add 1, and the leftmost bit then signals the sign (1 for negative). It is used because ordinary binary addition then handles subtraction automatically, so a processor needs only one adder circuit for both.

How do I find the two's complement of a binary number?

Take the positive value in binary, flip every bit (each 0 becomes 1 and each 1 becomes 0), then add 1 to the result. For example, 6 is 0110, flipping gives 1001, and adding 1 gives 1010, which is -6 in four-bit two's complement.

How do I multiply binary numbers?

Binary multiplication works like decimal long multiplication but is simpler because each digit is 0 or 1. You shift the first number left for each 1 in the second number and then add the shifted rows together. This calculator does the same thing internally and gives the product instantly.

Does binary division give a fraction?

No. This calculator performs integer division, so it returns the whole-number quotient and tells you the remainder separately in binary. It does not produce a binary point or repeating fractional digits.

Is there a limit to how large the binary numbers can be?

Results are exact up to the safe integer limit (2^53). If an operation would exceed that, the tool tells you instead of showing a value that has lost precision. For everyday binary practice you are very unlikely to reach it.

Why show the decimal result alongside the binary one?

Decimal is easier to sanity-check at a glance, so seeing both lets you confirm the binary answer is right. It also helps when you are learning, by linking the unfamiliar binary form to a number you already recognise.