
Your body makes melatonin through a series of biochemical steps that begin with the amino acid tryptophan. Tryptophan is converted to 5-HTP, then serotonin, N-acetylserotonin, and finally melatonin, mainly in the pineal gland. Your circadian clock and the light-dark cycle determine when this pathway becomes much more active, which is why melatonin normally rises at night.
Table of Contents
How Does Your Body Make Melatonin?
Melatonin may be best known as the hormone associated with nighttime and sleep, but your body does not simply switch it on when you get into bed.
It has to make it.
The process begins with tryptophan, an essential amino acid that you obtain from your diet. Through several enzyme-controlled reactions, tryptophan is converted into 5-hydroxytryptophan (5-HTP), then serotonin, then N-acetylserotonin, and finally melatonin.
The simplified pathway looks like this:
Tryptophan
↓
5-Hydroxytryptophan (5-HTP)
↓
Serotonin
↓
N-Acetylserotonin
↓
Melatonin
But there is another part of the story that is just as important.
Your body needs to know when to make more melatonin.
That timing comes largely from the circadian system, which receives information about light and darkness through the eyes and coordinates signals to the pineal gland. At night, this system allows the melatonin-producing pathway to become much more active.
So natural melatonin production is really the combination of biochemistry and biological timing.

Where Is Melatonin Produced?
The pineal gland is the main source of the melatonin that enters your bloodstream and follows the familiar nighttime rhythm.
It is a small endocrine gland located deep within the brain, in a region called the epithalamus. The cells responsible for producing melatonin are called pinealocytes.
At night, these cells receive signals from the body’s circadian system that increase the activity of the enzymes involved in melatonin synthesis. The newly produced melatonin is then released into the circulation, allowing it to reach tissues throughout the body.
The pineal gland is not the only place where melatonin can be produced.
Researchers have found melatonin synthesis in several other tissues, including parts of the gastrointestinal tract and the retina. These local sources may have functions within their respective tissues.
However, that should not be confused with the pineal gland’s role in the nighttime rise of circulating melatonin.
For the purpose of understanding your sleep-wake cycle, the pineal gland is the key player.
What Does the Body Need to Make Melatonin?
The starting material is tryptophan.
Tryptophan is an essential amino acid, which means your body cannot make enough of it on its own and must obtain it through food.
But eating tryptophan does not mean that the same amount will automatically become melatonin.
Tryptophan has many jobs in the body and is involved in several metabolic pathways. Only a portion enters the pathway that eventually leads to melatonin.
The pathway is:
Tryptophan → 5-HTP → Serotonin → N-Acetylserotonin → Melatonin
Each step requires specific enzymes, and the activity of these enzymes is regulated by the body’s physiology and circadian timing.
That is why it is too simplistic to say:
“Eat more tryptophan and your body will make more melatonin.”
Nutrition provides the raw materials needed for normal physiology, but melatonin production is a regulated biological process, not simply a matter of having more of one ingredient available.
Step 1: Tryptophan Becomes 5-HTP
The first major step begins with tryptophan.
An enzyme called tryptophan hydroxylase (TPH) adds a hydroxyl group to tryptophan, producing 5-hydroxytryptophan, commonly called 5-HTP.
You do not need to remember the chemical reaction to understand its importance.
Think of tryptophan as the starting material and 5-HTP as the next intermediate in the pathway.
The important point is that melatonin production does not begin directly with serotonin. There are biochemical steps upstream of serotonin, beginning with tryptophan.
The pathway at this stage is:
Tryptophan
↓
5-HTP
From there, the pathway moves toward serotonin.
Step 2: 5-HTP Becomes Serotonin
The next step converts 5-HTP into serotonin, also known as 5-hydroxytryptamine or 5-HT.
This reaction involves an enzyme called aromatic L-amino acid decarboxylase (AADC).
Serotonin is probably more familiar to you than 5-HTP because it has many important functions throughout the body and brain.
But in the context of this article, serotonin has another important role:
It is a precursor for melatonin.
That does not mean serotonin is simply stored in the pineal gland waiting to become melatonin.
Serotonin has its own biological functions and participates in many processes. Only some of it enters the pathway toward melatonin, and that conversion is strongly influenced by enzyme activity and circadian signaling.
The pathway now looks like:
Tryptophan
↓
5-HTP
↓
Serotonin
The next two reactions are the steps that bring us much closer to melatonin itself.
Step 3: Serotonin Becomes N-Acetylserotonin
This is a particularly important step in the regulation of melatonin production.
An enzyme called arylalkylamine N-acetyltransferase (AANAT) converts serotonin into N-acetylserotonin.
The name is complicated, but the concept is fairly simple.
Serotonin → N-acetylserotonin
AANAT is considered a major regulatory enzyme in the melatonin synthesis pathway. Its activity changes dramatically according to the time of day, becoming much more active during the biological night.
This is one reason why melatonin production can change so dramatically between day and night even though the body has access to tryptophan and serotonin throughout the day.
The raw materials are not enough.
The enzymes have to be activated at the right time.
At night, signals from the circadian system increase sympathetic stimulation of the pineal gland. Norepinephrine released from sympathetic nerve endings activates receptors on pinealocytes, triggering intracellular signaling that promotes AANAT activity and melatonin synthesis.
That connection between the nervous system and an enzyme inside the pineal gland is what allows your body clock to control melatonin production.
Step 4: N-Acetylserotonin Becomes Melatonin
The final major step is the conversion of N-acetylserotonin into melatonin.
This reaction is catalyzed by an enzyme called acetylserotonin O-methyltransferase (ASMT).
You may also see ASMT referred to by its older name, hydroxyindole-O-methyltransferase (HIOMT).
The reaction can be simplified to:
N-Acetylserotonin
↓
Melatonin
At this point, the body has completed the main biochemical pathway.
The finished molecule is melatonin, chemically known as N-acetyl-5-methoxytryptamine.
The newly produced melatonin can then be released from the pineal gland into the bloodstream and distributed throughout the body.
[IMAGE: Tryptophan → 5-HTP → serotonin → N-acetylserotonin → melatonin]
The Complete Melatonin Production Pathway
Now we can put the entire process together:
TRYPTOPHAN
↓
tryptophan hydroxylase
↓
5-HTP
↓
aromatic L-amino acid decarboxylase
↓
SEROTONIN
↓
AANAT
↓
N-ACETYLSEROTONIN
↓
ASMT / HIOMT
↓
MELATONIN
There are four main biochemical reactions between tryptophan and melatonin.
The first two create serotonin from tryptophan.
The final two convert serotonin into melatonin.
The important regulatory point is that the pathway is not equally active throughout the 24-hour day.
Your circadian system determines when the pineal gland should strongly favor nighttime melatonin production.

Who Tells the Pineal Gland When to Make Melatonin?
This is where the story moves from biochemistry to circadian biology.
Your pineal gland does not independently decide when it is nighttime.
The process begins with light information detected by the eyes.
Specialized retinal cells detect environmental light and send signals through neural pathways to the suprachiasmatic nucleus (SCN) in the hypothalamus.
The SCN is often described as the body’s central circadian clock.
The simplified pathway is:
LIGHT INFORMATION
↓
RETINA
↓
SCN / CIRCADIAN CLOCK
↓
AUTONOMIC AND SYMPATHETIC SIGNALING
↓
PINEAL GLAND
↓
MELATONIN PRODUCTION
During the day, light-related signaling keeps the pineal gland’s nighttime melatonin pathway relatively quiet.
As the biological night approaches, the circadian system changes its signaling. Sympathetic nerves connected to the pineal gland release norepinephrine, which stimulates pinealocytes and promotes the biochemical machinery needed for melatonin synthesis.
[Also Read: Circadian Rhythm and Melatonin]
Why Does Melatonin Production Increase at Night?
The answer is not simply “because it gets dark.”
Darkness is an important environmental signal, but circadian timing is equally important.
Your internal clock follows a roughly 24-hour rhythm and uses environmental light to stay synchronized with the outside world. When the circadian system reaches its biological night, signals to the pineal gland change in a way that allows melatonin synthesis to increase.
One important change is increased activity of AANAT, the enzyme that converts serotonin into N-acetylserotonin.
As this part of the pathway becomes more active, melatonin production rises.
This is why melatonin is sometimes described as a signal of biological night.
The amount of melatonin does not simply rise because you have closed your eyes or gone to bed. Your circadian system is already controlling the process.
And the timing is not identical for everyone.
Sleep schedules, circadian phase, age, light exposure and other factors can influence when someone’s melatonin begins to rise and when it reaches its peak.
That is why there is no single clock time at which every person’s body suddenly starts producing melatonin.
[Also Read: How Melatonin Works]
How Does Light Reduce Melatonin Production?
If darkness helps support nighttime melatonin production, what happens when light appears?
The opposite signal is sent.
Light entering the eyes activates retinal pathways that communicate with the SCN. The SCN then influences the neural pathway connecting the circadian system to the pineal gland.
At night, this can reduce the sympathetic stimulation that normally promotes melatonin synthesis.
The result is reduced activity of the melatonin-producing pathway.
One important target is AANAT. Exposure to light at night can rapidly reduce AANAT activity and therefore reduce the conversion of serotonin into N-acetylserotonin, an important step toward melatonin production.
This is why light exposure at night can change melatonin even when the body has plenty of tryptophan available.
The problem is not a lack of raw material.
It is the circadian signal controlling the production machinery.
[Also Read: Blue Light and Melatonin]
Does the Body Make Melatonin During the Day?
It is tempting to think of melatonin as a simple on-off hormone:
Day = no melatonin
Night = melatonin
Human physiology is more complicated than that.
Melatonin production follows a daily rhythm, with circulating levels generally much higher at night than during the day.
The pineal gland does not necessarily produce literally zero melatonin during every moment of daylight. Instead, the normal pattern is characterized by low daytime levels and a much larger nighttime rise.
This distinction matters because biological systems rarely behave like household light switches.
The circadian system regulates the timing and strength of the rhythm rather than simply creating an absolute absence or presence of melatonin.
What Happens to Melatonin After It Is Made?
Once the pineal gland produces melatonin, the hormone is released into the circulation.
It can then reach many parts of the body.
Melatonin interacts with melatonin receptors, particularly MT1 and MT2 receptors, which are involved in the regulation of circadian timing and other physiological processes.
But this article is primarily about production, so there is no need to go deeply into melatonin’s receptor pharmacology here.
The important point is that the body does not store large amounts of melatonin for later use.
It produces it according to the body’s biological timing system, releases it, and eventually metabolizes and clears it.
That is very different from taking a melatonin supplement, where melatonin is introduced into the body from an external source.
Can Food Help Your Body Make Melatonin?
This is where many people understandably get confused.
There is a difference between:
foods that provide tryptophan and foods that already contain melatonin.
Tryptophan is an essential amino acid obtained from food and is an upstream precursor in the melatonin pathway.
So, in a basic biological sense, food provides some of the raw material required for melatonin synthesis.
But that does not mean that eating a tryptophan-rich food before bed will automatically cause a large increase in your melatonin level.
Tryptophan has to move through several biochemical steps. Those steps are regulated by enzymes, tissue availability, competing metabolic pathways and, importantly, circadian signaling.
The same applies to serotonin.
Having serotonin in the body does not mean that all of it will be converted into melatonin.
So nutrition is important for providing the building blocks required for normal physiology, but melatonin production is not controlled by food alone.
[Also Read: 10 Melatonin-Rich Foods for Better Sleep]
Does Serotonin Automatically Become Melatonin?
No.
This is an important misconception to clear up.
Serotonin is a precursor to melatonin, but serotonin has many functions of its own.
The body uses serotonin in several biological pathways, and only some serotonin enters the melatonin-producing pathway.
For serotonin to become N-acetylserotonin, AANAT must be active.
And for N-acetylserotonin to become melatonin, ASMT must complete the final reaction.
The activity of these enzymes is influenced by the body’s circadian timing system and neural signals from the pineal gland.
So the pathway is better understood as:
Tryptophan provides the starting material.
Serotonin is an important intermediate.
AANAT helps control the nighttime conversion toward N-acetylserotonin.
ASMT completes the final step to melatonin.
This is why simply increasing one ingredient does not automatically mean proportionally more melatonin.
What Can Affect Natural Melatonin Production?
Natural melatonin production is influenced by factors that affect either the amount, timing, or rhythm of melatonin secretion.
One of the most important is light exposure at night. Artificial light can interfere with the signals that normally promote nighttime melatonin production.
Circadian disruption can also alter the normal pattern. Irregular schedules, night work and jet lag can place the body’s internal clock out of alignment with the external day-night cycle.
Age is another important factor. Research has found that endogenous melatonin production generally changes across the lifespan, with lower nighttime melatonin levels commonly observed in older adults. However, the pattern varies between individuals and should not be treated as a fixed rule for every person.
Jet lag can temporarily disturb the relationship between your internal clock and local light-dark cycle.
Shift work presents a different challenge because people may need to remain awake and exposed to light during the biological night.
These factors do not necessarily “turn melatonin off.”
A better description is that they can alter the timing, amplitude, or normal rhythm of melatonin secretion.
Does Melatonin Production Change With Age?
Yes. Melatonin production generally changes with age, although the exact pattern varies between individuals.
Studies have found lower endogenous nighttime melatonin levels in older adults compared with younger people. Research also suggests that melatonin patterns change during childhood and adolescence.
This does not mean that everyone experiences the same decline or that age alone explains changes in sleep.
Sleep changes with age for many reasons, including changes in circadian timing, health, medications, sleep environment and lifestyle.
So it is better to say that age is associated with changes in melatonin production, rather than assuming that every older adult has the same melatonin level.
[Also Read: Circadian Rhythm and Melatonin]
Can You Make Your Body Produce More Melatonin Naturally?
The body already has a sophisticated system for producing melatonin.
Rather than thinking about forcing it to make more, it is more useful to think about supporting the conditions under which its normal nighttime rhythm can operate.
That includes maintaining a reasonably consistent sleep-wake schedule, getting appropriate light exposure during the day and avoiding unnecessary bright light at night.
These factors do not manufacture melatonin directly.
Instead, they help maintain the circadian signals that tell the pineal gland when nighttime melatonin production should occur.
That distinction is important.
This article is about how melatonin is made. Practical strategies for supporting natural melatonin levels deserve a separate discussion.
[Also Read: How to Increase Melatonin Naturally]
Natural Melatonin vs Melatonin Supplements
Your body produces endogenous melatonin through the biochemical pathway described above.
A melatonin supplement is different.
Supplemental melatonin introduces melatonin into the body from an external source rather than asking the pineal gland to manufacture it.
Natural production is controlled by the body’s circadian timing system, neural signaling and enzyme activity.
Supplemental melatonin is influenced by factors such as dose, formulation, timing and individual response.
This article is not intended to provide dosing advice, because taking melatonin and understanding how your body naturally produces it are two different questions.
[Also Read: Melatonin Dosage Guide]
Frequently Asked Questions
Where is melatonin made in the body?
The pineal gland is the main source of circulating melatonin produced during the normal nighttime rhythm. Melatonin can also be synthesized in other tissues, but the pineal gland is central to the daily rise in blood melatonin.
What is melatonin made from?
The pathway begins with the amino acid tryptophan. It is converted to 5-HTP, then serotonin, N-acetylserotonin and finally melatonin.
Does serotonin turn into melatonin?
Yes, but not directly. Serotonin is converted into N-acetylserotonin by AANAT, and N-acetylserotonin is then converted into melatonin by ASMT.
Does eating tryptophan increase melatonin?
Tryptophan from food provides an important precursor for the pathway, but eating more tryptophan does not automatically produce a large increase in melatonin. The pathway is controlled by multiple biochemical and circadian factors.
Does the body make melatonin during the day?
Melatonin follows a daily rhythm. Levels are normally much higher at night than during the day, but it is more accurate to describe daytime melatonin as low rather than assuming production is always completely absent.
Does darkness increase melatonin?
Darkness supports the normal nighttime melatonin rhythm, but the process is controlled by both environmental light information and the internal circadian clock.
Does aging reduce melatonin production?
Melatonin production generally changes with age, and older adults often have lower nighttime melatonin levels than younger adults. However, there is considerable individual variation.
Can food naturally provide melatonin?
Yes, some foods contain measurable amounts of melatonin. But that is different from providing precursors that your body uses to manufacture its own melatonin. The amount obtained from food and its physiological effect can vary considerably.
Bottom Line
Your body does not get melatonin simply because it is nighttime or because you are ready for sleep.
It makes melatonin through a carefully regulated biochemical pathway.
The process begins with tryptophan, which is converted to 5-HTP and then serotonin. Serotonin is converted to N-acetylserotonin by AANAT, followed by the final conversion to melatonin through ASMT.
The pineal gland is the main source of the melatonin that produces the familiar nighttime rise in circulating levels.
But the most important part of the story is that your body controls when this pathway becomes highly active.
The circadian clock receives information about the light-dark environment and sends signals that regulate the pineal gland. During the biological night, this system promotes the enzyme activity needed for melatonin production. Light at night can interfere with those signals and reduce melatonin synthesis.
Food provides the raw materials needed for normal melatonin production, but eating a particular food does not guarantee a large increase in your body’s melatonin.
So, in its simplest form:
TRYPTOPHAN → 5-HTP → SEROTONIN → N-ACETYLSEROTONIN → MELATONIN
And behind that biochemical pathway is your circadian clock, making sure the process happens at the appropriate time.
[Also Read: Melatonin Explained]
References
- Physiology, Pineal Gland and Melatonin. StatPearls. National Center for Biotechnology Information (NCBI).
NCBI Bookshelf — Pineal Gland and Melatonin - A Brief Review About Melatonin, the Pineal Hormone. International Journal of Molecular Sciences.
PubMed Central — Full Article - Melatonin Formation in Mammals: In Vivo Perspectives. Molecular and Cellular Endocrinology.
PubMed Central — Full Article - Protecting the Melatonin Rhythm through Circadian Healthy Light Exposure. International Journal of Molecular Sciences.
PubMed Central — Full Article - Melatonin: From Biochemistry to Therapeutic Applications. International Journal of Biochemistry & Cell Biology.
PubMed — Article Record - Human Melatonin Production Decreases With Age. Journal of Pineal Research.
PubMed — Article Record - Endogenous Melatonin Levels and the Fate of Exogenous Melatonin: Age Effects. Journal of Gerontology.
PubMed — Article Record - Melatonin Secretion Across Puberty: A Systematic Review and Meta-Analysis. Psychoneuroendocrinology. 2025.
PubMed — Article Record