Supplemental melatonin is a popular product to take around bedtime (in the U.S., at least), but it can lead to some unpleasantness come morning light.

“‘Grogginess’ is sometimes reported after melatonin use, along with headache, dizziness, upset stomach, and even mood alterations such as temporarily feeling down or feeling more anxious,” notes Ellen Wermter, FNP-BC, a family nurse practitioner and spokesperson for the Better Sleep Council. Vivid dreams, increased daytime sleepiness, and even hormone disruption are also possible.

Here’s a primer on the potential side effects of melatonin and how to avoid them.

Why do melatonin supplements cause grogginess and other side effects?

“Melatonin is a hormone that the pineal gland in our brains makes in response to dim light,” Wermter explains. “[It] helps regulate our circadian rhythm by signaling that soon it will be time for sleep.” Taking extra, supplemental melatonin can strengthen the signal that bedtime is here.

However, if you still have excess melatonin in your system by the time you wake up, you’re likely to feel a little groggy and sleepy.

This is bound to happen after you take melatonin doses that are too high, explains leading sleep specialist Michael J. Breus, Ph.D. While melatonin is generally recognized as safe up to 10 milligrams, Breus says that more is not better when it comes to supplementing with the hormone, unless otherwise instructed by a doctor.

Even doses in the 1- to 5-milligram range can lead to blood serum levels 10 to 100 times higher than what our body makes naturally, Wermter points out. So taking around 0.5 milligrams of melatonin should still be enough to help regulate the circadian rhythm—without causing as much grogginess or morning fatigue.

Laura Erlich, LAc, FABORM, a fertility and obstetric specialist and founder of Mother Nurture Wellness, adds that taking melatonin too close to your desired bedtime can also set you up for fogginess. Consuming supplemental melatonin at least an hour before bed (or 12 hours after you wake up) should minimize the chance of it still being in your system by your morning alarm, says Wermter.

Finally, Christina Graham, R.N., a registered nurse and Noom coach, notes that genetics can also affect how quickly you process melatonin and therefore how your body reacts to it.

Other ways to improve sleep, sans grogginess.

Potential for uncomfortable side effects aside, there are other reasons to avoid turning to melatonin for regular sleep support.

“It is most useful for adjusting the timing of sleep—shifting sleep periods in cases such as jet lag, shift work, or circadian rhythm disorders,” Wermter says of the supplement. “The evidence for melatonin use for falling asleep more quickly, staying asleep longer, and for sleep efficiency (how much of the time you are in bed you are actually sleeping) is weak, and as such melatonin is not recommended for any of these purposes.”

Revée Barbour, N.D., M.S., naturopathic doctor, and owner of Dr. Ray, N.D., in Sacramento, Calif., echoes that if your body is already making enough melatonin of its own, taking a supplement won’t necessarily support your sleep and could do more harm than good.

So while it can be a helpful tool to pack on a long-haul flight, melatonin should not be taken as a nightly sleep aid—especially not in higher doses. Instead, you’re better off supporting your body’s natural melatonin production by waking up at the same time every day and getting outside early, avoiding heavy meals too close to bedtime, and staying off screens at night.

And if you are looking for a supplement to add to your already healthy sleep routine, look for a nonhormonal option like mbg’s sleep support+, which reviewers say has dramatically deepened their rest sans the side effects of melatonin.*

Supplemental melatonin can cause grogginess, dizziness, and a number of other side effects—especially when it’s taken in high amounts too close to bedtime. Taking it in smaller doses at least an hour before bed should help minimize these, though you still don’t want to take the hormone for an extended period of time. If it’s nightly sleep support you’re after, you’re better off cleaning up your bedtime (and wake-up) routine to support your body’s natural melatonin production instead.