Skip to main content

XOR GATE (EXCLUSIVE OR)

Outputs ON when exactly one input is ON, but not both. Essential for toggle circuits, binary adders, and parity checks. More complex to build than basic gates.

XOR Gate (Exclusive OR) in Minecraft

Truth Table

Input AInput BOutput
0 (OFF)0 (OFF)0 (OFF)
0 (OFF)1 (ON)1 (ON)
1 (ON)0 (OFF)1 (ON)
1 (ON)1 (ON)0 (OFF)

Overview: what the XOR Gate (Exclusive OR) is and does

Outputs ON when exactly one input is ON, but not both. Essential for toggle circuits, binary adders, and parity checks. More complex to build than basic gates.

In plain terms, the output is on when exactly one input is on, but off when both are on or both are off. XOR is the difference detector, and it is the heart of binary adders and parity checks — a half-adder's sum bit is literally an XOR of the two inputs.

This page describes the gate as it behaves in Java Edition 1.21; the truth table and timings below match vanilla redstone exactly.

How it works: the redstone mechanics

Across its four input combinations the output is on in 2 cases — A off with B on and A on with B off — and off in the remaining 2.

Expressed as boolean algebra that is output = A XOR B.

The classic 5-torch XOR adds about 2-3 redstone ticks depending on which path the signal takes.

Because redstone signals are just on or off, "on" here means a powered line (signal 1-15) and "off" means an unpowered line (signal 0); the gate cares only about presence or absence of power, not its exact strength.

How to build it

  1. 1Place two input lines A and B.
  2. 2Build a NOT gate for input A (block + torch) and route it alongside input B.
  3. 3Build a NOT gate for input B (block + torch) and route it alongside input A.
  4. 4Create two AND gate paths: (A AND NOT B) and (NOT A AND B).
  5. 5OR the two AND outputs together. The result is XOR.
  6. 6Alternative: Use comparators in subtract mode, A comparator subtracts B, and B comparator subtracts A. OR the outputs.
  7. 7Verify it against the truth table: setting the inputs to OFF and ON should drive the output ON. Walk through every input combination once to confirm the gate matches the table above.

Uses & applications

  • XOR is the difference detector, and it is the heart of binary adders and parity checks — a half-adder's sum bit is literally an XOR of the two inputs.
  • 5-torch XOR (classic, uses 5 redstone torches) — a practical build choice for this gate.
  • Comparator XOR (two comparators in subtract mode, outputs merged) — a practical build choice for this gate.
  • Compact 2-wide XOR (tileable design using repeaters) — a practical build choice for this gate.
  • Piston-based XOR (using block placement to break signal paths) — a practical build choice for this gate.

Tips & common mistakes

  • !Keep your inputs isolated with repeaters if signals are flowing back into each other; uncontrolled backflow between dust lines is the most common reason a gate reads the wrong value.
  • !Remember the propagation cost: the classic 5-torch XOR adds about 2-3 redstone ticks depending on which path the signal takes. If you chain several gates, those ticks add up and can desynchronise a fast circuit.
  • !When a multi-gate circuit misbehaves, test each gate in isolation against its own truth table before assuming the wiring between them is at fault.

XOR Gate (Exclusive OR) FAQ

What does a XOR Gate (Exclusive OR) do in Minecraft?

A XOR Gate (Exclusive OR) outputs a signal where the output is on when exactly one input is on, but off when both are on or both are off. In boolean terms, output = A XOR B.

What is the truth table of a XOR Gate (Exclusive OR)?

Across its four input combinations the output is on in 2 cases — A off with B on and A on with B off — and off in the remaining 2. The boolean expression is output = A XOR B.

How do you build a XOR Gate (Exclusive OR) with redstone?

Place two input lines A and B. Build a NOT gate for input A (block + torch) and route it alongside input B. Common variants include 5-torch XOR (classic, uses 5 redstone torches) and comparator XOR (two comparators in subtract mode, outputs merged).

How much delay does a XOR Gate (Exclusive OR) add?

The classic 5-torch XOR adds about 2-3 redstone ticks depending on which path the signal takes. That matters most in clocks and adders where every redstone tick counts.

Why is XOR important for redstone adders?

In binary addition the sum bit of two inputs is exactly their XOR, and the carry bit is their AND. A half-adder is therefore just an XOR gate and an AND gate side by side, which is why XOR shows up at the core of every redstone calculator.

Back to all logic gates