XNOR Logic Gate

An XNOR logic gate is a classic redstone circuit that outputs a positive signal whenever both of its inputs match—meaning both levers are either ON or both are OFF. If one input is ON and the other is OFF, the output turns off. This makes it ideal for dual-switch doors, hallway lighting, or security systems where two switches need to toggle the same device.

Logic GatesIntermediateJava Edition
XNOR Logic Gate video tutorial

Video: XNOR Logic Gate Explained - Advanced Redstone Tutorial by Lukedude5

How to build it

  1. Place the Two Input Levers

    Start by placing two solid blocks with a small gap between them and attach a lever to the front of each block to act as your two inputs.

  2. Set Up the Input Inverters

    Attach redstone torches to the back of your input blocks and run redstone dust between them so that each input interacts with a central shared block.

  3. Build the Central Torch Stage

    Place a central block with a redstone torch attached to it. This torch will only turn on when both of the initial input torches are turned off.

  4. Wire the Outer Branches

    Run two parallel lines of redstone dust around the outside from the initial input stage toward a final combining block, placing redstone torches to invert these side signals into the output line.

  5. Connect the Output Door

    Join the central torch output and the outer wire paths into a final block holding an inverting output redstone torch. Run redstone dust from this final torch to your door.

How it works

The XNOR gate relies on multiple stages of signal inversion using redstone torches:

  • Both Inputs OFF (0, 0): The initial input torches remain lit, powering the outer redstone dust lines. These outer lines keep the final inverting torch turned off (or inverted depending on door placement), resulting in an open door state.
  • Both Inputs ON (1, 1): Flipping both levers turns off both initial input torches. Because neither initial torch is powering the central block, the middle redstone torch turns on, sending power down the center line to deactivate the final output torch and open the door.
  • Mixed Inputs (1, 0 or 0, 1): When only one lever is flipped, one initial torch stays on while the other turns off. This keeps the central torch deactivated while also failing to satisfy the outer path conditions, leaving the door closed.

Tips & variations

  • Two-Way Switch Usage: Because toggling either lever always changes whether the two inputs match, an XNOR gate lets you open and close a single door independently from two different locations (such as the inside and outside of a base).
  • Silent Operation: Since this design uses only redstone torches and dust without pistons, the logic circuit itself is completely silent.
  • Cross-Edition Compatibility: Pure torch-and-dust logic gates rely on fundamental redstone inversion rules and behave identically across versions.

Frequently asked questions

What is the difference between an XOR gate and an XNOR gate?
An XOR gate outputs ON only when the two inputs are different (one ON, one OFF). An XNOR gate is the exact inverse: it outputs ON only when both inputs are the same (both ON or both OFF).
How do I convert an XNOR gate into an XOR gate?
You can easily turn an XNOR gate into an XOR gate by adding or removing a single redstone torch inverter at the final output line.
What is the best survival use for an XNOR gate?
It is most commonly used for two-way switches, allowing you to open an iron door with a lever on the outside and close it with a second lever on the inside.

Components used

More xnor gate