We examined the use of social information in fruitfly larvae, which represent an ideal model system owing to their robust learning abilities, small number of neurons and well-studied neurogenetics. Focal larvae showed attraction to the distinct odour emanating from food occupied by other larvae. In controlled learning experiments, focal larvae preferred novel odours previously paired with food occupied by other larvae over novel odours previously paired with unoccupied food. When we gave groups of larvae a choice between food patches differing in quality, more larvae aggregated on the higher-quality food, suggesting that attraction to and learning about cues associated with other larvae can be beneficial. Furthermore, larvae were more likely to find the best available food patch in trials when that food patch was occupied by other larvae than in trials when that food patch was unoccupied. Our data suggest, however, that the benefits from joining others may be at least partially offset by the fitness costs of increased competition, because larvae reared in isolation did as well as or better than larvae reared in groups on three key fitness parameters: developmental rate, survival rate and adult dry body mass. Our work establishes fruitfly larvae as a highly tractable model species for further research on the mechanisms that modulate behaviour and learning in a social context.