Melatonin is a hormone that regulates the sleep-wake cycle. It is primarily released by the pineal gland. As a dietary supplement, it is often used for the short-term treatment of trouble sleeping such as from jet lag or shift work. Evidence of benefit, however, is unclear. One review found onset of sleep occurred six minutes faster with use but found no change in total time asleep. It may work as well as the medication ramelteon. It is typically taken by mouth.

Side effects from supplements are minimal at low doses for short durations. Side effects may include sleepiness, headaches, nausea, diarrhea, and abnormal dreams. Use is not recommended during pregnancy or breastfeeding. Use is also not recommended in those with liver problems.

In animals (including humans), melatonin is involved in synchronizing the circadian rhythm including sleep-wake timing, blood pressure regulation, and seasonal reproduction. 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. Melatonin is also present in various foods.

More Info: en.wikipedia.org