Melatonin is released by a small gland deep in your brain called the pineal gland, and the primary trigger is darkness. When light fades in the evening, a chain of signals travels from your eyes through your brain’s internal clock and down into your spinal cord, ultimately telling the pineal gland to start producing melatonin. The process typically begins 12.5 to 17 hours after you wake up, which for most people means sometime between 8 and 10 p.m.
How Darkness Triggers the Release
The process starts in your eyes, but not with the parts you use for vision. A special set of light-sensitive cells in your retina, called intrinsically photosensitive retinal ganglion cells, detect ambient light levels and send that information to your brain’s master clock: the suprachiasmatic nucleus, or SCN, located in the hypothalamus. These cells are most sensitive to blue-wavelength light around 460 nanometers, the kind emitted by screens and LED lighting.
When your environment is bright, the SCN releases an inhibitory chemical signal that shuts down communication to the pineal gland. Melatonin production stops. When darkness arrives, the SCN switches to a stimulatory signal that allows the message to travel onward. That message passes through the hypothalamus, down into the upper spinal cord, and back up through a cluster of nerves in the neck called the superior cervical ganglion. These nerve fibers release norepinephrine directly onto the pineal gland’s cells, and norepinephrine is the final chemical trigger that switches on melatonin production.
Norepinephrine activates specific receptors on pineal cells, which in turn ramp up the enzymes responsible for converting serotonin into melatonin. The key enzyme in this process is called AANAT, and its activity surges at night and drops during the day. This is why melatonin follows a reliable daily rhythm: the entire signaling chain is hardwired to respond to the presence or absence of light.
What Melatonin Is Made From
Your body builds melatonin from tryptophan, an essential amino acid you can only get through food. Tryptophan is first converted into serotonin, and serotonin is then converted into melatonin. Each step requires specific nutrient cofactors to work properly. Vitamin B6 is needed for the conversion of tryptophan’s intermediate form into serotonin. Vitamin D activates the enzyme that handles the first step. Omega-3 fatty acids (EPA and DHA) support the final conversion from serotonin to melatonin.
This means your diet plays a background role in melatonin production. Foods rich in tryptophan include turkey, chicken, fish, eggs, cheese, tofu, quinoa, and pumpkin seeds. Magnesium and potassium, found in bananas, avocados, spinach, and sweet potatoes, support muscle relaxation and may complement melatonin’s sleep-promoting effects. None of these foods will spike your melatonin the way a supplement does, but chronically low intake of tryptophan or its cofactors can limit how much melatonin your body is able to produce.
When Melatonin Peaks and How Long It Lasts
Melatonin doesn’t flood your system the moment the lights go off. In healthy young adults, blood levels begin rising about 14 to 15 hours after waking. The hormone then stays elevated for roughly 9 to 10 hours before dropping back to daytime baseline levels in the morning. People who sleep fewer than 8 hours tend to have shorter melatonin pulses (closer to 9 hours) and lower average concentrations compared to those who sleep 8 hours or more.
Peak concentrations typically occur in the middle of the night, usually between 2 and 4 a.m. for someone on a conventional sleep schedule. This pattern holds even during sleep deprivation, meaning your internal clock drives the rhythm independently of whether you actually fall asleep. However, exposing yourself to bright light at night will suppress the signal and cut melatonin production short.
How Light Suppresses Melatonin
Light is the most powerful suppressor of melatonin, and your eyes are far more sensitive to it than researchers originally thought. Earlier studies set the threshold for melatonin suppression fairly high, but more recent work shows that the specialized light-detecting cells in your retina can respond to intensities much lower than previously believed. Even moderate indoor lighting can partially suppress melatonin output if it hits your eyes at the wrong time.
Blue light in the 460-nanometer range is the most potent suppressor because it matches the peak sensitivity of those specialized retinal cells. This is why screens, fluorescent bulbs, and LED lights are particularly disruptive in the hours before bed. Dimming lights in the evening, using warm-toned bulbs, and reducing screen brightness all help preserve your natural melatonin signal.
Melatonin Production Changes With Age
Melatonin output follows a dramatic arc across a lifetime. Newborns produce almost no melatonin before three months of age, which is one reason their sleep patterns are so erratic. Production then ramps up quickly, reaching its highest nighttime blood levels between ages one and three. From that peak through the rest of childhood, nocturnal melatonin drops by roughly 80%. Adults experience an additional decline of about 10%, concentrated mainly in older age.
This age-related decline happens partly because the SCN itself loses activity over time, weakening the signal that drives the pineal gland. The result is a less robust circadian rhythm, which helps explain why older adults often have more fragmented sleep and earlier wake times. It’s also why melatonin supplements tend to be more commonly used by older populations.
Melatonin Beyond the Pineal Gland
The pineal gland gets most of the attention, but it’s far from the only tissue that produces melatonin. Researchers have detected melatonin and its synthesizing enzymes in the gut, skin, retina, liver, kidney, immune cells, and reproductive organs, among others. Human immune cells called lymphocytes produce melatonin at concentrations up to five times higher than what’s found in nighttime blood plasma.
Unlike pineal melatonin, most of this extrapineal production does not follow a light-dark cycle. Gut melatonin, for example, appears to be driven by food intake rather than the time of day. This locally produced melatonin likely serves different purposes, acting as an antioxidant and immune modulator within those specific tissues rather than as a sleep signal. The melatonin that regulates your sleep-wake cycle comes overwhelmingly from the pineal gland and its light-dependent pathway.

