
Video: Very Easy & Simple Compact Comparator XOR Gate (Minecraft Redstone Tutorial) by Drackiseries - Minecraft YouTuber
How to build it
- Place the Two Input Levers
Place two levers on the ground with a one-block gap between them. These will act as Input A and Input B for your logic gate.
- Add the Comparators in Subtract Mode
Directly in front of each lever, place a redstone comparator facing forward away from the levers. Right-click (interact with) both comparators so their front torches light up, putting them into subtract mode.
- Wire the Rear and Side Inputs
Place redstone dust behind and between the comparators so that each lever connects into the back of its own comparator as well as the side of the opposite comparator.
- Connect the Outputs Together
Run redstone dust in front of both comparators and merge the lines into a single output line. Place a redstone lamp (or your target mechanism) at the end of this output line.
- Test the XOR Gate
Flip one lever ON while leaving the other OFF—the lamp will light up. Flip both levers ON or both OFF and the lamp will turn off.
How it works
This circuit relies on how a redstone comparator in subtract mode calculates signal strength. In subtract mode, a comparator takes its rear input signal strength and subtracts the highest side input signal strength: Output = max(0, Rear - max(Left, Right)).
- Both inputs OFF (0, 0): Neither comparator receives power at the rear input, so both output 0 and the lamp stays off.
- One input ON (1, 0 or 0, 1): The active lever sends a full signal into the rear of one comparator and into the side of the other. The comparator receiving only a side input outputs 0, while the comparator receiving only a rear input has nothing subtracted from it (
15 - 0 = 15) and powers the output line. - Both inputs ON (1, 1): Both comparators receive equal signal strength at their rear and side inputs. Because the rear and side signals are equal, they cancel each other out (
15 - 15 = 0), turning the output completely off.
Tips & variations
- Convert to an XNOR Gate: To invert the behavior so the output is ON only when both levers match, place a solid block at the end of the output dust with a redstone torch on the far side (an inverter).
- Common Mistake: Forgetting to toggle both comparators into subtract mode (front torch lit). If left in compare mode, the gate may still cancel at equal strengths, but subtract mode guarantees clean subtraction across varying input line lengths.
- Edition Note: Built and demonstrated in Minecraft 1.18.2 Java Edition, though comparator subtraction works identically in Bedrock Edition.





