Redstone Comparator

A Redstone Comparator is a multi-purpose logic component that reads the state or fullness of blocks behind it, maintains exact signal strengths, or compares and subtracts side inputs from its rear input. Unlike a repeater, which boosts any signal to full strength, a comparator preserves analog signal levels from 0 to 15 with a fixed 1-redstone-tick delay. It is the backbone of item sorters, analog logic gates, and container-monitoring circuits.

Signal TransmissionIntermediateComparator logicSignal strengthItem countingPulse shaping

Placement and Inputs

A Redstone Comparator must be placed on top of an opaque block with a full-height solid top surface, including upside-down slabs and upside-down stairs (and walls or fences in Bedrock Edition). When placed, the arrow on the stone base points away from the player toward the front output. If its support block is removed, pushed by a piston, or flooded by water, the comparator pops off as an item; flowing lava destroys it completely.

A comparator has four faces:

  • Rear (Input): Reads signal strength from redstone components, containers, or special blocks directly behind it—or through one intervening solid opaque block.
  • Left and Right Sides (Secondary Inputs): Accept signal strength only from redstone dust, a block of redstone, redstone repeaters, other comparators, or observers in specific setups.
  • Front (Output): Emits the calculated signal strength after a 1-redstone-tick (2 game ticks) delay.

Interacting with (using) the comparator toggles its front miniature torch between two states: down/unpowered (Comparison Mode) and up/powered (Subtraction Mode). The two rear torches light up whenever the comparator's output is greater than 0.

How It Works: Compare vs. Subtract Mode

Every comparator operation takes exactly 1 redstone tick (0.1 seconds), whether turning on, turning off, or changing signal strength. If neither side receives power, the comparator simply outputs the exact signal strength entering its rear.

1. Comparison Mode (Front Torch Off)

In default comparison mode, the comparator checks if either side input is stronger than the rear input. If at least one side input is strictly greater than the rear input, the output drops to 0. Otherwise, the rear signal passes through unchanged:

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

2. Subtraction Mode (Front Torch On)

In subtraction mode, the comparator takes the stronger of its two side inputs and subtracts that value from the rear input (never dropping below 0):

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

For example, if the rear input is 9, the left side is 5, and the right side is 2, the comparator calculates 9 − max(5, 2) = 4 and outputs signal strength 4.

Measuring Containers and Signal Strength Math

A comparator placed facing away from a container—or separated from that container by one solid opaque block—outputs a signal from 0 to 15 based on how full the inventory is. Note that in Java Edition, if the separating opaque block is strongly powered to signal strength 15, the comparator outputs 15 regardless of the container's contents.

An empty container always outputs 0. As soon as at least one item is inside, the output is at least 1, calculated by averaging slot fullness across all slots in the container:

signal strength = floor(1 + ((sum of all slots' fullnesses) / (total slots in container)) × 14)

Where fullness of a slot = item count / max stack size (64, 16, or 1).

To calculate full-stack-equivalents (FSE), items stacking to 64 count as +1 each, items stacking to 16 (ender pearls, snowballs, signs) count as +4 each, and non-stackable items (minecarts, tools, potions) count as +64 each. To generate a specific desired signal strength (from 2 to 15) using standard 64-stackable items:

items required = max(desired strength, roundup((total slots × 64 / 14) × (desired strength − 1)))

  • 5-Slot Hopper: Outputs strength 1 with 1 item, strength 2 at 23 items, strength 3 at 46 items, and strength 15 at 320 items (5 full stacks).
  • 27-Slot Barrel / Single Chest / Shulker Box: Outputs strength 1 with 1 item, strength 2 at 1 stack + 60 items (124 items), and strength 15 at 27 full stacks.
  • 54-Slot Large Chest: A comparator reads the entire 54-slot double chest, not just the half directly behind it.

Non-Container Blocks a Comparator Can Read

Beyond standard chests, barrels, hoppers, dispensers, droppers, furnaces, smokers, blast furnaces, brewing stands, shulker boxes, and minecarts with chests/hoppers on detector rails, comparators read the internal state of many special blocks:

  • Lectern: Outputs 1 to 15 based on the open book's current page: floor(1 + ((current page − 1) / (total pages − 1)) × 14). A 1-page book always outputs 15; a 15-page book outputs the exact page number (1 to 15).
  • Composter: Outputs 0 when empty, and 1 through 8 corresponding to its fill level.
  • Cauldron: Outputs 0 when empty, and 1, 2, or 3 based on water or powder snow depth. A lava cauldron always outputs 3.
  • Chiseled Bookshelf: Outputs 1 to 6 indicating the last slot interacted with (0 if none has been touched yet).
  • Beehive and Bee Nest: Outputs 0 to 5 equal to the current honey level.
  • Cake: Outputs 2 per remaining slice (14 for an uneaten 7-slice cake, down to 0 when eaten).
  • Item Frame: When placed behind the full solid block an item frame is attached to, outputs 0 if empty, or 1 to 8 based on rotation (45° steps for normal items; 90° steps for maps). Fails if the frame is waterlogged or shares its space with a sign.
  • Jukebox: Outputs 0 when empty, or 1 to 15 depending on which music disc is playing (e.g., "13" = 1, "cat" = 2, "5" = 15).
  • Sculk Sensor: Outputs a specific signal strength depending on the vibration frequency detected.
  • Respawn Anchor: Outputs 0, 3, 7, 11, or 15 based on its charge level.
  • End Portal Frame: Outputs 15 if it holds an Eye of Ender, or 0 if empty.
  • Command Block: Outputs the success count of the last executed command (capped at 15 for redstone dust).

Common Circuits & Practical Tips

  • ImpulseSV Item Sorter: By reading a filter hopper containing 41 filter items and 4 filler items (45 items total = signal strength 2, right on the threshold of 46 items for strength 3), a comparator turns off a locking redstone torch as soon as a 46th item enters, allowing one item to drain into the storage chest below.
  • Comparator Subtract Clock: Run a wire from the comparator's front output around into one of its sides, switch it to subtraction mode, and power the rear input. If the rear input is strength 15, the output alternates between 15 and 0 every redstone tick.
  • Comparator Pulse Extender (Fader): Place two comparators side-by-side facing opposite directions connected by redstone dust at both ends. A brief input pulse loops through the comparators, losing 1 signal strength per cycle until it fades to 0.
  • Locked Chest Pitfall: Regular chests and trapped chests that are blocked from opening (by an opaque block, cat, or ocelot sitting on top) output a signal strength of 0 even when completely full. Use barrels or shulker boxes instead, which can always be read even when blocked—and composters or cauldrons for lag-friendly constant signal sources.
  • 1-Tick Pulse Filtering: Because comparators evaluate their input state before updating scheduled ticks, they normally ignore rapid 1-tick power fluctuations (treating a 1-clock as constantly off from the side or constantly on from the rear).

Frequently asked questions

What does the front torch on a Redstone Comparator do?
The front torch indicates the comparator's mode. When the front torch is off (down), the comparator is in Comparison Mode: it passes the rear signal through unless a side input is stronger. When the front torch is on (up), it is in Subtraction Mode: it subtracts the stronger side input from the rear input.
How many items do you need in a hopper for a comparator signal of 2 or 3?
For standard items that stack to 64, a 5-slot hopper outputs signal strength 1 with 1 to 22 items, signal strength 2 with 23 to 45 items, and signal strength 3 starting at 46 items. This 45-to-46 item boundary is what makes standard overflow-proof item sorters work.
Why is my comparator not reading a chest through a block?
First, check if the chest is able to open—if a solid opaque block or a cat is directly on top of a regular chest, the comparator always outputs 0. Second, make sure the block between the chest and comparator is a solid opaque block, and (in Java Edition) isn't already strongly powered to signal strength 15.
What blocks can power the side of a Redstone Comparator?
Unlike the rear input, a comparator's side inputs only accept signals directly from redstone dust, a block of redstone, a redstone repeater, another redstone comparator, or an observer in specific setups. It will not read containers or solid powered blocks from the side.

Related components