⚡ Interactive Logic Gate

XOR Gate Simulator

Use the free XOR Gate Simulator to test Exclusive OR logic instantly. Switch Input A and Input B between 0 and 1 and watch the result update immediately. A two-input XOR gate produces output 1 when the two inputs are different and output 0 when they are the same.

✓ Interactive Inputs ✓ Instant Output ✓ Truth Table ✓ Exclusive OR ✓ Free Unlimited Use
XOR
2-Input XOR Gate
● Live
Input A
0
XOR
A ⊕ B
Input B
0
Output Q
0
LOW / FALSE
0 XOR 0 = 0

What Is an XOR Gate?

An XOR gate, short for Exclusive OR, is a digital logic gate that compares binary inputs and produces output 1 when the inputs are different. For a standard two-input XOR gate, exactly one input must be HIGH for the output to be HIGH.

If both inputs are 0 or both inputs are 1, the output is 0. This difference- detecting behavior makes XOR useful in binary addition, parity generation, comparison, toggling, and many digital logic applications.

Boolean rule: Q = A XOR B Common symbolic notation: Q = A ⊕ B

XOR Gate Truth Table

A two-input XOR gate has four possible input combinations.

Input A Input B XOR Output
0 0 0
0 1 1
1 0 1
1 1 0
Core rule: a two-input XOR gate outputs 1 when the two inputs differ.

How to Use the XOR Gate Simulator

Select Input A

Choose binary 0 or binary 1 for the first input.

Select Input B

Choose 0 or 1 for the second digital input.

Compare the states

XOR checks whether the two input states are different.

Read Output Q

Different inputs produce 1. Matching inputs produce 0.

Try all four cases

Use the quick buttons to verify every row in the XOR truth table.

XOR Gate Input and Output Examples

0 XOR 0

Both inputs match, so the XOR output is 0.

0 XOR 1

The inputs are different, so the output becomes 1.

1 XOR 0

The inputs are different, so the XOR output is 1.

1 XOR 1

Both inputs match, so the output returns to 0.

Why Does 0 XOR 1 Equal 1?

Exclusive OR is true when exactly one of the two inputs is true. With inputs 0 and 1, one input is LOW and the other is HIGH.

A = 0
B = 1
A XOR B = 1

The same reasoning applies to 1 XOR 0.

Why Does 1 XOR 1 Equal 0?

The word exclusive is important. XOR does not accept the case where both inputs are simultaneously true.

1 XOR 1 = 0

Standard OR, by comparison, gives 1 OR 1 = 1.

XOR Boolean Expression

A two-input XOR gate can also be constructed from AND, OR, and NOT operations.

A XOR B = (A AND NOT B) OR (NOT A AND B)

This expression says the result is true when A is true and B is false, or when A is false and B is true.

XOR Gate vs OR Gate

OR and XOR are identical for three of the four two-input combinations. Their difference appears when both inputs are 1.

A B OR XOR
0000
0111
1011
1110
OR is inclusive: 1 OR 1 = 1. XOR is exclusive: 1 XOR 1 = 0.

XOR Gate vs XNOR Gate

XNOR is the exact inverse of XOR. XOR detects difference, while XNOR detects equality.

A B XOR XNOR
0001
0110
1010
1101

XOR Gate and Binary Addition

XOR is especially important in binary arithmetic because it produces the sum bit of a basic half-adder.

A B Sum (XOR) Carry (AND)
0000
0110
1010
1101

When 1 + 1 is performed in binary, the sum position becomes 0 and a carry of 1 is generated. XOR provides the sum bit while AND provides the carry.

XOR as a Difference Detector

Because XOR outputs 1 whenever its two inputs differ, it can act as a simple one-bit comparator for inequality.

A = B → XOR = 0
A ≠ B → XOR = 1

XNOR performs the complementary equality check.

XOR and Parity

XOR is commonly used to calculate parity because repeated XOR operations indicate whether an odd or even number of input bits are 1.

For three inputs: A XOR B XOR C Example: 1 XOR 0 XOR 1 = 0

There are two 1 bits in the example, so the XOR result is 0. With an odd number of 1 bits, repeated XOR produces 1.

XOR and Bit Toggling

In programming, bitwise XOR can toggle selected bits using a mask. A mask bit of 1 flips the corresponding data bit, while a mask bit of 0 leaves that position unchanged.

Value: 10110000 Mask: 00001100 Result: 10110000 XOR 00001100 = 10111100

Useful XOR Properties

Property Rule
Identity A XOR 0 = A
Toggle A XOR 1 = NOT A
Self-cancel A XOR A = 0
Commutative A XOR B = B XOR A
Associative (A XOR B) XOR C = A XOR(B XOR C)

Why Does A XOR A Equal 0?

XOR outputs 1 only when the two inputs differ. If the same value is compared with itself, the two states always match.

0 XOR 0 = 0
1 XOR 1 = 0
Therefore: A XOR A = 0

Why Does A XOR 1 Invert A?

When one XOR input is permanently set to 1, the output is always the opposite of the other input.

0 XOR 1 = 1
1 XOR 1 = 0
Therefore: A XOR 1 = NOT A

This is why XOR is useful for selectively toggling binary bits.

XOR Gate vs Binary XOR

XOR Gate

Usually refers to a digital circuit that evaluates individual binary signals.

Binary XOR

Applies the same XOR rule independently across corresponding positions of multi-bit binary values.

Single-bit XOR: 1 XOR 0 = 1 Bitwise XOR: 1010 XOR 1100 = 0110

Three-Input XOR Gate

When XOR is extended across more than two inputs, repeated XOR produces 1 when an odd number of the inputs are 1.

Q = A XOR B XOR C Examples: 0 XOR 0 XOR 1 = 1
1 XOR 1 XOR 0 = 0
1 XOR 1 XOR 1 = 1

This odd-parity behavior is useful in arithmetic and error-detection circuits.

How an XOR Gate Works in Digital Electronics

An XOR circuit evaluates whether its binary input states differ. The physical implementation may be built from combinations of simpler transistor or logic structures, but its external Boolean behavior follows the same XOR truth table.

LOW and HIGH represent logical signal states associated with binary 0 and 1. Actual voltage thresholds depend on the logic family and circuit design.

Where Are XOR Gates Used?

Half Adders

Generate the sum bit when adding two individual binary digits.

Full Adders

Multiple XOR operations help combine operand bits with a carry-in signal.

Parity Generation

Detect whether an odd or even number of selected input bits are 1.

Digital Comparison

Produce a difference signal when two individual bits do not match.

Bit Toggling

XOR masks can flip selected binary positions without changing the others.

Data Processing

XOR appears in checksums, coding methods, reversible transformations, and many low-level algorithms.

Common XOR Gate Mistakes

Thinking XOR is the same as OR

They differ for input 1,1. OR gives 1, while XOR gives 0.

Thinking XOR means both inputs must be 1

That is AND behavior. XOR is true when the inputs differ.

Forgetting the word exclusive

Exclusive OR excludes the both-true case in a standard two-input gate.

Confusing XOR and XNOR

XOR detects difference. XNOR detects equality.

Applying the two-input rule incorrectly to many inputs

Repeated multi-input XOR gives 1 when an odd number of input bits are 1.

Related BinaryCon Tools

XOR Gate Simulator FAQs

What is an XOR gate?
An XOR gate is an Exclusive OR logic gate. For two inputs, it outputs 1 when the inputs are different and 0 when they are the same.
What is 0 XOR 0?
0 XOR 0 = 0.
What is 0 XOR 1?
0 XOR 1 = 1.
What is 1 XOR 0?
1 XOR 0 = 1.
What is 1 XOR 1?
1 XOR 1 = 0 because both inputs are the same.
When does an XOR gate output 1?
For two inputs, the output is 1 when exactly one input is 1.
What does XOR stand for?
XOR stands for Exclusive OR.
What is the XOR symbol?
A common Boolean symbol is , so XOR may be written as A ⊕ B.
What is the difference between XOR and OR?
OR produces 1 when either or both inputs are 1. XOR produces 1 only when the two inputs differ.
What is the difference between XOR and XNOR?
XNOR is the inverse of XOR. XOR detects different inputs, while XNOR returns 1 when the inputs match.
Why is XOR used in binary addition?
A two-input XOR produces the sum bit of a half-adder, while an AND gate produces the carry bit.
Why is XOR used for parity?
Repeated XOR returns 1 when an odd number of participating input bits are 1, making it useful for parity calculations.
What is A XOR A?
A XOR A = 0 because a value always matches itself.
What is A XOR 0?
A XOR 0 = A. XOR with zero leaves the bit unchanged.
What is A XOR 1?
A XOR 1 = NOT A. XOR with 1 flips a single binary bit.
Can XOR have more than two inputs?
Yes. Repeated XOR across several inputs produces 1 when an odd number of those inputs are 1.
Is XOR used in programming?
Yes. Bitwise XOR is widely used for toggling bits, masks, checksums, coding, comparison, reversible transformations, and other low-level operations.
Does this XOR Gate Simulator require registration?
No. You can test all XOR combinations directly without registration.

Test XOR Gate Logic Instantly

Switch both inputs between 0 and 1, see the Exclusive OR output immediately, study the XOR truth table, and understand its role in binary addition, parity, comparison, bit toggling, and digital electronics.

CATEGORY CODE ACTIVE
Scroll to Top