Social preferences for specific colour patterns learned in early development, termed imprinting, may influence social and mating decisions. Imprinting has been demonstrated in both birds and fish and has been proposed to play a role in speciation. We raised wild-type zebrafish, Danio rerio, either with individuals of the same colour pattern, an alternative colour pattern (leopard), or a closely related, unpatterned species, D. albolineatus. We also cross-reared individual ‘leopard’D. rerio and D. albolineatus with wild-type D. rerio. We tested the prediction that Danio would prefer to shoal with fish of the colour pattern with which they had been raised, irrespective of their own appearance. Rearing condition affected shoaling preferences between D. rerio and D. albolineatus, with individuals of both colour patterns preferring to associate with shoals of the colour pattern with which they had been raised. The more subtle distinction between the wild-type and ‘leopard’D. rerio colour patterns did not elicit a shoaling preference. Thus, zebrafish exhibit shoaling preferences based on visual cues, the effect being stronger when patterns are more distinct. There is a strong learned component to these preferences, although the extent to which they may influence mating decisions is unclear.