XNOR Gate

An XNOR gate is a fundamental redstone logic circuit that outputs a signal when both of its inputs are in the exact same state (both ON or both OFF). It acts as the inverted version of an XOR gate, making it ideal for controlling a single door or mechanism from two different levers, or for checking matching conditions in automated minecart stations.

Logic GatesBeginnerJava & Bedrock
XNOR Gate video tutorial

Video: Minecraft Redstone Tutorial: XNOR Gate (Works on xbox) by BrenyBeast

How to build it

  1. Build the Input Base

    Place three solid building blocks in a horizontal line, then place one more block sticking out from the middle block to form a T-shape.

  2. Add the Input Levers and Torches

    Attach a lever to the back of the two outer blocks in your three-block line. Place redstone torches on top of the two outer blocks and on the middle extension block.

  3. Place the Secondary Blocks

    Leave a one-block gap forward from the outer blocks and place two more solid blocks in line with the outer pathways.

  4. Wire the Upper Blocks

    Place redstone dust on top of the middle block from your first row, and on top of the two newly placed forward blocks to connect the torch signals.

  5. Attach the Output Torches

    Place redstone torches on the inner/front sides of the two forward blocks so they feed into a central output area.

  6. Connect the Output Line

    Run redstone dust on the ground between the front torches to merge their signals into a single output line.

  7. Add an Inverter and Door

    To flip the output state between XOR and XNOR, run the output dust into one more solid block with a redstone torch on its side. Place your door next to the final redstone dust output.

How it works

This circuit is built using basic torch-and-dust logic by taking a standard XOR layout and adding an inverter (NOT gate) at the end:

  • Matching Inputs (Both OFF or Both ON): When both levers are in the same state, the internal torches balance out so the two front-facing output torches remain off. If you attach the final inverter block and torch, that torch stays ON, powering your output line.
  • Different Inputs (One ON, One OFF): Flipping either lever changes the state of only one side of the gate, allowing one of the front output torches to turn on. This powers the final inverter block, turning its attached redstone torch OFF.
  • Two-Way Switch Behavior: Because flipping either lever always toggles the output state from whatever it currently is, both levers can independently open or close the connected door.

Tips & variations

  • XOR vs. XNOR: The only difference between an XOR gate and an XNOR gate is the final inverter (a block with a redstone torch on it). If your door is open when you want it closed, simply add or remove that final inverter torch.
  • Saving Space: as shown in the video, you can tuck the inverter torch onto the side of the output block rather than stretching it straight forward to keep the footprint compact.
  • Cross-Edition Compatibility: Because this design relies strictly on basic redstone dust and redstone torch inversion without pistons or quasi-connectivity, it works reliably on Java, Bedrock, and legacy console editions.

Frequently asked questions

What is the difference between an XOR and an XNOR gate?
An XOR gate outputs power only when the two inputs are different. An XNOR gate is the exact opposite—it outputs power only when both inputs are the same.
Do I need the inverter at the end of the circuit?
If you are using the gate as a dual-lever switch for a door, both XOR and XNOR allow you to toggle the door from either side. Adding the inverter simply reverses whether the door is open or closed when both levers match.
What can I use an XNOR gate for in Survival?
It is commonly used for hallways or bases where you want two levers (one inside, one outside) to control the same door, as well as in minecart stations to check if a player and a cart are present at the same time.

Components used

More xnor gate