Binary Calculator

Binary uses only the digits 0 and 1, with each place worth a power of 2. 1010₂ = 8 + 0 + 2 + 0 = 10, and adding 1010 + 0110 gives 10000₂, which is 16 in decimal and 10 in hexadecimal. This calculator converts between bases and handles arithmetic and bitwise operations.

Inputs

Result
–

Results are calculated in your browser for convenience. Double-check important figures before relying on them.

How binary numbers work

Decimal uses ten digits, with place values 1, 10, 100 and so on. Binary uses two digits, with place values 1, 2, 4, 8, 16, 32 …. So 1101₂ = 8 + 4 + 0 + 1 = 13. To convert a decimal number to binary, divide by 2 repeatedly and read the remainders from bottom to top: 13 ÷ 2 = 6 r 1, 6 ÷ 2 = 3 r 0, 3 ÷ 2 = 1 r 1, 1 ÷ 2 = 0 r 1, which gives 1101.

DecimalBinaryHex
51015
101010A
161000010
25511111111FF

Binary arithmetic

  • Addition: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (write 0, carry 1). For 1010 + 0110: the result is 10000.
  • Subtraction: borrow as in decimal, so 10000 − 0110 = 1010.
  • Multiplication: shift and add. 101 × 11 = 1111 (5 × 3 = 15).
  • Division: long division in base 2. 1111 ÷ 10 = 111 remainder 1.

Bitwise operations

OperationRule1100 and 1010
AND1 only if both bits are 11000
OR1 if either bit is 11110
XOR1 if the bits differ0110
Shift left by nMultiply by 2ⁿ1 << 3 = 1000

Bitwise operations are used for flags, masks, permissions and low-level programming. For hexadecimal work try the hex calculator, and see the big number calculator for huge values.

Complete guide to the Binary Calculator

How to use the Binary Calculator, step by step

  1. Choose the base of the numbers you type.
  2. Enter the first number.
  3. Choose an operation and a second number.
  4. Read the result in every base.

Common mistakes to avoid

  • Typing a digit that is not valid in the base.
  • Mixing up bitwise AND with addition.
  • Forgetting that results can be negative.

Key terms explained

Bit
One binary digit.
Byte
Eight bits.
Bitwise
Working on each bit of a number.
Base
The number of digits in a number system.

Frequently asked questions

How do I convert binary to decimal?

Multiply each digit by its place value, a power of 2, and add. For 1101: 1×8 + 1×4 + 0×2 + 1×1 = 13.

How do I convert decimal to binary?

Divide by 2 repeatedly, noting each remainder, then read the remainders from last to first. For 13 this gives 1101.

What is 1 + 1 in binary?

1 + 1 = 10 in binary, which is two in decimal. You write 0 and carry 1 to the next place.

Why do computers use binary?

Electronic circuits have two stable states, on and off, which map neatly to 1 and 0. This makes binary reliable and simple to implement in hardware.

What is a bit and a byte?

A bit is one binary digit. A byte is 8 bits and can hold 256 different values, from 0 to 255.

How are negative numbers stored in binary?

Computers usually use two’s complement. This calculator shows negative results with a minus sign instead, which is simpler to read.

What is XOR used for?

XOR returns 1 when the bits differ. It is used in checksums, encryption, toggling flags and swapping values without extra storage.

Related calculators

Guides worth reading