TXT · Text & Data tools

Bitwise XOR Calculator

Operand A
Operand B
expression

0x000000F0 XOR 0x0000000F = 0x000000FF

32-bit result

0000 0000 0000 0000 0000 0000 1111 1111

Unsigned decimal
255
Hexadecimal
0x000000FF
Octal
0o00000000377
Go to the full Bitwise Calculator

Bitwise XOR calculator

Apply XOR to two integers and read the result as unsigned decimal, hexadecimal, octal, and 32-bit padded binary. Both operands are masked to 32 bits before the operation runs.

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.

Fixed 32-bit word

This page runs XOR on a 32-bit unsigned word. Input accepts decimal, hexadecimal (0xFF), binary (0b10110010), and octal (0o377) automatically. For a different word size or signed output, use the full Bitwise Calculator.

Frequently Asked Questions

XOR (Exclusive OR) returns 1 only if the bits differ. It is widely used in cryptography, checksums, and toggling states because applying the same XOR operation twice restores the original value.

Yes. Executing `a ^= b; b ^= a; a ^= b;` swaps the values in languages that support in-place bitwise mutation, though it is usually less readable than using a temporary variable.

Because XOR is reversible. If you XOR your data with a key, you get ciphertext. XOR the ciphertext with the exact same key and you get your original data back.

Specific bitwise operations

Full Bitwise Calculator tool

Explore Our Tools

Browse all tools