What happens when you take caffeine with melatonin?
Caffeine and melatonin act on the sleep-wake system in opposite directions, but caffeine also slows the breakdown of melatonin taken as a supplement. Here is the sequence:
- Caffeine blocks the brain's "sleep pressure" signal. It binds adenosine receptors, the same receptors that normally accumulate sleep pressure over the day, keeping you alert and delaying the urge to sleep.
- Melatonin does the opposite. It is the hormone your pineal gland releases in darkness to signal biological night. A melatonin supplement adds to that same "it's night" signal.
- Late-day caffeine suppresses your own melatonin. When caffeine is still active in the evening, your natural nighttime melatonin rise is reduced.
- Caffeine can also shift your body clock later. In a controlled trial, caffeine taken several hours before bed pushed back the evening melatonin onset, nudging the internal clock toward a later schedule.
- Caffeine also raises melatonin from a supplement. Caffeine and melatonin are both broken down by the same liver enzyme, CYP1A2. In a study of 12 healthy adults, taking caffeine with a melatonin supplement raised the peak melatonin level in the blood by about 142% and total exposure by about 120%, so the supplement's effect may be stronger or last longer, not weaker.
Why is this important?
This matters because so many people use both. Melatonin is one of the most popular sleep aids, and caffeine is consumed throughout the day. Many people do not realize that an afternoon coffee or energy drink can disturb their sleep and also change how much melatonin from a supplement stays in their blood.
The practical consequences are modest but real:
- Delayed sleep onset, even with melatonin, because residual caffeine keeps blocking the sleep signal.
- Lighter, less restorative sleep, since caffeine reduces sleep quality and efficiency.
- A body clock nudged later, contributing to evening alertness and morning grogginess.
- A weaker natural melatonin rise on days with late caffeine.
Caffeine clears the body slowly, and the rate varies widely from person to person depending on genetics, pregnancy, oral contraceptive use, smoking, and certain medications. A slower metabolizer who has an afternoon coffee may still have meaningful caffeine in their system at bedtime, which is why a generous buffer helps.
What should you do?
Caffeine pulls in two directions here: it works against sleep and lowers your own melatonin, yet it raises the level of melatonin from a supplement. No study has tested what this means for sleep or next-day alertness when people use both, so the practical effect is hard to predict.
- If you use melatonin, tell your doctor or pharmacist how much caffeine you have and when, including coffee, tea, energy drinks, pre-workout products and caffeine-containing pain relievers.
- Notice how you feel the next morning, and mention new grogginess to them.
- Caffeine can disturb sleep on its own: in a small study, regular coffee shortened and worsened sleep compared with decaf.
- Whether melatonin suits you, and how much, is a question for your doctor or pharmacist, especially if you are pregnant, breastfeeding or take other medicines.
Which specific products are affected?
The interaction applies to all caffeine and all melatonin sources; it is not brand-specific.
- Melatonin supplements: tablets, gummies, liquids, and time-release versions from common brands.
- Sleep formulas containing melatonin: nighttime sleep blends and magnesium-plus-melatonin combinations.
- Late-day caffeine sources to watch: afternoon coffee, energy drinks, pre-workout supplements used for evening training, dark chocolate, mate, and kombucha.
- Tricky cases: "sleep teas" that still contain caffeine, decaf coffee in sensitive individuals, and combination products that pair caffeine-like stimulants with other ingredients.
The science behind it
Two kinds of evidence apply here. In a double-blind, placebo-controlled human study, Burke and colleagues (2015) found that a caffeine dose equal to a double espresso taken 3 hours before bedtime delayed the evening dim-light melatonin onset by roughly 40 minutes, about half the delay produced by bright light, demonstrating that evening caffeine shifts the human circadian clock later (Burke TM, et al. Sci Transl Med. 2015;7(305):305ra146).
An earlier small crossover study by Shilo and colleagues (2002) measured the urinary melatonin metabolite 6-sulfatoxymelatonin and found that coffee consumption prevented the normal nighttime melatonin rise and was associated with reduced sleep quality (Shilo L, et al. Sleep Med. 2002;3(3):271-273. PMID 14592218).
Caffeine also changes how much melatonin from a supplement reaches the blood. In a study of 12 healthy adults (six smokers and six nonsmokers), Härtter and colleagues gave 6 mg of melatonin with or without caffeine (three doses of 200 mg). With caffeine, the peak melatonin level rose by an average of 142% and total exposure by 120%, most likely because caffeine blocks CYP1A2, the liver enzyme that breaks melatonin down; the effect was larger in nonsmokers (Härtter S, et al. Br J Clin Pharmacol. 2003;56(6):679-682. PMID 14616429).
Together these show two effects pulling in opposite directions: caffeine lowers your own melatonin and nudges your clock later, but it raises melatonin from a supplement. No study has measured how the combination affects sleep or next-day alertness. The rise in melatonin levels, measured in people, is why this interaction is rated moderate.
Frequently Asked Questions
Can I take caffeine and melatonin on the same day?
Many people do, but caffeine raises the level of melatonin from a supplement, and late caffeine works against sleep. No study has tested whether spacing them apart changes the rise in melatonin. Ask your doctor or pharmacist what makes sense for you.
Why isn't my melatonin working?
Late-day caffeine can disturb sleep on its own, even though it raises melatonin levels from a supplement. Ask your doctor or pharmacist to look at your whole routine, including caffeine.
How long before bed should I stop caffeine?
A several-hour buffer is a reasonable default, and sensitive sleepers do better stopping earlier. Because people clear caffeine at very different rates, find the cutoff that works for you.
Does decaf coffee count?
Decaf still contains a small amount of caffeine. For most people that is negligible, but very sensitive sleepers may notice it late in the evening.
Is it dangerous to combine them?
It has not been shown to be dangerous, but caffeine more than doubled melatonin levels from a supplement in a study of healthy adults, which is why this is rated moderate. No study has measured next-day effects. Mention both to your doctor or pharmacist.
What about jet lag or shift work?
That is a question for your doctor or pharmacist. Keep in mind that caffeine raises melatonin levels from a supplement, and that using the two at different times of day has not been studied.
Key takeaways
- Caffeine and melatonin push the sleep-wake system in opposite directions, and late caffeine lowers your own melatonin and can shift your body clock later, by roughly 40 minutes in a controlled study.
- Caffeine also slows the breakdown of melatonin from a supplement: in 12 healthy adults it raised the peak level by about 142% and total exposure by about 120%.
- This is rated moderate because of that measured rise; no harm from the combination has been shown.
- If you use melatonin, tell your doctor or pharmacist how much caffeine you have and when, and mention any next-day grogginess.
