Binary Calculator

Binary arithmetic uses base 2 (0 and 1). Addition: 1+1=10 (carry). Two's complement represents negatives: invert bits, add 1. Example: -5 in 8-bit = 11111011. Each bit position is a power of 2.

Perform arithmetic and bitwise operations on binary numbers. Add, subtract, multiply, divide, AND, OR, XOR, NOT.

Enter Binary Numbers

Binary Operations

  • AND (&): 1 only if both bits are 1
  • OR (|): 1 if either bit is 1
  • XOR (^): 1 if bits are different
  • NOT (~): Flips all bits

How to Use

  1. Enter your value in the input field
  2. Click the Calculate/Convert button
  3. Copy the result to your clipboard

Frequently Asked Questions

How do I add binary numbers?
Binary addition uses same rules as decimal with carrying. 0+0=0, 0+1=1, 1+0=1, 1+1=10 (0 carry 1). Example: 1011+1101: column by column from right: 1+1=10, 1+0+1=10, 0+1+1=10, 1+1+1=11. Result: 11000.
How do I subtract binary numbers?
Binary subtraction uses borrowing. 0-0=0, 1-0=1, 1-1=0, 0-1=1 (borrow from left). Or use two's complement: invert bits of subtrahend, add 1, then add. 1010-0110: subtract column by column or add two's complement of 0110.
How do I multiply binary numbers?
Binary multiplication is like decimal: multiply by each digit and shift. Since digits are only 0 or 1, each row is either 0000 or the number itself shifted. 1011×1101: write 1011 shifted appropriately for each 1 in 1101, then add.
What is two's complement?
Two's complement represents negative numbers in binary. To negate: invert all bits, add 1. In 8-bit: 5=00000101, -5=11111011. Range: -128 to +127 for 8 bits. The leftmost bit indicates sign (1=negative). Used in all modern computers.
How do I convert negative numbers to binary?
Convert the positive number to binary, then apply two's complement. For -7 in 8 bits: 7=00000111, invert=11111000, add 1=11111001. Verify: 11111001 as signed = -128+64+32+16+8+0+0+1 = -7.

Related Tools