Binary Calculator

Perform binary arithmetic and bitwise operations with exact base-2 and decimal results.

Binary operations
Choose an operation and enter two unsigned binary integers.

About the binary calculator

A binary calculator works with numbers written in base two, the positional number system used by digital computers. Instead of ten decimal digits, binary notation uses only zero and one. Each position represents a power of two: the rightmost bit represents one, then two, four, eight, sixteen, and so on. For example, 1010 equals eight plus two, or ten in decimal. This tool keeps the input and primary result in binary while also displaying a decimal interpretation for verification. Arithmetic operations follow familiar rules adapted to base two. Addition carries when a column reaches two. Subtraction borrows one power of two from the next column. Multiplication forms shifted partial products because multiplying by a bit either contributes zero or an unchanged copy of the first operand. Integer division repeatedly compares and subtracts shifted divisors, producing a quotient and remainder. The calculator performs unsigned integer arithmetic and displays the complete result without imposing a fixed machine word size. Bitwise operations treat corresponding digits as logical values. AND produces one only when both bits are one. OR produces one when either or both bits are one. XOR produces one when the bits differ. If the inputs have different lengths, their leading sides are effectively padded with zeros. These operations are essential for masks, permissions, graphics, network protocols, embedded systems, cryptography, and efficient manipulation of packed data. The arithmetic and bitwise controls intentionally share the same inputs so related results are easy to compare. Given 1010 and 0011, addition returns 1101, AND returns 0010 without insignificant leading zeros, OR returns 1011, and XOR returns 1001. Multiplication returns 11110. Integer division of 1010 by 11 returns quotient 11 with remainder 1, corresponding to decimal ten divided by three. Subtraction in this calculator requires the first number to be at least as large as the second. That choice avoids silently assuming a signed representation. Negative binary numbers normally use a fixed-width convention such as two's complement, and the same bit pattern can mean different values at different widths. Likewise, division requires a nonzero divisor. The remainder is always nonnegative and smaller than the divisor. Exact arbitrary-length integer operations avoid floating-point rounding for large inputs, although extremely long strings can still be impractical for a browser interface. Leading zeros are accepted and do not affect numerical value. Fractional binary points are not supported. When modeling real hardware, select a word width separately and consider overflow or truncation, because processors often retain only a fixed number of low-order bits.

Binary operation examples

Examples cover arithmetic and bitwise operations.

OperationBinary resultDecimal check
1010 + 11110110 + 3 = 13.
101 × 1111115 × 3 = 15.
1100 AND 10101000Only the eight's-place bit is set in both values.
1100 XOR 1010110Bits that differ produce decimal 6.

How to use the binary calculator

  1. Choose an arithmetic or bitwise operation from the operation buttons.
  2. Enter the first binary integer using only zeros and ones.
  3. Enter the second binary integer, ensuring a divisor is not zero when dividing.
  4. Select Calculate and review the binary result, decimal result, and division remainder when applicable.

Binary calculator FAQ

What is the difference between arithmetic and bitwise operations?

Arithmetic treats each input as a complete integer and applies numerical rules. Bitwise operations compare aligned individual bits using Boolean logic.

How are inputs with different lengths aligned?

They are aligned on the right at the least significant bit. Missing leading positions behave as zeros for bitwise operations.

Why are negative subtraction results not supported?

A negative bit pattern requires a chosen signed representation and word width. Requiring a nonnegative result prevents an ambiguous interpretation.

What does the division remainder mean?

The dividend equals the divisor times the quotient plus the remainder. The remainder is always smaller than the nonzero divisor.

Can I use binary fractions?

This calculator supports unsigned whole numbers only. Binary fractions require tracking a radix point and different conversion rules.