Melatonin is the body’s darkness signal. The brain’s internal clock releases it at night, light shuts it off, and it tells you when to sleep instead of knocking you out the way a sleeping pill does. Serotonin is the raw material the body turns into melatonin, which is why the two are so often mentioned together. But serotonin’s own job in the brain points almost the opposite way: it keeps you alert and holds back dreaming sleep. Because the two are linked, changing one can ripple into the other, and that helps explain why light, supplements and antidepressants each affect sleep so differently.
How Your Body Makes Melatonin at Night
Most of the melatonin in your blood comes from the pineal gland, a pea-sized gland deep in the brain. The process starts with tryptophan, an amino acid found in protein foods, which the body turns into serotonin. Two enzymes then convert serotonin, first into an in-between compound and then into melatonin.1PubMed Central. Interactions of Tryptophan and Its Catabolites With Melatonin and the Alpha 7 Nicotinic Receptor in Central Nervous System and Psychiatric Disorders: Role of the Aryl Hydrocarbon Receptor and Direct Mitochondria Regulation So how much melatonin you can make depends partly on how much serotonin is available and how fast it gets broken down.1PubMed Central. Interactions of Tryptophan and Its Catabolites With Melatonin and the Alpha 7 Nicotinic Receptor in Central Nervous System and Psychiatric Disorders: Role of the Aryl Hydrocarbon Receptor and Direct Mitochondria Regulation One of those enzymes is the step that rises and falls each day, and that swing sets melatonin’s nightly rhythm.2PubMed Central. Mechanism-based inhibition of the melatonin rhythm enzyme: Pharmacologic exploitation of active site functional plasticity A protein-rich dinner isn’t a switch for sleep: the available serotonin sets how much there is to work with, while the clock decides when production happens.
That clock sits in the hypothalamus, just above where the optic nerves cross, and it drives nighttime melatonin.3PubMed. Generation of the melatonin endocrine message in mammals: a review of the complex regulation of melatonin synthesis by norepinephrine, peptides, and other pineal transmitters It tells nerves running to the pineal gland to release a chemical messenger that triggers production at night.3PubMed. Generation of the melatonin endocrine message in mammals: a review of the complex regulation of melatonin synthesis by norepinephrine, peptides, and other pineal transmitters When those nerves are cut, light no longer has any effect on melatonin.4PubMed. Melatonin Synthesis in the Pineal Gland: Effect of Light Mediated by the Sympathetic Nervous System
The result is a predictable nightly curve. Levels stay very low through the day, begin climbing in the evening a couple of hours before your usual sleep time, peak in the middle of the night, and fall back near your usual waking time.
This is also why melatonin gets mislabeled as a sedative. It rises at night in nocturnal animals too, when they are busiest, so it signals darkness rather than sleepiness itself. In people, it opens a window in which sleep comes more easily.
How Light Turns Melatonin Off
The clock gets its light information mainly from a small set of light-sensitive cells in the retina, separate from the ones you use for seeing.5PubMed. Intrinsically Photosensitive Retinal Ganglion Cell Dysfunction and Suprachiasmatic Nucleus-Mediated Circadian Disruption in Humans: A Systematic Review These cells contain a pigment most sensitive to blue light, which is why blue light matters most for melatonin.6PubMed. The spectral composition of evening light and individual differences in the suppression of melatonin and delay of sleep in humans In people with advanced glaucoma or diabetic eye disease that damages these cells, melatonin drops, its evening rise shifts, and light stops suppressing it.5PubMed. Intrinsically Photosensitive Retinal Ganglion Cell Dysfunction and Suprachiasmatic Nucleus-Mediated Circadian Disruption in Humans: A Systematic Review
The color of evening light makes a measurable difference. After 2 hours under blue LED light, melatonin was about 7.5 pg/mL, compared with 26 pg/mL under red light.7PubMed Central. Comparative Effects of Red and Blue LED Light on Melatonin Levels During Three-Hour Exposure in Healthy Adults A lamp tuned to give off less blue cut melatonin suppression to about 25%, versus about 57% under ordinary fluorescent light.8PubMed Central. The effects of spectral tuning of evening ambient light on melatonin suppression, alertness and sleep Evening light also delayed sleepiness and the moment people fell asleep.6PubMed. The spectral composition of evening light and individual differences in the suppression of melatonin and delay of sleep in humans Some people are much more sensitive to evening light than others, and that sensitivity stays consistent in each person.6PubMed. The spectral composition of evening light and individual differences in the suppression of melatonin and delay of sleep in humans
Those sensors respond to brightness and color together, so brightness matters as much as color. A bright white kitchen or bathroom can matter more than a dim phone, and even a short burst of bright light at night can lower melatonin. Feeling sleepy on the couch under bright lights is not a reliable sign that melatonin has started rising; the clock may still be getting a daytime signal.
Blue-blocking glasses and night modes help, but the lamp result shows suppression fell only to about 25%, not to zero. A warm-toned screen that is still very bright keeps sending a signal, so lowering brightness matters alongside changing color.
In practice, that means dimming overhead lights in the last two hours before bed, using warm or amber bulbs and night modes on phones, and getting bright light in the morning, which helps set the clock earlier. If you sleep badly after screen time, you may be one of the more sensitive people.
Serotonin’s Real Role, Wakefulness and Dreaming Sleep
The brain’s main serotonin cells sit in a cluster in the brainstem. These cells fire steadily while you are awake, slow down in deep sleep, and stop during REM sleep, the stage when most vivid dreams happen.9bioRxiv. Oscillatory population-level activity of dorsal raphe serotonergic neurons sculpts sleep structure The same pattern appears across rats, cats, monkeys and dogs.10The Journal of Physiology. Activity of dorsal raphe cells across the sleep–waking cycle and during cataplexy in narcoleptic dogs For the brain itself, serotonin behaves more like a wake signal than a sleep signal.
It also acts as a brake on dreaming sleep. Serotonin cells send signals to the brainstem areas that switch REM sleep on, and quiet them.11PubMed Central. Parasomnias and Antidepressant Therapy: A Review of the Literature That means REM sleep can begin only when serotonin activity falls away.11PubMed Central. Parasomnias and Antidepressant Therapy: A Review of the Literature Seen this way, a night runs like this: as you fall asleep, serotonin activity drops; in deep sleep it runs low; as dreaming sleep begins it goes almost silent; and on waking it climbs again.
The picture is not simple, though. Depending on where in the brain serotonin acts, it can increase wakefulness, deep sleep, or dreaming sleep.12PubMed. Changes in sleep and wakefulness following 5-HT1A ligands given systemically and locally in different brain regions Its effect depends on which cells receive it and which receptors they carry.
That also resolves the apparent contradiction with melatonin. In the pineal gland, serotonin is raw material, turned into melatonin at night. In the brainstem, it is a messenger that supports alertness.
Does Taking Melatonin Help You Sleep
Across trials, melatonin shortens the time to fall asleep and lengthens total sleep, with benefits leveling off around 4 mg a day.13PubMed. Optimizing the Time and Dose of Melatonin as a Sleep-Promoting Drug: A Systematic Review of Randomized Controlled Trials and Dose-Response Meta-Analysis People with insomnia tended to see bigger improvements in how fast they fell asleep.13PubMed. Optimizing the Time and Dose of Melatonin as a Sleep-Promoting Drug: A Systematic Review of Randomized Controlled Trials and Dose-Response Meta-Analysis In healthy older adults, 5 mg before bed added about 25 minutes of sleep.14PubMed Central. High dose melatonin increases sleep duration during nighttime and daytime sleep episodes in older adults A low 0.3 mg dose did not reliably add sleep time in older adults,14PubMed Central. High dose melatonin increases sleep duration during nighttime and daytime sleep episodes in older adults so they may need a somewhat higher dose than younger people. Gains are measured in minutes, not hours, and melatonin won’t override a bright, late screen habit.
Timing is the key lever: when melatonin is taken matters more than how much.15PubMed. Sleep-inducing effects of exogenous melatonin administration Taking it about 3 hours before bedtime worked better than the common habit of 30 minutes before.13PubMed. Optimizing the Time and Dose of Melatonin as a Sleep-Promoting Drug: A Systematic Review of Randomized Controlled Trials and Dose-Response Meta-Analysis Taken earlier, it works more like a clock signal, telling the brain night is coming sooner. If the usual habit hasn’t helped, change the timing before raising the dose.
The effect on the clock depends on the hour. Taken in the afternoon, melatonin moves the body clock earlier by up to about 1.8 hours.16The Journal of Physiology. A three pulse phase response curve to three milligrams of melatonin in humans Taken around the usual waking time, it pushes the clock later.16The Journal of Physiology. A three pulse phase response curve to three milligrams of melatonin in humans
So for trouble falling asleep, try a dose a few hours before bed. For jet lag or a too-late body clock, early evening dosing shifts you earlier. If you wake in the early morning, avoid taking it then, since a dose near your waking time can shift your clock later. Talk to a doctor before long-term use or if you are pregnant.
More is not better: benefits leveled off around 4 mg a day. A higher dose also stays in the body longer, which can leave melatonin present into the next morning, working against your wake-up timing. Starting low and adjusting the time is a sensible approach for most adults.
Can Boosting Serotonin With 5-HTP or Diet Help
5-HTP is the step between tryptophan and serotonin, sold as a supplement. In older adults, 12 weeks of 5-HTP raised blood serotonin and improved some aspects of sleep quality.17PubMed. The impact of 5-hydroxytryptophan supplementation on sleep quality and gut microbiota composition in older adults: A randomized controlled trial The benefit showed up in poor sleepers, not in people already sleeping well.17PubMed. The impact of 5-hydroxytryptophan supplementation on sleep quality and gut microbiota composition in older adults: A randomized controlled trial That describes steady use over months in older adults, not a single dose for a bad night.
5-HTP is not the same as eating protein. It sits one step past tryptophan, so a supplement skips the first step the body would normally control. Food tryptophan has to compete with other amino acids to enter the brain, which keeps the effect of a meal small. Food sources of tryptophan include eggs, dairy, poultry and nuts. A supplement can raise serotonin more directly, which is also why it carries more risk. It should not be combined with antidepressants without a doctor, because of the danger of serotonin overload.
Most of the body’s serotonin is made in the gut, where it helps move food along.18News-Medical. Can Lack of Sleep Change Your Gut Microbiome? Gut serotonin does not easily enter the brain, though it can influence sleep indirectly through nerves and immune signals.18News-Medical. Can Lack of Sleep Change Your Gut Microbiome? Substances made by gut bacteria from fiber can increase gut serotonin production.19PubMed Central. Influence of Tryptophan and Serotonin on Mood and Cognition with a Possible Role of the Gut-Brain Axis
How Antidepressants Change Sleep
SSRIs, a common antidepressant type that includes sertraline and fluoxetine, raise serotonin levels in the brain. They do this by blocking cells from taking serotonin back up, so more of it stays active between nerve cells. Because serotonin holds back dreaming sleep, SSRIs and similar drugs delay and reduce it and can make sleep more broken.20PubMed Central. Effects of Antidepressants on Sleep Keeping serotonin elevated holds the REM brake on. SSRIs have been linked to more nighttime awakenings.11PubMed Central. Parasomnias and Antidepressant Therapy: A Review of the Literature Sedating antidepressants work differently: they help people fall asleep faster, sleep more deeply, and usually leave dreaming sleep alone.20PubMed Central. Effects of Antidepressants on Sleep Sleep effects often show up early, so changes in the first weeks are worth noting.
If your sleep changes on an antidepressant, tell your prescriber rather than stopping suddenly. Ask whether taking the dose in the morning could help, and whether switching to a more sedating option is possible. Vivid dreams after stopping can reflect dreaming sleep returning.
Why Melatonin and Sleep Change With Age
The pineal gland collects calcium deposits over the years, visible on brain scans. The age-related drop in melatonin can largely be explained by how calcified the gland has become.21Neuropsychopharmacology. A New Concept for Melatonin Deficit: On Pineal Calcification and Melatonin Excretion More calcification may mean a weaker nightly melatonin signal and less steady sleep timing, with daytime tiredness as a main symptom.22PubMed. On pineal calcification and its relation to subjective sleep perception: a hypothesis-driven pilot study Older brains may also respond less strongly to melatonin, consistent with the higher dose older adults needed.14PubMed Central. High dose melatonin increases sleep duration during nighttime and daytime sleep episodes in older adults The signal is blunted, not absent, which is why timed light and routine can still help. Sleep also changes with age for other reasons, such as health conditions and medicines, so a supplement won’t necessarily solve it.
Useful steps include getting bright daylight early in the day to strengthen the clock and keeping a regular bedtime and wake time. A doctor can discuss a melatonin trial at the doses that worked in older adults. Eye conditions like glaucoma are worth having managed, since they can affect sleep timing.
Melatonin Before Birth
A fetus has no pineal rhythm of its own to follow and cannot see light, so it depends on signals from the mother. Her melatonin rises through pregnancy and passes readily to the fetus.23PubMed. Melatonin in Pregnancy: Effects on Brain Development and CNS Programming Disorders The fetus therefore experiences low melatonin by day and high at night, which helps set its organs’ rhythms.24PubMed Central. Role of melatonin in embryo fetal development In monkeys, constant light during pregnancy suppressed melatonin and left newborns with disrupted body-temperature rhythms.25PubMed Central. Riding the Rhythm of Melatonin Through Pregnancy to Deliver on Time
For expectant parents, keeping nights dark and days bright supports the mother’s melatonin rhythm. Melatonin supplements in pregnancy should wait for medical advice.

