Bitwise XOR calculator
Type a value into each operand field and the result updates as you type. Each field reads decimal, hexadecimal (0xFF), binary (0b10110010), and octal (0o377), and the two operands can use different bases. The result appears at once as unsigned decimal, hexadecimal, octal, and padded binary.
Example: 12 XOR 10
12 is 1100 in binary and 10 is 1010. XOR compares the two words bit by bit and keeps a 1 only where the bits differ, which gives 0110, or 6 in decimal. Enter 0b1100 and 0b1010 to check it.
Toggling bits
XOR flips a bit when the corresponding mask bit is 1 and leaves it unchanged when the mask bit is 0. That makes it the standard way to toggle a boolean flag without branching. XOR-ing a value with itself always produces zero, which is a common register-clearing trick in assembly.
Word size and signed output
Word size defaults to 32-bit and can be set to 8, 16, 64, or 128. Both operands are masked to that width before XOR runs, so a value that does not fit wraps. Signed output reads the same bits as a signed integer, which turns a 32-bit result of 4294967295 into -1. To apply a different operation to the same operands, use the full Bitwise Calculator.