Male sexual harassment has been demonstrated to result in high costs for females. Male mosquitofish are amongst the most ardent in the animal kingdom and sexual harassment can halve female foraging efficiency. Female mosquitofish have been found to vary their shoaling behaviour when harassed by a male, approaching other males to promote male–male interactions or reducing the distance to another female to dilute male disturbance. The present study tested two predictions about female counterstrategies. As the dilution effect increases with group size, a harassed female was expected to prefer joining a larger group. She should also benefit from joining larger females since males are known to prefer larger mates. When given a choice between a group of two and a group of four females, females harassed by a male spent significantly more time near the larger group. Harassed females also preferred a shoal consisting of larger females over one consisting of smaller females, but no such preferences were observed in the absence of a male. In addition to influencing the individual decision whether to shoal or not, the presence of a harassing male appears to affect group choice. In these fish, sexual harassment might be a powerful factor in shaping both the structure and the composition of shoals.