Bitwise XOR Calculator
Calculate A ^ B online and identify the bit positions where the two input values are different.
46 Bin00101110 Hex0x2E 74 Bin01001010 Hex0x4A XOR Result
Bit-by-Bit Visualization
XOR Truth Table
Click a row to load values into A and B, or inspect how each gate behaves.
| Input A | Input B | XOR |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
How the Bitwise XOR Calculator Works
A bitwise XOR calculator returns 1 when two compared bits are different. XOR is useful for toggles, parity checks, checksums, and difference masks.
XOR Rule
The output bit is 1 when one input is 1 and the other input is 0.
Difference Mask
XOR highlights exactly where two binary values differ.
Toggle Bits
XOR with a mask flips selected bits while leaving other positions unchanged.
Parity Checks
Many parity and checksum routines use XOR because repeated equal bits cancel out.
Bitwise XOR Calculation Steps
Use these steps to calculate XOR without guessing.
Align Both Values
- Convert A and B to binary.
- Pad the shorter value with leading zeros.
- Keep columns aligned from right to left.
Mark Different Bits
- Write 1 when the two bits are different.
- Write 0 when the two bits match.
- Continue through every bit column.
Convert the Output
- Read the binary result.
- Convert it to decimal or hex.
- Use the value as a toggle or difference mask.
Bitwise XOR Examples
XOR examples show where two values differ.
| Input | Operation | Result | Use |
|---|---|---|---|
101110 ^ 1001010 | XOR | 1100100 | Difference mask |
1111 ^ 0101 | XOR | 1010 | Toggle selected bits |
0x2E ^ 0x4A | XOR | 0x64 | Hex difference |
46 ^ 74 | XOR | 100 | Decimal integer result |
Why Use This Bitwise XOR Calculator?
Use this XOR calculator to inspect binary differences, toggles, and parity behavior.
Binary Input Support
Enter values as binary strings and inspect how each bit contributes to the final answer.
Decimal and Hex Views
Compare the same result in decimal, binary, and hexadecimal without switching tools.
Visual Bit Diagram
Use the bit grid to see active bits, included zeros, leading zeros, and changed positions.
Configurable Width
Choose auto, 8-bit, 16-bit, 32-bit, or 64-bit output for programming-style results.
Practical Uses for Bitwise XOR
XOR is especially helpful when equal bits should cancel and different bits should stand out.
Masks and Flags
Build masks for permissions, settings, protocol fields, and low-level feature toggles.
Low-Level Debugging
Check bit patterns while reviewing firmware, embedded registers, or systems code.
Networking
Inspect headers, subnet masks, and packed fields that depend on bit-level operations.
Packed Values
Read color channels, compact identifiers, and integer fields stored inside one word.
Frequently Asked Questions
Find answers to common questions about bitwise operations and this online tool.