Build a XOR gate from two levers, two blocks, two redstone torches, four pieces of redstone dust, and two solid blocks for the output line: place the levers on the backs of two blocks, run dust from each lever forward, and cross the two lines under a pair of torches so the output is on only when exactly one lever is flipped. The whole build takes about 5 minutes in Creative mode and needs a flat 5x5 area.
A XOR gate outputs power when its two inputs differ: on-off or off-on gives a signal, while off-off and on-on give nothing. In Minecraft the cleanest version uses two redstone torches as inverters and a single dust junction as the OR, which is why the parts list is so small.
Parts and Space Checklist
Gather these before you place anything, because a XOR gate is easier to wire when you build it in one pass:
- 2 levers (inputs A and B)
- 2 solid blocks to mount the levers on
- 2 redstone torches (the inverters)
- 2 more solid blocks to hold the torches
- 4 redstone dust
- 1 redstone lamp or a length of wire for the output
Clear a flat 5x5 area. Redstone dust connects only along flat ground or up the side of a block, so a one-block step in the middle of a line will break the circuit. If you are building in Survival, mine the redstone from redstone ore with an iron pickaxe or better; each ore block drops 4-5 dust, so one ore block covers this build.
Build the Two Input Lines
- Place your two lever blocks side by side with a one-block gap between them, both facing the same direction. Put a lever on the back face of each block.
- Run a line of redstone dust from the front of lever block A straight forward for 3 blocks. Do the same from lever block B, keeping the two lines 2 blocks apart so they never touch.
- At the far end of each line, place a solid block and put a redstone torch on the side of that block facing the line. The torch lights when its line is unpowered, which is the inversion step.
Test each half now: flip lever A and watch the torch at the end of line A go out. If it does not, the dust is not connected to the block under the torch, or the torch is on the wrong face.
Join the Two Lines
- Run a single line of redstone dust from the block under torch A across to the block under torch B, so both torches feed the same wire. That shared wire is your output.
- Place a redstone lamp at the end of the shared wire, or run the wire to whatever you are controlling.
- Flip the levers through all four combinations and confirm the lamp is on for on-off and off-on only.
If both levers on gives a lit lamp, the two input lines are touching somewhere. Separate them by at least one empty block along their whole length. If the lamp never lights, check that the output dust touches the block beneath each torch rather than the torch itself.
Reading the Truth Table
The behavior you should see, with 1 meaning the lever is on:
- A off, B off: output off
- A on, B off: output on
- A off, B on: output on
- A on, B on: output off
That pattern is the definition of exclusive OR, and it is the reason XOR is useful for parity checks, combination locks, and toggling a door from two separate buttons. If you need the opposite behavior, add one more redstone torch as an inverter on the output line and the gate becomes XNOR.
Compact Version and Signal Limits
If space is tight, fold the design: put the two lever blocks facing each other 2 blocks apart, run each line one block, and place the two inverter torches on the inner faces of a shared middle block. This fits in a 3x3 footprint and behaves identically, though the dust runs are shorter and easier to miswire, so build the 5x5 version first.
Redstone dust carries a signal 15 blocks before it fades. This gate's internal runs are only 3-4 blocks, so signal strength is not an issue, but if you run the output more than 15 blocks to a lamp or piston, insert a redstone repeater every 15 blocks. A repeater also lets you delay one input, which matters if you are feeding the gate from two pistons or observers that fire at slightly different times.
Testing and Fixing a Dead Output
Work backward from the lamp. Put a redstone torch or a lever directly on the output wire; if the lamp lights, the output side is fine and the fault is in one of the input lines. Then test each input line alone by flipping its lever and watching its inverter torch. A torch that stays lit with its lever on means the dust is not reaching the block under the torch, which usually means a gap of one block or a dust line running up a wall instead of along the floor. Replace the dust with a fresh piece; dust that has been broken and replaced sometimes sits on the wrong face of a block.
If the gate works but flickers when you flip a lever, the cause is usually two torches feeding the same dust from opposite ends. Keep the two inverter torches on separate blocks and let only the shared output wire join them.