How to use the Binary Calculator
- Type the first number (A) and the second number (B). They're binary unless you change Numbers are in.
- Pick the operation: + − × ÷, AND, OR, XOR, or shift left or right by B places.
- Read the answer in every base. Division also shows the remainder.
Binary addition
Add column by column from the right, just like decimal: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (write 0, carry 1), and 1 + 1 + 1 = 11 (write 1, carry 1). Example: 1011 + 110 = 10001 (11 + 6 = 17).
Bitwise operations
| Operation | Result bit is 1 when… | Example |
|---|---|---|
| AND | both bits are 1 | 1100 AND 1010 = 1000 |
| OR | either bit is 1 | 1100 OR 1010 = 1110 |
| XOR | the bits are different | 1100 XOR 1010 = 0110 |
| Shift left << n | moves bits left, multiplying by 2ⁿ | 101 << 2 = 10100 |
| Shift right >> n | moves bits right, dividing by 2ⁿ | 10100 >> 2 = 101 |
AND is used to mask bits (keep only some), OR to set bits, and XOR to flip bits or compare two values.
Frequently asked questions
How do I subtract in binary?
Pick − and type both numbers. If the answer is negative it's shown with a minus sign. Computers store it in two's complement, which you can see with the Base Converter.
What happens when I divide?
You get the whole-number quotient and the remainder, like integer division in most programming languages.
Can I use hex?
Yes. Set Numbers are in to Hex or Decimal. Numbers you already typed are converted for you.