Why Do My Legs Shake When I Wake Up? Causes

Waking up with shaky legs is usually your body catching up to the demands of being upright and active after hours of stillness. The most common causes are benign: low blood sugar after an overnight fast, mild dehydration, or muscles that haven’t fully “switched on” yet. But persistent or worsening leg shaking can point to something worth investigating, from electrolyte imbalances to medication side effects or a sleep movement disorder.

Blood Sugar Drops Overnight

Your body burns through its available blood sugar while you sleep, and by morning, levels can dip low enough to trigger tremors. Nerves and muscles are powered by blood sugar, and when levels fall below about 70 mg/dL, your body responds with shaking, sweating, and a jittery feeling. This is especially common if you ate dinner early, skipped a bedtime snack, or had alcohol the night before, all of which accelerate the overnight drop.

If low blood sugar is the culprit, the shaking typically resolves within 10 to 15 minutes of eating or drinking something with carbohydrates. You might also notice lightheadedness, a rapid heartbeat, or feeling “off” mentally until you eat. People with diabetes are at higher risk, but it happens in people without diabetes too, particularly after irregular eating patterns or intense exercise the day before.

Low Magnesium and Other Electrolytes

Magnesium plays a direct role in how your muscles contract and relax. When levels drop too low (below 1.7 mg/dL in blood tests), tremors are one of the most common neurological symptoms, appearing in roughly a quarter of documented cases. These tremors tend to show up during movement or while holding a position, like standing, rather than while lying still. That’s why you might not notice anything in bed but feel shaky the moment you get up.

Potassium and calcium work alongside magnesium to regulate muscle signaling, and being low in any of them can produce a similar effect. Overnight, you lose electrolytes through sweat and normal kidney function without replacing them, so morning is when you’re most likely to feel the effects. Common contributors to low magnesium include not eating enough leafy greens, nuts, or whole grains, drinking too much alcohol, or taking certain medications like proton pump inhibitors for acid reflux.

Orthostatic Tremor When You Stand

Some people experience a specific type of tremor that only happens when they’re standing still. Called orthostatic tremor, it creates a feeling of unsteadiness or instability in the legs rather than visible shaking. You might not even see your legs move, but if you press your hands against your thighs or calves, you can feel rapid, fine muscle contractions rippling under the skin.

The key feature is that it goes away when you sit back down or start walking. It can begin the instant you stand up or build gradually over several minutes. Over time, people with orthostatic tremor may develop leg muscle pain from the sustained contractions. This condition is relatively uncommon but underdiagnosed because the tremor is often too subtle to see. If your morning leg shaking only happens while standing still and disappears once you move, this is worth mentioning to a doctor.

Limb Movements During Sleep

Your legs may have been moving all night without you knowing it. Periodic limb movements of sleep cause repetitive twitches or jerks every 20 to 40 seconds throughout the night. Adults who have more than 15 of these movements per hour meet the diagnostic threshold. This disrupts sleep quality even if you don’t fully wake up, and the residual muscle activity can carry over into those first minutes of consciousness.

Between 80% and 90% of people with restless legs syndrome also have these periodic limb movements, but the two aren’t the same thing. Restless legs syndrome causes an uncomfortable urge to move your legs while you’re awake and trying to rest, usually in the evening. Periodic limb movements happen involuntarily during sleep. Both can leave your legs feeling restless, tired, or shaky when you wake up. A sleep study is the only way to confirm periodic limb movements since you’re typically unaware they’re happening.

Anxiety and Nighttime Panic Attacks

Stress and anxiety prime your nervous system to dump adrenaline at the slightest trigger, and waking up is a transition that can set it off. Nighttime panic attacks can strike without any obvious cause, pulling you out of sleep with trembling, a racing heart, sweating, and a sense of dread. The trembling often hits the legs and hands hardest because large muscle groups respond most visibly to the flood of stress hormones.

Even without a full panic attack, people with generalized anxiety often wake in a heightened state. Cortisol, your body’s main stress hormone, naturally peaks in the first 30 to 45 minutes after waking. If your baseline anxiety is already elevated, that cortisol surge can push you past the threshold where shaking becomes noticeable. Morning shaking from anxiety tends to come with other signs: shallow breathing, tension in your chest or stomach, racing thoughts, or a sense that something is wrong you can’t quite name.

Medications That Cause Tremors

Several widely prescribed medications list tremor as a side effect, and the timing often lines up with morning hours when drug levels in your blood are shifting. Antidepressants are among the most common offenders. In a large global database of drug side effects, antidepressants were about three times more likely to be associated with tremor reports than other medications. Serotonin reuptake inhibitors (the most commonly prescribed class of antidepressants) showed the strongest link, with paroxetine and fluvoxamine carrying particularly high reporting rates. Bupropion, often prescribed for depression or smoking cessation, also showed a significant association.

Tremors from medication don’t always start right away. They can develop weeks or months into treatment, or after a dose change. If you’ve recently started a new medication or adjusted your dose and notice morning leg shaking that wasn’t there before, the timing is worth tracking and discussing with whoever prescribed it.

Caffeine Withdrawal Overnight

If you’re a regular coffee or tea drinker, your brain has physically adapted to caffeine by growing extra receptors for adenosine, the chemical caffeine blocks. During the 7 to 8 hours you sleep, caffeine clears from your system, and all those extra receptors become active at once. Withdrawal symptoms can begin within 12 to 24 hours after your last cup. For someone who has their last caffeine at 2 p.m., that window lands right around waking.

Caffeine withdrawal is better known for headaches and fatigue, but it can also cause muscle stiffness, pain, and tremor-like symptoms. These effects typically peak between 20 and 51 hours after your last dose and can persist for up to 9 days if you quit abruptly. If your morning shaking improves noticeably after your first cup of coffee, caffeine withdrawal is a likely contributor.

What to Pay Attention To

Occasional morning leg shaking that resolves after eating breakfast, moving around, or having your coffee is rarely a sign of anything serious. It becomes worth investigating when it happens most mornings, gets progressively worse, lasts longer than 15 to 20 minutes after you’re up and moving, or comes with other symptoms like numbness, weakness, visible muscle wasting, or pain.

Keeping a brief log can help clarify the pattern. Note when the shaking starts (lying in bed, standing up, walking), how long it lasts, what makes it stop, and whether you notice it at other times of day. If testing is needed, the most useful starting points are blood work checking electrolytes and blood sugar, and potentially a sleep study if nighttime limb movements are suspected. For tremors triggered specifically by standing, surface electromyography can measure the frequency and pattern of muscle contractions to distinguish between different tremor types.