The aim of this paper was to explore if, and in that case how, various preventive measures against mastitis influenced the whole-farm economic outcome, measured as technical efficiency, of a sample of specialised dairy farms in Sweden. In particular, the paper aimed at analysing whether a change to preventive measures applied by fully efficient farms would be a way for inefficient farms to become fully efficient. First, technical efficiency was assessed for each farm in the sample based on farm-level accounting data and the data envelopment analysis. In a second step, the effects of preventive measures against mastitis (collected through a mail questionnaire) on technical efficiency were assessed with logistic regression. Keeping cows in a loose-housing barn, stimulating udders manually during milking, and having cows standing on clean bedding during milking were found to significantly increase the probability of a farm being fully efficient. Once the farmer considers the somatic cell count (SCC) to be too high, undertaking measures such as contacting a veterinarian, checking overall hygiene routines, and culling cows with high SCC were found to significantly increase the probability of a farm being fully efficient. Thus, these measures may be plausible targets for advisory services aimed at assisting farmers to become fully efficient, especially if they are confirmed in future studies. Several common preventive measures against mastitis, that is, choice of bedding material, frequency of cleaning stalls, pre-milking, post-milking teat disinfection, applying a milking order based on the SCC of cows, and milking high-SCC cows with a separate cluster, were found to have no statistically significant effect on farm economic outcome. However, these measures may still be valuable for non-economic goals, such as increased animal welfare, and the results imply that they can be implemented without negative impact on the economic performance of the farm.