Redstone Companion · Learn Open simulator →

XOR & XNOR Gates

An XOR gate outputs on only when its two inputs differ, making it perfect for two-switch lighting and adders. An XNOR gate is its opposite, firing only when both inputs match.

Bedrock Edition · Updated 2026-06-01

What is an XOR gate?

XOR stands for “exclusive OR.” It outputs on when its two inputs are different — one on and one off — and off when they're the same (both on or both off). Think of it as a difference detector: it fires only when the inputs disagree.

The everyday use is a light controlled by two switches, like the top and bottom of a staircase: flipping either switch toggles the light, regardless of the other's position. That's exactly XOR behaviour.

Toggle either lever. The output is on only when the two inputs disagree; matching inputs turn it off.
Open full simulator →

What is an XNOR gate?

An XNOR gate (“exclusive NOR”) is simply XOR with its output inverted. It outputs on when the two inputs are the same — both on or both off — and off when they differ. It's an equality detector, useful for combination locks where you want a signal only when an input matches a stored value. Build one by feeding an XOR's output through a NOT gate (a redstone torch).

Why does XOR matter?

XOR is the workhorse of redstone arithmetic. A binary adder — the circuit that lets you build calculators in Minecraft — uses XOR to compute the sum bit of two binary digits, with an AND gate for the carry. So while two-switch lighting is the friendly use, XOR is also the gate that makes redstone computing possible.

Key facts

Bedrock note

XOR designs lean heavily on torches and tight wiring, so the Bedrock strong/weak power rule matters: make sure each input strongly powers the blocks it needs to, since weak dust power won't flip a torch. Bedrock's lack of quasi-connectivity also means compact Java XOR variants may need extra space. This simulator follows Bedrock power rules.