XOR Calculator

Online calculator for bitwise XOR operation on text in ASCII or numbers in Binary, Octal, Decimal, & Hex formats.

Multiple input numbers (even greater than 2) are supported by applying bitwise operations successively on the intermediate results.

All processing happens on the client-side, locally in your browser. No data is uploaded.

Choose the base of the input numbers
Choose the delimiter used to separate each item
Binary ResultThe result of XOR operation in Binary
-
Octal ResultThe result of XOR operation in Octal
-
Decimal ResultThe result of XOR operation in Decimal
-
Hex ResultThe result of XOR operation in Hex
-
Ascii ResultThe result of XOR operation in Ascii
-
Input BaseThe base of the input numbers either explicitly specified or automatically detected
-

History

  • 2020-05-31Fixed input bit handling issue (thanks Paul Turner)
  • 2018-03-25Tool Launched

Settings explained

Input Base

Choose the base of the input numbers.

Auto Detect: the number base is detected from the input: binary when only 0s and 1s are used, decimal for other digits, hex for the letters A to F or a 0x, &h or $ prefix, and ASCII text for anything else. Octal is never guessed: choose it.

Binary (base 2)
1000 XOR 1111 = 0111
Octal (base 8)
1000 XOR 7777 = 6777
Decimal (base 10)
1000 XOR 9999 = 9447
Hex (base 16)
1000 XOR FFFF = EFFF
Ascii (base 256)
a XOR B = #
Delimiter

What separates each item. Auto Detect takes any space, new line, tab, comma or semi-colon; the others take only that one, so a new line delimiter keeps the spaces in text.

Auto Cleansing

The operator written between the items is skipped, as a word (XOR) or a symbol (^), and hex numbers run together (0x1F0x2A) are taken apart.

Calculate Intermediate Results

Shows each input and each result on the way in a table, in binary and in the input base. With more than two inputs, the operation is applied to the first two, then to that result and the next input, and so on.

Background

Reverse XOR Calculator

  1. Suppose you have two original binary numbers A and B
  2. You applied XOR on A and B to get C
  3. Now you want to reverse the XOR operation and want to obtain A
  4. For this, you will need B and C
  5. To find out A, just XOR B and C. Because XOR is it's own inverse, you will get A
  6. Similarly, to find out B, all you need to do is XOR A and C
  7. Example: XORing 1011 and 1100 gives 0111. Applying XOR on 1011 and 0111 returns 1100

About XOR Calculation

XOR is a digital logic gate that outputs true or 1 only when the two binary bit inputs to it are unequal i.e for an input of 0 & 1 or 1 & 0.

You can remember the above result using one of these logics too:-

  • Returns true when only one of the inputs is 1
  • Returns false when both the inputs are same

It is also termed as EOR or EXOR (exclusive OR gate). So, it is similar to OR gate but different in the sense that only one input must be 1 for a result of High whereas in OR either of the input can be true for it to return 1.

In a way XOR represents an inequality function, != or Not Equal To. Checkout the Truth Table below for more information on the results.

What can you do with this tool?

Well, simply put it you can use it to calculate XOR online. The tool supports inputs in the common numerical bases Binary, Octal, Decimal, Hex & even ASCII. That means you can also XOR hex values or XOR strings in ASCII. This is done by first converting the inputs into their Binary equivalents then performing the XOR operation on them. Finally, the results are returned in all of the above numerical bases so that you can pick whichever ones you want.

Intermediate Calculation

The intermediate results are shown in a tabular format which can help you diagnose any problems you encountered while doing a manual XOR operation. In this table, your inputs are shown in their original form. If the input base is not binary then each translation of the inputs to binary is also shown in a different column.

XOR Truth Table

Boolean Operations
A B Result
False False False
True False True
False True True
True True False
Bit Operations
A B Result
0 0 0
1 0 1
0 1 1
1 1 0