Melatonin is a hormone that regulates the sleep–wake cycle. It is primarily released by the pineal gland. As a supplement, it is often used for the short-term treatment of trouble sleeping such as from jet lag or shift work.
Melatonin is most commonly used for insomnia and improving sleep in different conditions. For example, it is used for jet lag, for adjusting sleep-wake cycles in people whose daily work schedule changes (shift-work disorder), and for helping people establish a day and night cycle.
Melatonin’s main job in the body is to regulate night and day cycles or sleep-wake cycles. Darkness causes the body to produce more melatonin, which signals the body to prepare for sleep. Light decreases melatonin production and signals the body to prepare for being awake. Some people who have trouble sleeping have low levels of melatonin. It is thought that adding melatonin from supplements might help them sleep.