Digital electronics can feel confusing, especially when you see terms like exclusive OR gate and XNOR gate. Many beginners mix them up because both are logic gates and look very similar. But in reality, they work in opposite ways.
In this simple guide, you will learn everything about the exclusive OR gate (XOR) and the XNOR gate. We will explain their meanings, how they work, and when to use each one. You will also see easy examples, truth tables, and quick tips to remember them.
Don’t worry if you are new to electronics. This article is written in very simple English. Even a beginner or school student can easily understand it.
What Does Each Gate Mean?
What is an Exclusive-OR Gate (XOR)?
An exclusive OR gate, also called an XOR gate, is a digital logic gate.
👉 It gives output 1 (true) only when the inputs are different.
- If both inputs are same → output is 0
- If inputs are different → output is 1

Part of Logic System:
- Type: Logic Gate
- Used in: Digital circuits, computers, calculators
Easy Examples:
- If A = 0 and B = 1 → Output = 1
- If A = 1 and B = 0 → Output = 1
- If A = 1 and B = 1 → Output = 0
Simple Story:
Think of two switches:
- If only one switch is ON → light turns ON
- If both switches are same (ON or OFF) → light stays OFF
That’s exactly how an XOR gate works.
What is an XNOR Gate?
An XNOR gate is the opposite of an XOR gate.
👉 It gives output 1 (true) when the inputs are the same.
- If both inputs are same → output is 1
- If inputs are different → output is 0
Part of Logic System:
- Type: Logic Gate
- Also called: Equivalence gate
Easy Examples:
- If A = 0 and B = 0 → Output = 1
- If A = 1 and B = 1 → Output = 1
- If A = 1 and B = 0 → Output = 0
Simple Story:
- If both switches are ON → light turns ON
- If both are OFF → light turns ON
- If different → light OFF
This is how XNOR gate behaves.
The Key Difference Between XOR Gate and XNOR Gate
| Feature | XOR Gate | XNOR Gate |
|---|---|---|
| Output Rule | 1 when inputs are different | 1 when inputs are same |
| Also Called | Exclusive OR | Equivalence gate |
| Opposite? | No | Yes (opposite of XOR) |
| Example (1,1) | 0 | 1 |
| Example (1,0) | 1 | 0 |
Quick Tip to Remember:
👉 XOR = “Different = 1”
👉 XNOR = “Same = 1”
XOR Gate Truth Table and Formula
Exclusive or gate truth table:
| A | B | Output (XOR) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
XOR Gate Formula:
👉 A ⊕ B = A’B + AB’
This means:
- A is NOT B
- OR B is NOT A

What is the XOR of 5 and 3?
Convert into binary:
- 5 = 101
- 3 = 011
Now apply XOR:
101
⊕ 011
-----
110
👉 Result = 6
XNOR Gate Truth Table
XNOR gate truth table:
| A | B | Output (XNOR) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
XNOR Gate Formula:
👉 A ⊙ B = AB + A’B’
Common Mistakes and How to Avoid Them
❌ Mistake 1:
Thinking XOR gives 1 when inputs are same
✔️ Correct: XOR gives 1 when inputs are different
❌ Mistake 2:
Confusing XOR with OR gate
✔️ OR gate gives 1 when any input is 1
✔️ XOR is stricter — only one input should be 1
❌ Mistake 3:
Mixing XOR and XNOR truth tables
✔️ Just remember:
- XOR = different
- XNOR = same
When to Use XOR Gate
What is an XOR gate used for?
The XOR gate is used when you need to check differences.
Common Uses:
- Error detection in computers
- Binary addition (half adder)
- Cryptography (data security)
- Comparing two bits
Real-Life Examples:
- A system checks if two passwords are different
- A light turns on only if one switch is pressed
- Digital calculators use XOR for addition
When to Use XNOR Gate
The XNOR gate is used when you need to check similarity.
Common Uses:
- Equality check in circuits
- Data comparison
- Pattern matching
Real-Life Examples:
- Login system checks if entered password matches stored password
- Two signals must be equal to activate output
- Digital circuits compare data bits

XOR Gate Circuit and Diagram Explanation
An XOR gate circuit can be made using:
- AND gates
- OR gates
- NOT gates
It follows the formula:
👉 A ⊕ B = A’B + AB’
XNOR Gate Symbol and Diagram
The XNOR gate symbol looks like an XOR gate with a small circle (NOT bubble) at the output.
👉 That bubble means output is reversed
NOT Gate Truth Table (Basic Concept)
| A | Output (NOT A) |
|---|---|
| 0 | 1 |
| 1 | 0 |
👉 This is important because XOR and XNOR use NOT operations in formulas.
Quick Recap: XOR vs XNOR
- XOR gives 1 when inputs are different
- XNOR gives 1 when inputs are same
- XOR is used for difference checking
- XNOR is used for similarity checking
- XNOR is the opposite of XOR
Advanced Tips (Easy Level)
- XOR is widely used in encryption and coding systems
- XNOR is useful in digital comparison circuits
- In exams, students often lose marks by mixing truth tables
- In real devices, these gates are part of microprocessors and memory systems
Mini Quiz
Fill in the blanks:
- XOR gives output 1 when inputs are ______
- XNOR gives output 1 when inputs are ______
- XOR of 1 and 1 is ______
- XNOR of 0 and 0 is ______
- XOR of 5 and 3 equals ______
FAQs
1. What is an Exclusive-OR gate?
An Exclusive-OR gate is a logic gate that gives output 1 when inputs are different.
2. What is the formula for the Exclusive-OR gate?
The formula is: A ⊕ B = A’B + AB’
3. What is an XOR gate used for?
It is used for comparison, error detection, and binary addition.
4. What is an XNOR gate?
An XNOR gate gives output 1 when inputs are the same.
5. What is the XOR of 5 and 3?
The XOR of 5 and 3 is 6 in decimal.
Conclusion
Now you clearly understand the difference between the exclusive OR gate (XOR) and the XNOR gate. XOR checks for differences, while XNOR checks for similarities. With truth tables, formulas, and simple examples, these concepts become very easy to remember.
Keep practicing with small examples, and soon you will master logic gates. Learning step by step makes everything simple.
👉 Keep learning, and improve your skills every day!

Wilkie Collins was a Victorian English novelist and playwright, pioneer of detective fiction and sensation novels, blending mystery, suspense, and social critique.










