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
1to15based on the open book's current page:floor(1 + ((current page − 1) / (total pages − 1)) × 14). A 1-page book always outputs15; a 15-page book outputs the exact page number (1 to 15). - Composter: Outputs
0when empty, and1through8corresponding to its fill level. - Cauldron: Outputs
0when empty, and1,2, or3based on water or powder snow depth. A lava cauldron always outputs3. - Chiseled Bookshelf: Outputs
1to6indicating the last slot interacted with (0if none has been touched yet). - Beehive and Bee Nest: Outputs
0to5equal to the current honey level. - Cake: Outputs
2per remaining slice (14for an uneaten 7-slice cake, down to0when eaten). - Item Frame: When placed behind the full solid block an item frame is attached to, outputs
0if empty, or1to8based 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
0when empty, or1to15depending 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, or15based on its charge level. - End Portal Frame: Outputs
15if it holds an Eye of Ender, or0if 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
0even 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).
