XOR Truth Table Made Easy: 2, 3, 4 Input Logic

The XOR truth table is a foundational concept in digital logic design. XOR, or “exclusive OR”, is a logic gate that outputs true only when an odd number of inputs are true. Understanding how this gate operates across different input sizes (2, 3, and 4 inputs) is key to designing circuits for arithmetic operations, parity checkers, and more.

In this post, we explain the truth table of XOR gate logic and provide clear, easy-to-read tables for 2 input, 3 input, and 4 input XOR gates.


Table of Contents

What Is the XOR Truth Table?

The short answer is that the XOR truth table shows the output behavior of an XOR gate for every possible combination of inputs. An XOR gate returns HIGH (1) only when an odd number of inputs are HIGH. For all even-numbered HIGH input combinations, the output is LOW (0).

A longer explanation is that the XOR truth table shows how an exclusive OR gate behaves when different combinations of inputs are applied. XOR produces a HIGH output only when the number of HIGH inputs is odd, meaning the inputs must be different for the output to be 1. This makes XOR one of the most important digital logic operations used in circuits that must detect changes, differences, or mismatches between signals.

A deeper look at the XOR truth table reveals how valuable this gate is in practical electronics. Because it reacts specifically to input inequality, XOR is used in parity generation, error detection, comparator circuits, and digital arithmetic. Its behavior scales naturally to more inputs: while a 2-input XOR checks whether two signals differ, larger XOR networks determine whether an overall set of signals contains an odd number of ones. This predictable pattern makes it easy for engineers to reason about XOR behavior in larger systems.


2 Input XOR Gate Truth Table

Before looking at the table, it helps to understand what makes the 2-input XOR gate unique among the basic logic functions. Unlike OR or AND, which respond to the presence of one or more HIGH values, XOR focuses solely on whether the inputs differ. This makes it a difference-detector gate. When A ≠ B, the output is HIGH. When A = B, the output is LOW. This simple rule is the foundation for many digital operations involving comparison or toggling.

The 2-input XOR truth table shows this behavior clearly by listing all possible input combinations. With only four possibilities, it becomes easy to see the relationship: equal inputs produce 0, unequal inputs produce 1. This pattern is the basis for using XOR in adders, parity circuits, comparators, and signal toggling.

The 2 input XOR gate truth table is the simplest form and is commonly used in basic digital logic circuits. Here’s the full table, with the XOR Gate symbol.

ABA ⊕ B (Output)
000
011
101
110
2-input XOR Gate Truth Table
2-input XOR Gate Truth Table Symbol
2-input XOR Gate Symbol

Once you understand that XOR acts as a “difference detector,” you can apply it across a wide range of logic circuits. Whether you are building a half adder or designing a bitwise operation in software, this simple 2-input table is the blueprint for XOR behavior in larger systems.


3 Input XOR Gate Truth Table

Before examining the table, it helps to understand how the XOR rule scales to three inputs. The key idea remains the same: the output is HIGH when the total count of HIGH inputs is odd. In a 3-input XOR gate, this means the output becomes 1 for any case where exactly one input is HIGH or all three inputs are HIGH. This “odd parity” behavior makes three-input XOR gates useful in circuits that evaluate multiple conditions at once.

The truth table for three inputs provides a clear breakdown of all eight possible combinations. By following the odd-number rule, you can predict the output without memorizing individual lines. This property is why XOR is often used in parity checkers and multi-bit arithmetic operations.

A 3 input XOR gate truth table includes one more variable. The output is still HIGH when an odd number of inputs are HIGH.

They simplify the logic needed to evaluate multiple signals, especially in adders, checksum logic, and bus comparison circuits. Understanding the 3-input XOR truth table helps you extend the same reasoning to even larger XOR networks used in digital systems.

ABCA ⊕ B ⊕ C (Output)
0000
0011
0101
0110
1001
1010
1100
1111
3-input XOR Gate Truth Table

4 Input XOR Gate Truth Table

Before reviewing the table for a 4-input XOR gate, it’s useful to understand how parity determines the output. With four inputs, XOR still produces a HIGH output only when the number of HIGH inputs is odd. This makes the 4-input XOR an excellent tool for detecting whether an even-sized group of signals contains an odd number of ones, which is a fundamental operation in parity generation and error detection.

The truth table lists all sixteen possible input combinations and makes the pattern easy to see. Because of the odd-parity rule, only combinations with one or three HIGH inputs produce a HIGH output. This creates a predictable and easily testable relationship between the input vector and the result.

The 4 input XOR gate truth table continues the pattern: the output is HIGH for an odd number of 1s. You’ll notice the output is 1 for 1 or 3 HIGH inputs, consistent with XOR’s odd-input behavior.

ABCDA ⊕ B ⊕ C ⊕ D (Output)
00000
00011
00101
00110
01001
01010
01100
01111
10001
10010
10100
10111
11000
11011
11101
11110
4-input XOR Gate Truth Table


Parity bits, CRC logic, and multi-bit arithmetic often rely on XOR’s ability to summarize several signals into a single parity output. Understanding this truth table helps engineers reason about more complex error-checking and arithmetic operations that appear in modern digital designs.


Tips for the XOR Truth Table

It helps to know that XOR is governed by a simple but powerful idea: the output depends entirely on whether the number of HIGH inputs is odd. Keeping this rule in mind makes it much easier to read and interpret XOR truth tables for any number of inputs.

Here are tips to make working with XOR more intuitive:

  • Use XOR gates for parity checking, as they efficiently detect whether the number of HIGH bits is odd.
  • In circuits with multiple XOR gates, chain them in such a way that all inputs pass through a cascade (e.g., (((A⊕B)⊕C)⊕D)).
  • XOR gates are often used in adders, especially for computing sum bits in half-adders and full-adders.
  • When debugging logic circuits, XOR gates can help compare signals or verify bit integrity.
  • Remember: XOR gates are commutative and associative, which simplifies logic design.
  • Count the number of HIGH inputs; if the count is odd, the output is HIGH.
  • Equal inputs always produce LOW; unequal inputs produce HIGH (for 2-input XOR).
  • For larger XOR gates, think in terms of parity rather than memorizing table rows.
  • XOR is associative, so you can group inputs in any order when evaluating them.
  • Remember that XOR acts like addition modulo 2, which aligns with binary arithmetic.
  • When testing circuits, XOR outputs can help confirm signal mismatches quickly.
  • In debugging situations, XOR is useful for detecting flipped or corrupted bits.

Did You Know About the XOR Truth Table?

Before listing the interesting facts, it’s helpful to understand that XOR is one of the most versatile logic functions in digital design. Its ability to detect differences and parity patterns gives it a role in everything from basic gates to advanced cryptographic systems.

Here are more expanded and useful insights:

  • The XOR operation is sometimes referred to as “inequality detector,” since it outputs 1 when inputs differ.
  • XOR gates are essential in cryptography where they form the core of many encryption schemes due to their reversible nature.
  • In binary arithmetic, XOR is used to toggle bits without using a temporary variable (e.g., bit-swapping in-place).
  • XOR gates were first formalized in the 19th century via Boolean algebra before implementation in modern ICs.
  • XOR behaves exactly like binary addition without carrying.
  • Many microprocessors implement XOR directly as a fast hardware instruction.
  • XOR is a foundational building block for LFSRs, CRC calculations, and hashing.
  • Some error-correcting codes rely heavily on XOR networks for parity generation.
  • XOR’s associativity allows large XOR trees to be optimized for speed in hardware.
  • In computer graphics, XOR was once widely used for drawing temporary overlays because applying XOR twice restores the original image.

Frequently Asked Questions About the XOR Truth Table

Each question below explores a different practical or conceptual angle, helping you build a deeper understanding of how XOR works and where it is used.

What is the difference between XOR and OR gates?

OR produces a HIGH output when any input is HIGH. XOR produces a HIGH output only when the number of HIGH inputs is odd. In a 2-input case, OR outputs 1 for three input combinations (01, 10, 11), while XOR outputs 1 for only two (01, 10). XOR therefore checks for input difference, while OR checks for input presence.

Can XOR have more than 2 inputs?

Yes. XOR can be extended to 3, 4, or any number of inputs. The rule stays the same: the output is HIGH when the count of HIGH inputs is odd. This property makes multi-input XOR gates useful in parity logic and multi-bit arithmetic.

How do I build a 3 input XOR gate?

A common approach is to cascade two 2-input XOR gates. First XOR A and B, then XOR the result with C. Thanks to XOR’s associativity, the order does not matter. In hardware, some ICs provide multi-input XORs directly, but cascading remains standard practice.

Is XOR associative?

Yes. XOR is fully associative, meaning (A ⊕ B) ⊕ C = A ⊕ (B ⊕ C). This property allows XOR operations to be grouped or rearranged freely. It also enables multi-input XOR calculations to be implemented efficiently using tree structures in hardware.

What IC contains XOR gates?

A popular IC containing XOR gates is the 74HC86 (or 7486 in older TTL naming). It includes four independent 2-input XOR gates inside one package. Many CMOS, TTL, and low-power variants exist, making the XOR gate widely available for digital building projects. The 4070 is a common quad 2-input XOR IC from the CMOS logic family.

Why does XOR output 0 when inputs are equal?

XOR checks whether inputs differ. When two inputs are the same (00 or 11), the number of HIGH inputs is even, so the output becomes 0. This property is why XOR is used as a difference detector and in circuits that check whether two signals match.

Can XOR be used for bit flipping?

Yes. XOR is commonly used to toggle bits. When you XOR a value with 1, the bit flips; when you XOR it with 0, it stays the same. This makes XOR useful for masking, encryption, graphics operations, and low-level software routines where bitwise modifications are needed.


Conclusion on the XOR Truth Table

The XOR truth table is a vital part of digital electronics. By understanding the behavior of 2 input, 3 input, and 4 input XOR gates, you can design circuits for arithmetic operations, error detection, and data comparison with confidence. The unique odd-number output behavior of XOR gates makes them one of the most useful tools in a digital designer’s toolbox.

See the related XNOR Gate Truth Table.