Skip to main content

Calcu.fit

Binary Calculator: Add, Subtract, Multiply, Divide, and Convert Binary Numbers

Use this free binary calculator to do arithmetic on binary (base-2) numbers. You can add, subtract, multiply, and divide binary numbers, convert between binary, decimal, hexadecimal, and octal, find two’s complement, and use bitwise operations such as AND, OR, XOR, NOT, and shifts. The calculator shows the answer in binary and in decimal, with the steps. No signup needed.

How to Use This Binary Calculator

Arithmetic:

  1. Enter the first binary number (digits 0 and 1 only), such as 1011.
  2. Choose an operation: +, −, ×, or ÷.
  3. Enter the second binary number.
  4. Click Calculate.

Conversion:

  1. Enter a number and choose its type (binary, decimal, hexadecimal, or octal).
  2. The calculator shows the value in all the other bases.

Bitwise and two’s complement:

  1. Choose a bit width (4, 8, 16, or 32 bits).
  2. Enter your numbers and choose the operation.
  3. Click Calculate.

What You’ll See in Your Results

  • The answer in binary, and in decimal, hexadecimal, and octal
  • For division, the quotient and the remainder
  • Steps for the calculation
  • For signed results, the two’s complement form
  • A warning if the result overflows the chosen bit width
  • An error message if the input has a digit other than 0 or 1

What Is Binary?

Binary is a number system with only two digits, 0 and 1. It is also called base 2. Computers use binary because electronic circuits have two states, on and off.

In decimal (base 10), each place is worth 10 times the one to its right. In binary, each place is worth 2 times the one to its right.

Place value1286432168421
Power of 22⁷2⁶2⁵2⁴2³2²2¹2⁰

So the binary number 101101 means 32 + 8 + 4 + 1 = 45.

One binary digit is a bit. Eight bits make a byte.

Binary Arithmetic Rules

Addition

SumResult
0 + 00
0 + 11
1 + 01
1 + 110 (write 0, carry 1)
1 + 1 + 111 (write 1, carry 1)

Subtraction

DifferenceResult
0 − 00
1 − 01
1 − 10
0 − 11, with a borrow of 1 from the next place

Multiplication and Division

  • Multiplication works like decimal long multiplication, but each partial product is either 0 or a copy of the first number, shifted to the left.
  • Division works like decimal long division, with the divisor either fitting (1) or not fitting (0) at each step.

Binary Calculator Examples

Example 1: Binary Addition

1011 + 110

 
   1011   (11)
 +  110   (6)
 ------
  10001   (17)

Answer: 10001 (17 in decimal).

Example 2: Binary Subtraction

1101 − 101

 
   1101   (13)
 −  101   (5)
 ------
   1000   (8)

Answer: 1000 (8 in decimal).

Example 3: Binary Multiplication

101 × 11

 
     101   (5)
   ×  11   (3)
   -----
     101   (101 × 1)
    1010   (101 × 1, shifted left by 1)
   -----
    1111   (15)

Answer: 1111 (15 in decimal).

Example 4: Binary Division

1101 ÷ 11 (13 ÷ 3)

  • Quotient: 100 (4)
  • Remainder: 1 (1)

Check: 100 × 11 = 1100, and 1100 + 1 = 1101.

Example 5: A Longer Multiplication

10110 × 101 (22 × 5)

Answer: 1101110 (110 in decimal).

Example 6: A Division with No Remainder

11001 ÷ 101 (25 ÷ 5)

Answer: 101 (5), with a remainder of 0.

Example 7: Adding Until the Bits Roll Over

  • 1111 + 1 = 10000 (15 + 1 = 16)
  • 111 × 111 = 110001 (7 × 7 = 49)

Example 8: A Negative Result

101 − 1101 (5 − 13)

Answer: −1000 (−8 in decimal).

Example 9: Binary to Decimal

Add the place values where the digit is 1.

  • 101101 = 32 + 8 + 4 + 1 = 45
  • 11111111 = 255
  • 10000000 = 128

Example 10: Decimal to Binary

Divide by 2 again and again, and read the remainders from the bottom up.

For 45:

DivideQuotientRemainder
45 ÷ 2221
22 ÷ 2110
11 ÷ 251
5 ÷ 221
2 ÷ 210
1 ÷ 201

Reading upward: 101101.

More conversions:

  • 100 = 1100100
  • 255 = 11111111
  • 214 = 11010110

Example 11: Binary to Hexadecimal and Octal

Take 11010110.

  • Hexadecimal: group in 4s (1101 0110) → D 6 → D6
  • Octal: group in 3s from the right (011 010 110) → 3 2 6 → 326
  • Decimal: 214

Example 12: Binary Fractions

101.101 = 4 + 1 + 0.5 + 0.125 = 5.625

To convert 0.625 to binary, multiply by 2 and take the whole part each time: 0.625 × 2 = 1.25 (1), 0.25 × 2 = 0.5 (0), 0.5 × 2 = 1.0 (1). So 0.625 = 0.101.

Some decimal fractions, such as 0.1, repeat forever in binary (0.0001100110011…), which is one reason computers show tiny rounding differences.

Example 13: Two’s Complement (8 bits)

Two’s complement is how computers store negative integers.

To find −45 in 8 bits:

  1. Write 45 in 8 bits: 00101101
  2. Flip every bit: 11010010
  3. Add 1: 11010011

So −45 = 11010011.

More 8-bit examples:

  • −5 = 11111011
  • −1 = 11111111
  • −128 = 10000000
  • +127 = 01111111

Example 14: Subtraction with Two’s Complement

To compute 13 − 5 in 8 bits, add 13 and −5:

 
  00001101   (13)
+ 11111011   (−5)
----------
1 00001000   (carry out, ignore it)

The result is 00001000 = 8.

Example 15: Overflow

  • Unsigned 8-bit: 200 + 100 = 300, which does not fit in 8 bits (maximum 255). The stored result is 00101100 = 44, with a carry out.
  • Signed 8-bit: 100 + 100 = 200, which is more than +127. The stored result is 11001000, which reads as −56. This is a signed overflow.

Example 16: Bitwise Operations (4 bits)

With 1100 (12) and 1010 (10):

OperationResultDecimal
AND10008
OR111014
XOR01106

NOT flips each bit. In 8 bits, NOT 00001100 = 11110011.

Example 17: Bit Shifts

  • 0101 shifted left by 1 = 1010 (5 → 10, which doubles it)
  • 1100 shifted right by 2 = 0011 (12 → 3, which divides by 4)

Number Ranges by Bit Width

BitsUnsigned rangeSigned range (two’s complement)
40 to 15−8 to 7
80 to 255−128 to 127
160 to 65,535−32,768 to 32,767
320 to 4,294,967,295−2,147,483,648 to 2,147,483,647

Binary, Decimal, Hexadecimal Quick Table

DecimalBinaryHexOctal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000810
91001911
101010A12
111011B13
121100C14
131101D15
141110E16
151111F17

Where Binary Is Used

  • Computers and phones: all data is stored as bits
  • Programming: bitwise operations, flags, and masks
  • Networking: IP addresses and subnet masks
  • Digital electronics: logic gates and circuits
  • Text and images: each character or color is a binary number (for example, the letter A is 01000001, or 65)
  • Computer science courses: number systems and computer arithmetic

Common Mistakes

  • Using digits other than 0 and 1. In binary, a “2” is not allowed.
  • Forgetting to carry or borrow. 1 + 1 = 10 in binary.
  • Reading the bits in the wrong order. The leftmost bit is the most significant.
  • Ignoring the bit width. The same bits can mean different numbers when signed or unsigned. For example, 11111111 is 255 unsigned, but −1 in 8-bit two’s complement.
  • Forgetting overflow. A result that is too big for the bit width wraps around.
  • Mixing up ÷ and the remainder. Binary division can leave a remainder.

Tips for Using a Binary Calculator

  • Check the result by converting it to decimal.
  • Choose the right bit width before you use two’s complement or bitwise operations.
  • Remove spaces or add them in groups of 4 to make long numbers easier to read, such as 1101 0110.
  • Use hexadecimal as a short way to write long binary numbers.
  • Know whether your problem uses signed or unsigned numbers.
  • For learning, try the steps by hand and use the calculator to check.

Binary Calculator vs. Other Tools

  • Scientific Calculator: powers, roots, trig, logs, and more.
  • Exponent Calculator: powers of 2 and other exponents.
  • Fraction Calculator: add, subtract, multiply, and divide fractions.
  • Percent Error Calculator: how far a measurement is from the accepted value.
  • Hex Calculator: arithmetic with hexadecimal numbers.

Frequently Asked Questions (FAQ)

What is binary?

Binary is a number system that uses only the digits 0 and 1. It is base 2, and each place is worth twice the place to its right.

Add them column by column, from right to left, and carry 1 when a column adds up to 2 or more. For example, 1011 + 110 = 10001.

Subtract column by column and borrow from the next place when you need to. For example, 1101 − 101 = 1000. You can also add the two’s complement of the second number.

Write a partial product for each digit of the second number (0 or a copy of the first number, shifted left) and add them. 101 × 11 = 1111.

Use long division. At each step, the divisor either fits (1) or does not fit (0). 1101 ÷ 11 gives a quotient of 100 and a remainder of 1.

Add the place values (1, 2, 4, 8, and so on) wherever there is a 1. For example, 101101 = 32 + 8 + 4 + 1 = 45.

Divide by 2 repeatedly and read the remainders from the bottom up. For 45, the result is 101101.

Group the bits in fours from the right, and replace each group with a hex digit. 11010110 becomes 1101 0110, which is D6.

It is the standard way to store negative integers. To find the two’s complement of a number, flip all the bits and add 1. In 8 bits, −5 is 11111011.

Overflow happens when a result is too large for the number of bits. For example, 200 + 100 in 8-bit unsigned numbers gives 44 with a carry out.

They work on the individual bits of numbers. AND, OR, and XOR compare two numbers bit by bit, NOT flips every bit, and shifts move the bits left or right.

Yes. It is free, with no registration and no limits.

Binary arithmetic on integers is exact. Fractions may be rounded for display, since some decimal fractions repeat in binary.

Disclaimer

This calculator is for general and educational use. Integer results are exact within the range you choose, and fractional results may be rounded for display. Check important results yourself before using them for programming, hardware design, security, or graded work, and follow your teacher’s rules on notation and bit width.