Introduction
This XOR calculator lets you quickly compute the XOR (exclusive or) of two or more values. XOR is a basic math operation used in computer science, cryptography, and data processing. It compares bits one by one — if two bits are different, the result is 1; if they are the same, the result is 0.
You can enter values in binary, octal, decimal, hexadecimal, or ASCII text. The calculator converts your inputs, XORs them together, and shows the result in every number format at once. It also gives you a clear, step-by-step solution so you can see exactly how the answer was found.
Use this tool to XOR hex strings, encrypt text with a simple key, check parity bits, or solve homework problems. Add as many operands as you need, load data from a file or URL, and copy or download your results with one click.
How to Use Our XOR Calculator
Enter two or more values into the operand fields, pick your settings, and this XOR calculator will show you the XOR result in binary, octal, decimal, hexadecimal, and ASCII — along with a full step-by-step solution.
Operand Inputs: Type or paste a value into each operand box. You start with two, but you can click Add Operand to XOR more values together. Click Remove to delete any extra operand you no longer need.
Input Base (Per Operand): Use the dropdown next to each operand to tell the calculator what format your value is in — Binary, Octal, Decimal, Hexadecimal, ASCII, or Auto Detect.
Delimiter: If you put more than one value inside a single operand box, pick the character that separates them — space, comma, semicolon, new line, or let Auto Detect figure it out.
Auto Cleanse Input: Check this box to automatically strip out spaces and invalid characters from your input before the calculation runs.
Auto Calculate: Check this box to get results instantly every time you change an input or setting. When it is off, you must click the Calculate button yourself.
Load from File / Load from URL: Instead of typing, you can load operand data from a text file on your device or fetch it from a web URL.
Input Base (Global Override): Set this to force every operand to use the same base format at once, or leave it on "Use Per-Input Settings" to control each operand separately.
Output Format: Choose whether to display the XOR result in all formats at the same time or in just one — Binary, Octal, Decimal, Hexadecimal, or ASCII.
Bit Width / Padding: Pick Auto to use the fewest bits needed, or choose 8-bit, 16-bit, 32-bit, or 64-bit to pad the binary and hex output to a fixed width.
Hex Byte Grouping: Choose how the hexadecimal output is spaced — no spaces, grouped in byte pairs, or grouped in 4-byte words.
Hex Case: Pick whether hex letters appear as uppercase (FF3A) or lowercase (ff3a).
Show Intermediate Calculation Steps: Check this box to display a table that shows the running XOR result after each operand is applied.
Calculate: Click this button to run the XOR operation and see your results, the step-by-step solution, and the intermediate steps table.
Example: Click this button to load a sample pair of values so you can see how the calculator works.
Clear All: Click this button to erase all inputs and results and start over.
Copy Result / Download Result: After you calculate, click Copy Result to copy the output to your clipboard or Download Result to save it as a text file.
What Is XOR?
XOR stands for "exclusive or." It is a basic operation used in math and computer science. XOR compares two pieces of data bit by bit. A bit is the smallest unit of data and is either a 0 or a 1. The rule is simple: if two bits are the same, the result is 0. If two bits are different, the result is 1.
| Bit A | Bit B | A XOR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
How XOR Works with Numbers
To XOR two numbers, you first convert them into binary (base 2). Then you line up their bits and compare each pair using the rule above. The result is a new binary number. You can then convert that result into other number systems like decimal, hexadecimal, or octal.
For example, take the decimal numbers 12 and 10. In binary, 12 is 1100 and 10 is 1010. XOR them bit by bit and you get 0110, which is 6 in decimal.
Where Is XOR Used?
XOR is used in many areas of computing. It plays a big role in encryption, where data is scrambled to keep it secret. It is also used in error checking and checksum generation, which helps detect mistakes when data is sent or stored. Storage systems like RAID use XOR to calculate parity data so files can be recovered if a drive fails. In networking, XOR operations appear in tasks such as subnet masking and IP address calculations. Programmers also use XOR for data comparison and swapping values without needing extra memory.
Number Systems You Can Use
This calculator lets you enter values in several number systems:
- Binary (Base 2) – Uses only 0 and 1.
- Octal (Base 8) – Uses digits 0 through 7. This is the same base used by tools like the chmod calculator for file permissions.
- Decimal (Base 10) – The standard number system we use every day.
- Hexadecimal (Base 16) – Uses digits 0–9 and letters A–F. Common in programming.
- ASCII (Text) – Each character is turned into its byte value before the XOR is applied.
XOR Properties
XOR has a few handy traits that make it useful:
- Self-inverse: If you XOR a value with the same value, you always get 0. (A ⊕ A = 0)
- Identity: Any value XORed with 0 stays the same. (A ⊕ 0 = A)
- Order does not matter: You can swap the inputs and still get the same result. (A ⊕ B = B ⊕ A)
- Grouping does not matter: When XORing three or more values, you can group them any way you like. ((A ⊕ B) ⊕ C = A ⊕ (B ⊕ C))
Because of the self-inverse property, XOR is reversible. If you XOR a message with a key, you can XOR the result with the same key to get the original message back. This is why XOR is at the heart of many encryption methods. For other bitwise and number-base operations, you can also try our modulo calculator or work with very large values using the big number calculator.