How to Increase Melatonin Naturally for Better Sleep

Your body produces melatonin on its own every night, and the amount it makes depends heavily on your daily habits. Light exposure, food choices, and sleep timing all influence how much melatonin your pineal gland releases. In a healthy pattern, melatonin levels rise 1 to 3 hours before bedtime, stay elevated through the night, and drop near wake-up time. The good news is that several straightforward changes can strengthen this natural cycle.

How Your Body Makes Melatonin

Melatonin production starts with your eyes. Specialized cells in your retina contain a photopigment called melanopsin that detects ambient light levels. When light dims in the evening, these cells send a signal through a neural pathway to the pineal gland, a tiny structure deep in your brain, which then ramps up melatonin production. When light hits your eyes, especially blue-spectrum light, the signal flips: melatonin production shuts down.

This system means that everything you do with light directly controls your melatonin levels. It also explains why the strategies below work. They’re not tricks or hacks. They’re ways of giving your body the environmental cues it evolved to rely on.

Get Bright Light in the Morning

Morning light doesn’t just wake you up. It sets the clock that determines when melatonin rises later that evening. Bright light exposure after waking shifts your entire circadian rhythm forward, which means melatonin onset arrives on schedule at night rather than being delayed.

Research on circadian phase-shifting found that a single 30-minute exposure to bright light (around 5,000 lux, roughly equivalent to being outdoors on an overcast morning) produced 75% of the phase shift seen with a full 2-hour protocol. That 2-hour exposure shifted melatonin onset by about 2.4 hours, while the 30-minute exposure achieved roughly 1.8 hours. For most people, 20 to 30 minutes of outdoor morning light is enough to anchor the cycle. Overcast daylight still delivers thousands of lux, far more than indoor lighting.

If you work indoors and rarely see morning sun, even stepping outside for a short walk or eating breakfast near a window makes a measurable difference. Consistency matters more than duration here. The same signal at the same time each morning trains your clock.

Block Blue Light After Sunset

Blue light in the wavelength range of 446 to 477 nanometers suppresses melatonin more powerfully than any other part of the visible spectrum. That range happens to be exactly what LED screens, phones, tablets, and modern light bulbs emit in abundance.

The suppression is dose-dependent: more blue light and longer exposure mean more melatonin is blocked. In controlled studies, even moderate-intensity blue LED light produced significant melatonin suppression in the hours before bed. This is why scrolling your phone at 11 p.m. can delay sleep onset well beyond the time you actually put the phone down. Your pineal gland needs darkness, or at least dim, warm-toned light, for 1 to 3 hours before bed to reach its natural melatonin peak.

Practical steps that help: switch to warm-toned bulbs (2700K or lower) in rooms you use at night, enable night mode on devices after sunset, or wear blue-light-blocking glasses if you need to use screens. Dimming overhead lights in the last hour or two before bed gives your brain the “it’s getting dark” signal it needs.

Foods That Contain Melatonin

Several foods contain melatonin itself, and eating them in the evening can contribute to your circulating levels. The amounts vary enormously across food types.

  • Mushrooms: 4,300 to 6,400 nanograms per gram, the highest concentration in common foods by a wide margin
  • Pistachios: Estimates vary from 3.4 to 66 nanograms per gram depending on the testing method, with some studies reporting much higher values
  • Oats: About 91 nanograms per gram
  • Basmati rice: Around 38 nanograms per gram
  • Tart cherries: 10 to 20 nanograms per gram (100 grams of tart cherry juice contains roughly 0.135 micrograms of melatonin)
  • Tomatoes: 1 to 67 nanograms per gram
  • Walnuts: 0.1 to 4 nanograms per gram
  • Eggs: About 2 nanograms per gram
  • Salmon: About 4 nanograms per gram

These amounts are small compared to a supplement (which typically contains 0.5 to 5 milligrams), but dietary melatonin is absorbed alongside other nutrients and may work synergistically with them. Tart cherry juice has the most clinical research behind it for sleep improvement, though the melatonin content alone doesn’t fully explain the effect. Tart cherries also contain compounds that reduce inflammation and may influence sleep through other pathways.

Nutrients That Support Melatonin Production

Your body builds melatonin from tryptophan, an amino acid found in protein-rich foods like turkey, chicken, eggs, cheese, nuts, and seeds. But tryptophan doesn’t convert to melatonin on its own. It goes through several chemical steps, and each step requires specific nutrient cofactors.

Vitamin B6 is essential to the enzymatic conversion that eventually produces melatonin. Without adequate B6, the pathway slows down. Good sources include poultry, fish, potatoes, chickpeas, and bananas. Magnesium plays a broader supporting role: it’s a required cofactor for activating B vitamins (including B6) and for dozens of enzymes involved in sleep-related chemistry. Many adults don’t get enough magnesium from diet alone. Dark leafy greens, pumpkin seeds, almonds, and black beans are among the richest sources.

You don’t need to megadose these nutrients. The goal is to avoid deficiency, which is surprisingly common for both magnesium and B6 in modern diets heavy on processed foods.

Keep a Consistent Sleep Schedule

Melatonin release follows a rhythm, and rhythms depend on predictability. Going to bed and waking up at roughly the same time each day, including weekends, reinforces the timing of your melatonin onset. Irregular schedules confuse the circadian system the same way jet lag does, pushing melatonin release later or fragmenting it.

The natural melatonin rise begins 1 to 3 hours before your habitual bedtime. If you normally sleep at 11 p.m. but stay up until 2 a.m. on weekends, your Monday night melatonin onset may be delayed, making it harder to fall asleep even though you’re tired. Keeping your wake time consistent is especially powerful because morning light exposure at the same time each day locks in the entire cycle.

Exercise at the Right Time

Regular physical activity improves sleep quality and appears to support melatonin production, but timing matters. Moderate exercise earlier in the day, particularly in the morning or afternoon, strengthens circadian rhythms. Vigorous exercise within 2 to 3 hours of bedtime can raise core body temperature and stimulate your nervous system, which works against the cooling and calming your body needs as melatonin rises.

If evening is the only time you can exercise, lower-intensity activities like walking or gentle yoga are less likely to interfere with melatonin onset than intense cardio or heavy lifting.

Why Melatonin Declines With Age

If you’re over 40 and feel like your sleep isn’t what it used to be, there’s a biological explanation. Melatonin levels peak in early childhood, then drop by about 80% through the rest of childhood and adolescence. In adulthood, levels decline an additional 10% or so, with the steepest drop occurring in older age.

This age-related decline makes the strategies above more important as you get older, not less. You’re working with a smaller baseline of melatonin, so losing even a portion of it to blue light exposure or irregular schedules has a bigger relative impact. The same habits that help a 25-year-old sleep better become genuinely necessary for a 55-year-old trying to maintain decent sleep quality.

Putting It All Together

The most effective approach combines light management with nutritional support and schedule consistency. Get bright outdoor light within 30 minutes of waking. Eat tryptophan-rich foods along with adequate magnesium and B6 throughout the day. Dim your lights and reduce screen exposure in the 2 to 3 hours before bed. Go to sleep and wake up at the same times daily. Include melatonin-containing foods like mushrooms, oats, or tart cherries in your evening meals if convenient.

None of these changes works as dramatically as a melatonin supplement on a single night. But together, over days and weeks, they rebuild the natural rhythm your body is designed to follow, producing melatonin in the right amount at the right time without external help.