Jet lag can be more than just an inconvenience for long-distance travellers. Arriving in a far-off destination where the time no longer matches your internal body clock can trigger insomnia, lethargy and reduced alertness. Which is hardly ideal if you are delivering an important presentation or trying to seal a big deal.

There is little surprise, then, that growing numbers of people are popping pills to counter the effects of jet lag. A government survey published last year found that 3.1 million Americans – 1.3% of the population – take melatonin supplements for jet lag and other sleep problems. Its use more than doubled in the US between 2007 and 2012.

Melatonin use is less common in the UK, where it is only licensed in slow-release form to treat sleep disorders in those aged 55 or over, and can’t be bought over the counter. Supplements are sometimes prescribed off-label to children with sleep problems associated with conditions including attention deficit hyperactivity disorder (ADHD) and autism.

Brits who frequently travel long distances report stocking up on melatonin in the US and Canada, where it can be bought as a nutritional supplement without the need to see a doctor. Others, including shift workers who need help getting to sleep during the day, get their supplies from online pharmacies.

All of which begs a number of questions: does melatonin work? Is it safe? And, if so, how should it be taken?

The first thing to know about melatonin is that it is a hormone made by the pea-sized pineal gland deep within the brain. Its production is triggered by darkness and inhibited by light.

Scientists are keen to correct a frequently repeated misconception. “Melatonin is most emphatically not a sleep hormone,” says Russell Foster, professor of circadian neuroscience at the University of Oxford. “It is a biological marker of darkness.” In humans and other diurnal animals, the release of melatonin into the bloodstream helps prepare the body for sleep. In nocturnal animals, however, it can signal breakfast time. The duration of melatonin release also helps animals keep track of the seasons, telling deer when to grow their winter coat or find a mating partner, for example.

Melatonin was first harvested from bovine pineal glands as a potential skin-disease treatment in the 1950s, before being produced synthetically in the 90s.

Scientists are divided over the effectiveness of melatonin supplements to counter sleeping problems, and the picture has been clouded by controversy over doses. Researchers at MIT, in Cambridge, Massachusetts, who originally patented synthetic melatonin as a sleeping aid in 1995, reported the ideal dose to be between 0.3mg and 1mg, and argued that prolonged use of larger doses could change how the body responds to the hormone, potentially undermining sleep. A 2013 combined analysis of 19 previous studies found that people with serious insomnia fall asleep on average seven minutes sooner and sleep eight minutes longer when given melatonin than when taking placebos.

There is no scientific consensus on precisely how melatonin might bring on sleep more quickly, but some researchers believe it does so at least partly by dilating blood vessels near the skin, which in turn lowers body temperature.

“Melatonin has a transient soporific effect that can make people go to sleep a bit earlier,” says Debra Skene, professor of neuroendocrinology at the University of Surrey. “We’ve shown in trials, as have other groups, that by lowering your core body temperature, it can make you a bit more sleepy.”

Skene is ambivalent about the use of melatonin for insomnia, saying it can induce sleep more quickly but not by much. Having studied the circadian system for more than 25 years, however, she does believe it can be used to help re-align the internal body clock with the Earth’s day-night cycle when they fall out of sync.

Even when deprived of external time cues, humans maintain a sleep-wake cycle that lasts, on average, a little more than 24 hours. Skene and colleagues have demonstrated in tests on blind people how melatonin can help reset the internal body clock to prevent it getting out of sync with the Earth’s 24-hour cycle. “We know melatonin can be used to shift the body clock,” adds Skene. “If you are dealing with a condition that involves abnormal clock timing, as with shift work, jet lag, and in some cases blindness, then melatonin could be potentially useful.”

Skene points out, however, that shift workers who try to use melatonin to sleep during the day could struggle to find the right time to take it, and warns it could increase drowsiness among people who drive after taking it.

A 2002 Cochrane review – the gold standard in healthcare evidence – found melatonin can be effective against jet lag. The analysis of 10 previous studies found that people crossing five or more time zones who take melatonin close to bedtime at their destination had less severe symptoms than those taking placebos. Those travelling east, crossing more time zones and taking higher doses of close to 5mg, saw the greatest benefits. However the authors warned of possibly harmful side effects for people with epilepsy and those taking the blood-thinning drug warfarin.

Foster does not advocate using melatonin for jet lag, having tried it several times following flights from London to Australia. “It’s hard to know when to take it, and unless you know precisely where your internal clock is, there’s a danger of shifting it in the wrong direction.” Instead, he uses changes to light exposure, seeking out light when flying west and, when flying east, avoiding morning light and seeking out afternoon light for the first few days after arrival.

Scientists also point out that melatonin bought as a nutritional supplement is not subject to the same strict standards as prescription medicines, and that it can be hard to be sure of the content of medicines bought online.