Since natural populations of guppies, Poecilia reticulata, often differ from one another in social structure, the intensity of sperm competition is likely to vary between localities. Guppies are promiscuous, with female choice for colourful males playing a central role in the mating system. In addition, male guppies use forced copulations to circumvent female choice. Both methods of copulation are used interchangeably by individual males, but the degree to which either is used may depend on the social environment into which males are born. Here we show that male mating behavior varies according to the rearing sex ratio: when reared in male-biased groups, males performed more forced copulations and fewer courtship displays but showed the opposite pattern of behaviour when reared in female-biased groups. Our prediction, based on sperm competition theory, that stripped sperm number would reflect social structure was not supported by our results. Instead, the overall level of sexual activity (gonopodial thrusts+sigmoid displays) was a better predictor of sperm number in the different groups of males. Rearing density, where sex ratio was controlled, did not significantly affect male mating behaviour or sperm traits. Males reared under the different sex ratios continued to show their characteristic behaviour patterns when placed in equal sex ratio tanks. We conclude, therefore, that males adopt mating strategies to suit their social environment, and that these strategies remain fixed, for short periods at least, if population structure changes.