Taking cannabis doubles the risk of men under 30 producing abnormal sperm which could significantly lower their fertility and prevent them from having children, according to the world’s largest study into lifestyle and sperm quality.

Researchers found that drinking alcohol and smoking cigarettes do not appear to have any effect on the size and shape of sperm that men produce, although cannabis had a marked impact on sperm morphology in younger men.

“If you are a man trying for a baby then the sensible thing to do is to stop smoking joints but the effect won’t be seen overnight,” said Allan Pacey of Sheffield University, a specialist in male fertility at Sheffield University.

Download the new Independent Premium app Sharing the full story, not just the headlines

“It takes three months to produce sperm so you can’t stop smoking cannabis on Friday and expect to see an improvement on Monday. You’ve got to stop in June to see an improvement in August,” said Dr Pacey, who led the study published in the journal Human Reproduction.

It is not known whether or how cannabis has a direct effect on sperm production, or if the link is the result of an association with some other unknown factor. However, the fact that the association is not seen in men over 30 suggests the effect is linked to cannabis exposure, Dr Pacey said.

“We found that cannabis doubled the risk of men under 30 having poor sperm – statistically it jumped out of the analysis. I think it’s a real effect, and it’s not been shown before in such a robust way,” he said.

“The fact that we see this in younger men suggests that we are seeing a dose effect. Younger men may be more inclined to smoke cannabis more frequently and in higher doses than older men,” he added.

The study involved a computer-based analysis of ejaculates collected from 318 men who attended 14 fertility clinics around the UK with their partners. A separate team of researchers interviewed the men about their lifestyle, including details about smoking, drinking and drug use.

Previously, the researchers had looked at sperm numbers and found that men who regularly wore tight underwear had significantly lower sperm counts – sperm production in the testes is affected by high temperatures and the retention of body heat.

The latest study looked at the overall shape and size of individual sperm, which is known to affect their motility or ability to swim. Sperm with poor swimming ability are unlikely to pass beyond the cervix of the womb and so will not be able to fertilise a woman’s egg following sex, Dr Pacey explained.

The study failed to find any link between sperm quality and other factors such as obesity, tight underwear, smoking, drinking or a history of having mumps. Only cannabis, frequent ejaculation and summer-time ejaculation were linked with poor sperm morphology.

“Our knowledge of factors that influence sperm size and shape is very limited, yet faced with a diagnosis of poor sperm morphology, many men are concerned to try to identify any factors in their lifestyle that could be causing this,” Dr Pacey said.

“It is therefore reassuring to find that there are few identifiable risks, although our data suggests that cannabis user might be advised to stop using the drug if they are planning to try and start a family,” he said.

The scientists used World Health Organisation definitions of sperm quality to assess the men’s ejaculates. The WHO says that a man’s sperm quality is considered to be normal if more than four per cent of the sperm in an ejaculate are the correct shape and size.

Other researchers have found that sperm quality can be affected by exposure to paint strippers and lead.