Comparator Compare and Subtract Modes

A Redstone Comparator operates in one of two modes toggled by interacting with the block: comparison mode (front torch off) and subtraction mode (front torch on). Rather than boosting a signal to 15 like a repeater, a comparator evaluates the signal strength entering its rear against the highest signal strength entering either of its sides. These two modes allow circuits to gate signals based on thresholds, perform analog math, and build compact clocks or pulse faders.

Measuring & LogicIntermediateComparator logicSignal strengthClocks & timingItem counting

What Are Compare and Subtract Modes?

Every Redstone Comparator has a rear input, two side inputs (left and right), and a front output marked by the arrow on top of the block. At the front tip of the arrow sits a single miniature redstone torch. Using the comparator toggles this front torch between two modes:

  • Comparison Mode (Front Torch Off/Down): The default state when placed. The comparator lets the rear signal pass through unchanged unless a side input is strictly stronger than the rear input, in which case the output drops to 0.
  • Subtraction Mode (Front Torch On/Up): The comparator takes the rear signal strength and subtracts the strongest side input from it, outputting the difference.

If neither side receives power, both modes behave identically: the comparator simply maintains the rear input's exact signal strength and outputs it from the front after a 1 redstone tick (2 game tick) delay.

Exact Rules and Math Formulas

A comparator always evaluates whichever side input (left or right) has the higher signal strength. Not every redstone component can power a comparator from the side; side inputs are only accepted from redstone dust, a block of redstone, a redstone repeater, another redstone comparator, or observers in specific scenarios.

1. Comparison Mode Rules

In comparison mode, the rear input is compared against both sides using this formula:

output = rear × [left ≤ rear AND right ≤ rear]

  • If either the left or right side input is greater than the rear input, the comparator outputs 0 (turns off).
  • If neither side input exceeds the rear input (meaning the sides are less than or equal to the rear), the comparator outputs the exact rear signal strength.

2. Subtraction Mode Rules

In subtraction mode, the higher of the two side inputs is subtracted from the rear input:

output = max(rear − max(left, right), 0)

  • Example A: Rear is 9, left side is 5, right side is 2. The stronger side is 5. The output is max(9 − 5, 0) = 4.
  • Example B: Rear is 4, left side is 6, right side is 7. The stronger side is 7. Since signal strength cannot be negative, the output is max(4 − 7, 0) = 0.

Worked Example: Building a Subtraction Comparator Clock

One of the quickest ways to see subtraction mode in action is building a toggleable 1-tick comparator clock:

  1. Place a Redstone Comparator on a solid block.
  2. Interact with the comparator once so its front miniature torch pops up and lights up (subtraction mode).
  3. Place three pieces of redstone dust: one directly in front of the comparator output, one to the side of that dust, and one directly adjacent to the comparator's side input so the front output loops back into the side.
  4. Place a lever behind the comparator (or leading into the rear input with dust) and flick it on.

How it works step-by-step: The lever feeds signal strength 15 into the rear. Initially, the side input is 0, so the comparator outputs 15 − 0 = 15 after 1 redstone tick. The output dust loops back to the side input, losing 2 signal strength over the dust path and hitting the side at strength 13. One tick later, the comparator calculates 15 − 13 = 2 and drops its output to 2. Because a strength 2 signal dies out before reaching the side input (which drops to 0), the next tick outputs 15 − 0 = 15 again, creating a rapid oscillating pulse.

How Players Use Both Modes in Redstone

  • Item Sorters (Compare or Subtract): Container outputs read by a comparator produce a specific signal strength based on fullness. By feeding a known signal strength (such as from a lectern or another container) into the side input, players can trigger a hopper lock only when a container reaches an exact item threshold.
  • Signal Strength Gates (Compare Mode): Because compare mode preserves the exact rear signal strength until a side input overtakes it, it acts as a lossless analog transistor—allowing a signal of strength 1 to 14 to pass through or be completely blocked by a 15-strength override line.
  • Pulse Faders / Decay Circuits (Compare Mode): A two-comparator loop plays on signal preservation to slowly step down signal strength by 1 every loop cycle, extending a brief button press into a long timer.
  • Rapid Clocks and Analog Math (Subtract Mode): Subtract mode enables compact rapid clocks for dispensers and droppers, as well as analog wire encoding where exact signal differences control contraptions at a distance.

Common Mistakes and Quirks

  • Equal Signals in Compare Mode: A very common misconception is that equal rear and side signals turn off a comparator in compare mode. In reality, if the rear is 8 and the side is 8, compare mode still outputs 8. To output 0 when both inputs are equal, you must switch to subtraction mode (8 − 8 = 0).
  • Invalid Side Inputs: Trying to power a comparator's side directly with a lever, button, redstone torch, or container will do nothing. Always run a piece of redstone dust, a repeater, another comparator, or a redstone block into the side.
  • 1-Tick Pulse Blindness: Comparators check their power state before their scheduled tick updates. Because of this, they usually ignore 1-tick fluctuations—treating a 1-clock as always off from the side and always on from the rear.
  • Overpowering Solid Blocks (Java Edition): You can measure a container through an opaque block, but if that opaque block is powered to signal strength 15, the comparator will read 15 regardless of how few items are inside the container.

Frequently asked questions

What happens in compare mode if the side input equals the rear input?
The comparator continues to output the full rear signal strength. Compare mode only turns off (outputs 0) if a side input is strictly greater than the rear input.
How do you tell if a comparator is in compare or subtract mode?
Look at the single small torch at the front tip of the comparator (where the arrow points). If the front torch is down and off, it is in comparison mode. If the front torch is up and glowing red, it is in subtraction mode.
What blocks can power the side of a redstone comparator?
A comparator only accepts side inputs from redstone dust, a block of redstone, a redstone repeater, another redstone comparator, and observers in specific scenarios. Containers, levers, and torches cannot directly power its sides.
How much delay does a redstone comparator add to a signal?
A comparator adds 1 redstone tick (2 game ticks, or 0.1 seconds) of delay to any signal passing through from the rear or changing via the side inputs, whether turning on, turning off, or changing signal strength.

Components involved

More redstone mechanics