A tamper compresses the dose into an even puck. The number that matters is the base diameter, which must match the basket's internal diameter: a 58mm machine wants a 58 / 58.4mm base, a 54mm Breville a ~53.3mm base, a 57mm Lelit a 57mm base. A tamper a millimetre too large won't reach the coffee; too small and it leaves an untamped ring the water races around. Match the base to the basket, not to the portafilter's outer size.
New to sizing? See espresso portafilter sizes explained, or browse all part types.