Big Number Calculator

Big Integer Bitwise Calculator

Calculate bitwise AND, OR, XOR, and shifts on large integers. Enter hexadecimal, binary, octal, or decimal values.

1 digits
Operation
Bitwise XOR: For programmers: keeps a 1 where exactly one of the numbers has a 1 in binary.
2 digits

How can I compare or move bits in integers larger than 32 bits?

This page treats whole numbers as bit patterns rather than as decimal quantities to be added. It initially selects XOR, which keeps a bit when the two corresponding input bits differ. You can switch to AND to keep their shared set bits, OR to combine their set bits, or a shift operation to move a pattern between bit positions. Decimal, hexadecimal, binary, and octal inputs can be mixed because their prefixes describe how to read the same integer value, not different kinds of arithmetic.

Method

The engine parses each operand to an arbitrary-size integer and applies the selected bitwise operation directly. For AND, OR, and XOR, the second operand is another pattern. For a shift, the second operand becomes a non-negative number of positions. A left shift moves bits toward more significant positions, corresponding to multiplication by a power of two. A right shift uses arithmetic sign extension, so negative values retain their sign information instead of receiving zero bits as though they were unsigned fixed-width words.

Reading the answer

The exact numeric result is shown in decimal in the worked examples, regardless of how the input operands were written. Use the calculator’s base views when you want to inspect the resulting hexadecimal or binary pattern. Leading zeroes in an entered mask do not establish a fixed word width. Negative operands follow unbounded two’s-complement semantics rather than an eight-bit, thirty-two-bit, or sixty-four-bit register model. If your application needs a specific register width, you must choose the corresponding mask deliberately before interpreting the output as that register.

Checks and boundaries

Fractional operands are not bit patterns for this tool, and negative shift counts are rejected. Large left shifts have a workload safeguard because they create increasingly long integers. A right shift is not interchangeable with integer division for all signed values: sign extension can move a negative result downward where division truncates toward zero. The worked examples show differing bits under XOR, low-bit retention under AND, and a shift beyond ordinary thirty-two-bit ranges. Check which operation is selected before pressing Calculate, because an identical pair of inputs can express very different tasks.

Worked examples

0xFF XOR 35

= 220

Interpret the hexadecimal mask and decimal operand as integers. XOR retains positions in which their bit values differ.

Calculation steps and checks
  1. First pattern in binary

    0xFF = 11111111

  2. Second pattern in binary

    35 = 100011

  3. Keep bits that differ between the patterns

    0xFF XOR 35 = 11011100

0xFF AND 0x0F

= 15

Compare the masks position by position. AND discards every set bit that is absent from the second mask.

Calculation steps and checks
  1. First pattern in binary

    0xFF = 11111111

  2. Second pattern in binary

    0x0F = 1111

  3. Keep bits present in both patterns

    0xFF AND 0x0F = 1111

1 << 100

= 1267650600228229401496703205376

Move the single set bit one hundred positions to the left. The displayed decimal integer is the exact shifted value.

Calculation steps and checks
  1. Each bit position contributes a factor of two

    2 ^ 100 = 1267650600228229401496703205376

  2. Multiply by that power of two

    1 × 1267650600228229401496703205376 = 1267650600228229401496703205376

Related calculators

See the accuracy checks and calculation methodology for independently specified test cases and known limits. To report a result that differs from your calculation, send the operation, both inputs, and the expected answer.