Comparator signal strength from containers: the formula and the stack-size trap
A chest with one item outputs signal 1, but so does a chest with sixty-three. The formula explains why, and why shulker boxes and buckets break every calculation you had.
Reading a container with a comparator is the backbone of most item-sorting and auto-crafting redstone. The formula is short, and every quirk falls out of it.
The formula
signal = floor(1 + (sum of fullness across slots ÷ number of slots) × 14)
where each slot's fullness is items in slot ÷ max stack size for that item.
The 1 + is the important part: any non-zero content produces at least signal 1, and an empty container is 0. That is why detecting "is there anything at all in here" is trivial, and detecting "exactly how much" is not.
Why one item and sixty-three both give 1
A double chest has 54 slots. One stack of 64 cobblestone fills one slot completely:
1 + (1 ÷ 54) × 14 = 1 + 0.259 = 1.259 → floor = 1
You need four full stacks before the output reaches 2. The classic single-item detector works because 1 is the floor for any content, not because it measures one item.
Stack size changes everything
max stack size is per item, and this is where calculations break:
| Item | Stack | One item gives |
|---|---|---|
| Cobblestone | 64 | 1/64 of a slot |
| Ender pearl | 16 | 1/16 |
| Bucket, minecart, boat | 1 | a whole slot |
A single-slot hopper holding one bucket reads full — signal 15. That is the standard trick for a precise counter: fill 4 of a hopper's 5 slots with non-stackables and use the fifth as the signal.
Shulker boxes are not transparent
A comparator reading a chest that contains a shulker box sees the box as one item occupying one slot. It does not see inside. Sorting systems that assume otherwise silently miscount.
Non-container comparator reads
The same comparator also reads:
| Block | Signal |
|---|---|
| Cauldron | 0–3 by water level |
| Composter | 0–8 by fill stage |
| Cake | 14 down to 0 per slice eaten |
| Item frame | 1–8 by rotation |
| Jukebox | 1–15 by which disc |
| Lectern | page number |
| Beehive | 0–5 honey level |
| End portal frame | 15 with eye, 0 without |
Item frames and lecterns are the useful ones for hidden switches, because they read through a wall.
Subtract mode
The front torch lit means subtract mode: output is side-subtracted-from-back, floored at 0. Compare mode (torch unlit) passes the back signal through only if it is at least as strong as the strongest side.
Enter a container's contents and get the exact signal, including mixed stack sizes, in the Reference & Calculators — Set 2.