Binary Calculator

Binary numbers use only 0 and 1. This calculator does arithmetic and bitwise operations on them and shows the answer in binary, decimal and hexadecimal.

Results update as you type.

Result (binary)

1 0001

Result in decimal
17
Inputs in decimal
11 + 6
Result in hex
11

About this calculator

Very long numbers are handled exactly.

How to use it

  1. Enter the first binary number.
  2. Choose the operation.
  3. Enter the second number.

The formula

Each binary digit is worth 2 raised to its position from the right
AND, OR, XOR
bitwise operations

Worked example

1011 + 110

  1. 1011 is 11 and 110 is 6.
  2. 11 + 6 = 17 = 10001 in binary.

What the result means

Division gives the whole-number quotient and the remainder.

Binary, hex and octal for 0 to 15

Four binary digits cover 0 to 15, which is one hex digit. Learn this table and most conversions become look-ups.

The 16 four-bit values
DecimalBinaryHexOctal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000810
91001911
101010A12
111011B13
121100C14
131101D15
141110E16
151111F17

More worked examples

  • Multiplication: 1011 × 110 = 100 0010, which is 11 × 6 = 66, or 42 in hex. Binary multiplication is shift and add: 1011 shifted once plus 1011 shifted twice.
  • Subtraction with a borrow: 10001 − 110 = 1011, that is 17 − 6 = 11.
  • Masking with AND: 10110110 AND 00001111 keeps only the lowest four bits and gives 110, which is 6. The leading zeros of 0110 are dropped in the answer.
  • Flipping bits with XOR: 11001010 XOR 11111111 = 11 0101, which is 53. XOR with all 1s inverts every bit.

Where people go wrong

  • Subtracting a larger number gives a negative answer with a minus sign: 110 − 1011 = −101 (−5). It is not shown in two’s complement.
  • AND, OR and XOR work bit by bit, so line the numbers up from the right.

Assumptions

  • Non-negative inputs for bitwise operations.

Limitations

  • Two’s complement is not shown.

Frequently asked questions

How do I add binary numbers?

Add column by column; 1 + 1 = 10, so write 0 and carry 1.

What is 1011 in decimal?

11.

What does XOR do?

Gives 1 where the bits differ.

What is 1 + 1 in binary?

10, which is 2 in decimal. You write 0 and carry 1 to the next column.

What is 255 in binary?

1111 1111, eight 1s. It is the largest number that fits in one byte.

How do I subtract binary numbers?

Work from the right. When you take 1 from 0, borrow from the next column, so the 0 becomes 10 (two) and 10 − 1 = 1.

Last reviewed on 12 October 2026. How we calculate and check. Found a mistake? Tell us.