XOR Binary Values Online
Perform a bitwise XOR operation on two binary numbers. Output is 1 when bits are different, 0 when the same.
Drop two binary numbers in, hit XOR, and get a bit-by-bit breakdown showing exactly where the inputs differ. Auto-padding handles unequal lengths, and decimal and hex equivalents appear alongside the result so you can cross-check your work. And everything runs in your browser. Nothing gets uploaded.
How to Use
Enter two binary values in the input fields above. Only 0s and 1s are accepted (spaces are stripped automatically).
Choose bit padding (Auto, 8-bit, 16-bit, or 32-bit) and toggle the decimal/hex/truth-table options as needed.
Click XOR to perform the bitwise XOR operation and see the result with a bit-by-bit visualization.
Copy the result to your clipboard, or click Sample to load example binary values.
Frequently Asked Questions
What is a bitwise XOR operation?
XOR (exclusive OR) compares each bit of two binary numbers. For each bit position, the result is 1 if the two bits are different, and 0 if they are the same. For example, 1100 XOR 1010 produces 0110, because the second and third bit positions have different values in the two inputs.
How is XOR used in programming?
XOR is one of the most versatile bitwise operations. It is used for toggling specific bits, swapping two variables without a temporary variable (a ^= b; b ^= a; a ^= b), simple encryption and checksums, detecting changes between two values, and generating parity bits for error detection in data transmission.
What is the difference between XOR and XNOR?
XOR outputs 1 when bits are different and 0 when they are the same. XNOR is the exact opposite -- it outputs 1 when bits are the same and 0 when they differ. XNOR is essentially NOT(XOR). If you invert every bit of an XOR result, you get the XNOR result.
What does bit padding do?
Bit padding ensures both binary values are displayed with the same number of bits. For instance, 8-bit padding shows all values as 8 digits (e.g., 00001100 instead of 1100). Auto mode pads both values to match the length of the longer input, rounding up to the nearest multiple of 4 for cleaner display.
Can I use this for values longer than 32 bits?
Yes. While the padding options offer 8, 16, and 32-bit presets, the Auto mode handles binary strings of any length. This tool processes strings directly rather than using native bitwise operators, so it works correctly for arbitrarily long binary values without any length limitation.