Melatonin is often used for the short-term treatment of insomnia, such as from jet lag or shift work, and is typically taken orally. Evidence of its benefit for this use, however, is not strong.
A 2017 review found that sleep onset occurred six minutes faster with use, but found no change in total time asleep. The melatonin receptor agonist medication ramelteon may work as well as melatonin supplements, at greater cost but with different adverse effects, for some sleep conditions.
In vertebrates, melatonin is involved in synchronizing circadian rhythms, including sleep–wake timing and blood pressure regulation, and in control of seasonal rhythmicity including reproduction, fattening, moulting and hibernation.
Many of its effects are through activation of the melatonin receptors, while others are due to its role as an antioxidant. In plants, it functions to defend against oxidative stress. It is also present in various foods.