When an animal has a choice of joining one group over another, its decision may depend on its relative vulnerabilities to predation and starvation. For example, a well-fed animal may choose a large group of individuals with body size matching its own because this gives good protection against predators, but a hungry animal may prefer smaller groups made up of smaller individuals because this decreases food competition. To test this idea, a choice between various shoals was given to golden shiners, Notemigonus crysoleucas, that were either well fed or deprived of food for 48 h. In a choice of 10 vs. 3 shoalmates, both well-fed and hungry shiners spent more time near the shoal of 10. In a choice of 20 vs. 3 shoalmates, both well-fed and hungry shiners again preferred the larger shoal, but in one replicate this preference was significantly weaker in the hungry fish. This reduced preference did not appear to be an artefact of increased mobility by hungry fish searching for food. In a choice between shoals of small vs. large conspecifics, small well-fed shiners, small hungry shiners, and large well-fed shiners preferred shoalmates with body size matching their own, but large hungry shiners preferred smaller individuals. These results are consistent with the hypothesis that hungry fish sacrifice safety from predation in their shoaling behaviour (by avoiding larger groups to a certain extent and by risking the oddity effect) so as to decrease food competition.