A tamper has one job: press the coffee into a level, even puck across the whole basket. So it has to match your basket's diameter — a tamper that's too small leaves an untamped ring around the edge where water channels straight through, and one that's too big won't enter the basket at all. The rule is simple: buy the tamper size that matches your portafilter.
Tampers are sold by the portafilter standard they're made for. The four you'll meet on common machines:
A snug tamper is worth it: the closer it is to the basket's inner wall, the more even the puck. Precision tampers are cut a hair under the nominal size (e.g. 58.35mm for a 58mm basket) for exactly that reason — but you still buy them by the nominal size, so a "58mm" machine takes a "58mm" tamper.
Not sure of your size? The parts finder shows the tamper and baskets that fit once you pick your machine, or browse all tampers.
Each tamper's size and fitment is quoted from the maker's own listing on its entry. See how we verify compatibility or the portafilter sizes guide.