Bitwise AND/OR/XOR Calculator
Calculate bitwise AND, OR, XOR, and NOT on two numbers - shows binary and decimal results, clearly distinct from logical operators.
Enter two numbers and choose a bitwise operation - this tool shows both operands' binary representation and the resulting binary/decimal value.
These are true bitwise operators (act on individual bits), not logical operators (&&, ||) which act on whole true/false values. JavaScript performs bitwise operations on 32-bit signed integers, so results are limited to that range.
Bitwise operators work on individual bits, unlike logical operators (&&, ||) which work on whole true/false values - this tool performs true bitwise operations, not logical ones.
Bitwise vs. Logical Operators
Bitwise AND/OR/XOR compare each corresponding bit position of two numbers independently - this is different from logical AND/OR, which treat each entire operand as a single true/false value. Mixing these up is a common source of bugs in real code.
How to Use It
- Enter two non-negative integers.
- Choose AND, OR, XOR, or NOT (which only needs one operand).
- View both operands in binary alongside the result, plus the decimal value.
Limitations
Calculations use JavaScript's native 32-bit bitwise operators, matching how bitwise operations behave in most programming languages for standard integer sizes - values requiring more than 32 bits aren't supported here, since bitwise semantics for arbitrary-precision integers vary by language/context.