Calculate bitwise AND, OR, XOR, and shifts on large integers. Enter hexadecimal, binary, octal, or decimal values.
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.