Home / Binary Calculator

Binary Calculator

Add, subtract, multiply, and divide binary numbers, and convert between binary, decimal, octal, and hexadecimal in one free tool. Every result shows both the binary answer and its decimal value, so you can check your homework, debug code, or learn how base 2 arithmetic works without guessing.

Try it now: 1010 plus 1100 equals 10110, which is 22 in decimal. The worked examples below walk through each operation step by step.

100% FreeNo sign-upInstant results

Your information is not stored. Calculations are done in your browser.

Binary result
10110

Decimal value: 22

Bit length: 5 bits

1010 (10) + 1100 (12) = 10110 (22). Bit length counts the digits of the binary result, without any minus sign.

Advanced options

Bit length is already included in the result above. Open this panel for the base converter, bitwise operations, and two’s complement.

Base converter

Binary: 101101 | Decimal: 45 | Octal: 55 | Hexadecimal: 2D

Bitwise operations

Result: 1000 (decimal 8). Example: 1100 AND 1010 = 1000.

Two’s complement

Two’s complement is how computers store negative integers. In 8 bits, -5 is stored as 11111011. Enter a negative decimal value to see its stored form.

8-bit two’s complement of -5: 11111011

Key takeaways

  • 1010 + 1100 = 10110 (22). Convert each binary number to decimal (10 and 12), add them (22), and convert back to binary.
  • 1010 x 101 = 110010 (50). Binary multiplication follows the same shift-and-add pattern as decimal multiplication.
  • 101101 in binary is 45 in decimal, 55 in octal, and 2D in hexadecimal. One value, four bases, all shown by the converter above.
  • Bitwise AND keeps only shared 1 bits: 1100 AND 1010 = 1000 (8). OR keeps a 1 where either side has one (1110, or 14), and XOR keeps a 1 only where the bits differ (0110, or 6).

Contents

Hexadecimal Calculator

Hex arithmetic and base 16 conversions.

Scientific Calculator

Advanced math, powers, and roots.

Decimal Calculator

Everyday decimal arithmetic.

Complete guide to binary arithmetic

How binary numbers work

Binary is base 2, so every digit is 0 or 1 and each position is worth twice the one to its right. The binary number 10110 means 16 + 0 + 4 + 2 + 0 = 22. Reading from right to left, the place values are 1, 2, 4, 8, 16, 32, and so on. That is why binary is the natural language of computers: each digit maps directly to a switch that is off (0) or on (1).

Binary addition and subtraction rules

OperationRuleExample
0 + 00, no carry0
0 + 1 or 1 + 01, no carry1
1 + 10, carry 1 to the next column10
1 + 1 + 1 (with carry)1, carry 1 to the next column11
0 – 1Borrow 1 from the next column, giving 10 – 1 = 11

Worked addition, 1010 + 1100: add column by column from the right. 0 + 0 = 0. 1 + 0 = 1. 0 + 1 = 1. 1 + 1 = 0 with a carry of 1, which becomes the leading digit. The result is 10110, and 10110 in decimal is 22, matching 10 + 12.

Worked subtraction, 1101 – 101: 13 minus 5 is 8, and 8 in binary is 1000. If the second number is larger, the result is negative: 101 – 1101 = -1000, which is -8 in decimal.

Binary multiplication and division

Multiply exactly as in decimal, but simpler: every partial product is either the number itself (times 1) or zero (times 0). Worked example: 1010 x 101. 1010 x 1 = 1010, 1010 x 0 = 0 shifted one place, and 1010 x 1 = 1010 shifted two places, giving 101000 plus 1010, which totals 110010, or 50 in decimal (10 x 5).

Division works the same way: 1100 / 10 = 110, because 12 / 2 = 6. When division is not exact, this calculator shows the whole-number quotient plus the remainder, for example 1101 / 10 = 110 with remainder 1, since 13 / 2 = 6 remainder 1.

Converting between bases

To convert binary to decimal, add the place values of the 1 digits: 101101 = 32 + 8 + 4 + 1 = 45. To convert decimal to binary, repeatedly divide by 2 and read the remainders upward: 45 gives remainders 1, 0, 1, 1, 0, 1, read upward as 101101.

Octal groups binary digits in threes from the right (101 101 = 55), and hexadecimal groups them in fours (0010 1101 = 2D, where the letters A through F stand for 10 through 15). That grouping trick is why programmers often write binary values in hex: 11111111 is just FF.

Bitwise operations, explained

Bitwise operations compare two numbers bit by bit. AND outputs 1 only where both bits are 1, so 1100 AND 1010 = 1000. OR outputs 1 where either bit is 1, so 1100 OR 1010 = 1110. XOR outputs 1 only where the bits differ, so 1100 XOR 1010 = 0110, which is 6 in decimal. Programmers use these to test flags, mask bits, and toggle settings.

Two’s complement and negative numbers

Computers store a negative number by inverting its bits and adding 1. In 8 bits, 5 is 00000101, inverted is 11111010, plus 1 is 11111011, which is how -5 is stored. The same idea works at 16 bits, where -5 becomes 1111111111111011. The first bit acts as the sign bit: 1 means negative in a signed value.

Common mistakes

  • Using digits other than 0 and 1. A binary input may contain only 0 and 1. The digit 2, or any letter, is invalid, and the calculator shows an error instead of guessing.
  • Forgetting the final carry. 1 + 1 in the leftmost column creates a new digit. Dropping it turns 10110 into 0110 and loses 16.
  • Reading binary left to right as place values. Place values grow to the left, so the rightmost digit is always the 1s place.
  • Mixing up bit length and value. 1000 and 01000 have the same value (8) but different bit lengths (4 versus 5).

How it works in 3 steps

  1. Enter two binary numbers. Type only 0s and 1s, then pick add, subtract, multiply, or divide.
  2. Press Calculate Binary Result. The page shows the binary answer, its decimal value, and its bit length, and scrolls you straight to the result.
  3. Convert or compare. Open Advanced options to convert a value between bases, run a bitwise operation, or see a two’s complement form.

Bitwise operations: AND, OR, and XOR as switches

Bitwise operations compare two numbers bit by bit, and each operation is a switch rule. AND outputs 1 only where both bits are 1, so 1100 AND 1010 is 1000: it keeps only the bits the two numbers share, and it is used to test flags and to mask bits, keeping the bits of interest and clearing the rest. OR outputs 1 where either bit is 1, so 1100 OR 1010 is 1110: it sets bits, turning on every bit that is on in either number, and it is used to combine flag sets. XOR outputs 1 only where the bits differ, so 1100 XOR 1010 is 0110: it toggles bits, flipping every bit that differs, and it is used to toggle settings and, in cryptography, to combine a message with a key. The three operations, with NOT, which inverts every bit, are the complete set from which all other bitwise logic is built, and the calculator bitwise panel applies all three to any two binary inputs entered.

Read a bitwise result as a set of switches, not as a number, until the decimal value is needed: 1000 is 8 in decimal, but its meaning as an AND result is that only the eights bit is shared, and the decimal value is secondary. Masks make the switch reading concrete: AND with 00001111 keeps the low four bits and clears the high four, whatever they were, which is how a program extracts a field from a packed value, and OR with 00001000 sets the eights bit without touching the others, which is how a program turns on one option in a set. The companion guide works addition, subtraction, and two complement in full, with the sign and overflow rules; this section completes the calculator panel, so every control on the page has its explanation on the page, in the same plain style as the guide above.

Frequently asked questions

What is 1010 + 1100 in binary?

1010 + 1100 = 10110. In decimal that is 10 + 12 = 22, and 22 written in binary is 10110.

How do I convert binary to decimal?

Add the place values of the 1 digits. For 101101, that is 32 + 8 + 4 + 1 = 45. The converter in the Advanced options panel does this instantly for binary, octal, decimal, and hexadecimal.

How do I convert decimal to binary?

Divide by 2 repeatedly and read the remainders from bottom to top. For 45, the remainders are 1, 0, 1, 1, 0, 1, which read upward as 101101.

What is 1010 times 101 in binary?

1010 x 101 = 110010, which is 50 in decimal (10 x 5). Multiply as in decimal, but every partial product is either the number itself or zero.

What does bitwise AND do?

Bitwise AND compares two numbers bit by bit and outputs 1 only where both bits are 1. For example, 1100 AND 1010 = 1000, which is 8 in decimal.

What is two’s complement?

Two’s complement is the standard way computers store negative integers: invert the bits and add 1. In 8 bits, -5 is stored as 11111011. The calculator above shows the two’s complement form for any decimal value at 8 or 16 bits.

How does subtraction work with two complement?

By adding: A minus B is computed as A plus the two complement of B, discarding the overflow bit. For example, 13 minus 5 is 00001101 plus 11111011, which is 100000000, discarding the overflow bit to leave 00001000, or 8. One adder circuit serves both addition and subtraction this way, which is why computers store negatives in two complement.

What is overflow in binary addition?

Overflow is a result that does not fit the fixed width, detected by the sign rule: adding two positives and getting a negative, or adding two negatives and getting a positive, proves overflow. In 8-bit signed arithmetic the range is -128 to +127, so adding 1 to 127 wraps to -128. Adding a positive and a negative can never overflow, because the result lies between the inputs.

What is the difference between bitwise AND, OR, and XOR?

AND outputs 1 only where both bits are 1, OR outputs 1 where either bit is 1, and XOR outputs 1 only where the bits differ. For 1100 and 1010, AND is 1000 (8), OR is 1110 (14), and XOR is 0110 (6). AND tests and masks bits, OR sets bits, and XOR toggles bits, and together with NOT they build all bitwise logic.

More related tools

Percentage Calculator

Percentages, increases, and decreases.

Fraction Calculator

Add, subtract, and simplify fractions.

Scientific Calculator

Advanced math in one place.

Binary Addition and Subtraction: 2’s Complement Explained

Addition, subtraction, and two complement, column by column, with range and overflow rules.

Disclaimer

This Binary Calculator is for general educational use only. Results are computed in your browser from the values you enter. It is not a substitute for professional advice, and CalcFolk is not responsible for decisions made from its outputs.