Redstone · Mechanic · Java & Bedrock
How to Use a Redstone Comparator
The comparator is the redstone block that reads things. Point a container at it and it outputs a signal that grows with how full the container is, from 0 to 15. That one trick powers item sorters, full-chest alarms and clocks.
ComparatorCompare modeSubtract mode
A comparator reads how full a container is and outputs a redstone signal from 0 (empty) to 15 (full). Watch the barrel fill and the signal climb.
The two modes
Right-click the comparator to flip between them. The front torch tells you which mode you are in.

Compare (torch off)
Passes the back signal straight through, unless a stronger signal comes in from the side, in which case it outputs nothing.

Subtract (torch on)
Takes the back signal and subtracts the stronger of the two side inputs, so it outputs back minus side.
What it can read
Behind a container, the output strength equals how full that container is.
Hoppers & droppers
Furnaces & smelters
Brewing stands
Cake slices left
Cauldron level
Lectern page numberHow the signal scales
Signal strength tracks fullnessnot item count alone. A single item in a double chest still gives a signal of 1; you need it almost completely full to reach 15. Stack a comparator on a chest of unstackable items and even a few of them push the signal up fast, which is the trick behind compact item sorters.
Quick answers
What does a redstone comparator do?
It reads how full a container is, or the state of certain blocks, and turns that into a redstone signal from 0 to 15. It can also compare or subtract two signals. Unlike a repeater it does not need to be powered to send an output.
How do you switch a comparator to subtract mode?
Right-click it. The front torch lights up to show subtract mode; right-click again to go back to compare mode (front torch off).
What can a comparator read?
Container fullness (chest, barrel, hopper, dropper, dispenser, furnace, brewing stand, shulker box), plus cake slices, cauldron and composter levels, a lectern page, beehive honey, a jukebox disc, item frame rotation and the end portal frame.
How does a comparator measure a chest?
The signal scales with how full the container is. A single item gives a weak signal of 1, and a completely full double chest gives the maximum of 15. That is how item sorters and full-storage alarms work.
Comparator vs repeater, what is the difference?
A repeater delays, repeats and can lock a signal, and only passes power forward. A comparator reads blocks and compares or subtracts signals, keeps signal strength instead of resetting it to 15, and outputs on its own.
Which side of a comparator is the output?
The end with the single front torch (where the arrow points) is the output. The two inputs come into the back and the side.
Two modes, and a container reader
Compare mode passes or blocks
In its default mode the comparator lets the back signal through only if it is stronger than whatever comes in the sides. That is the whole comparison: it is not a logic gate you configure, it is a gate that answers one question about signal strength.
Subtract mode does arithmetic
Click it and the front torch lights, and now the output is the back signal minus the strongest side signal. Chaining two subtract comparators is how most analogue redstone counts, and it is the reason a comparator is worth understanding before a repeater.
It reads what is behind it
Point one at a chest, a furnace, a hopper, a cauldron, a lectern or a beehive and it outputs a level based on how full that block is. Almost every automatic system that reacts to storage is built on that single behaviour.