Legs that jump or twitch at night usually come down to one of three things: hypnic jerks (sudden twitches as you fall asleep), restless legs syndrome (an uncomfortable urge to move your legs while lying down), or periodic limb movements during sleep (repetitive kicking you may not even notice). Each has different causes, feels different, and calls for different responses. Which one matches your experience determines what, if anything, you need to do about it.
Hypnic Jerks: Twitches as You Fall Asleep
If your legs jump right as you’re drifting off, you’re likely experiencing hypnic jerks. These are sudden, involuntary muscle contractions that happen during the transition from wakefulness to sleep. They can affect your whole body but tend to hit the legs and trunk hardest. You might also feel a sensation of falling or an electric-shock feeling at the same moment. They’re completely normal and happen to most people at some point.
The current explanation is straightforward: as your nervous system shifts gears from “awake” to “asleep,” it occasionally misfires slightly, sending a burst of activity to your muscles. Your heart rate and breathing may briefly spike in response. These jerks happen during the lightest stage of sleep and disappear entirely once you reach deeper sleep stages.
Certain things make hypnic jerks more frequent. Caffeine, stress, anxiety, and physical exhaustion all make the brain more reactive during that transition into sleep. If you’ve noticed your legs jumping more often lately, any of those could be the trigger. Cutting back on caffeine in the afternoon and managing stress tend to reduce how often they happen.
Restless Legs Syndrome: The Urge to Move
Restless legs syndrome (RLS) feels fundamentally different from a twitch. Instead of a single jolt, you get an uncomfortable sensation deep in your legs, often described as crawling, pulling, throbbing, or itching, paired with a strong urge to move. The movement itself isn’t involuntary. You move because staying still feels unbearable. Walking, stretching, or even just shifting position provides temporary relief, but the sensation returns once you stop.
RLS is remarkably common. Studies estimate that between 5 and 14% of adults in North America and Europe meet the diagnostic criteria, with some surveys putting the number as high as 29% when milder cases are included. Nearly 12% of one large population study reported experiencing symptoms a few nights a week over the preceding month.
The condition traces back to how your brain handles dopamine, a chemical messenger involved in controlling movement. Brain imaging shows that people with RLS have lower binding activity at certain dopamine receptors in the part of the brain responsible for movement coordination. This creates abnormal, recurring neural activity across a network of brain structures that process both sensation and motor control. The result is that uncomfortable “need to move” feeling that peaks at night.
The Iron Connection
Iron plays a critical role in dopamine production, and low iron stores are one of the most treatable causes of restless legs. Clinicians look at ferritin, a protein that reflects how much iron your body has in reserve. Even levels that would be considered “normal” on a standard blood test can be too low for someone with RLS. Treatment guidelines recommend supplementing iron when ferritin is at or below 75 micrograms per liter, with the goal of raising it above 100. If your legs are restless at night and you haven’t had your ferritin checked, that’s a useful first step.
Iron absorption can be improved by taking it with vitamin C and on an empty stomach, though it typically takes three to four months to see meaningful changes in ferritin levels. Some people with digestive conditions, a history of bariatric surgery, or ferritin levels that are stubbornly low may need iron delivered intravenously for a faster response.
Medications That Make It Worse
Several common medications can trigger or worsen restless legs. Over-the-counter sleep aids containing antihistamines are a frequent culprit, which is frustrating since people with restless legs often reach for them hoping to sleep better. Melatonin supplements can also worsen symptoms. Among prescription medications, certain antidepressants (particularly mirtazapine) are known offenders. Alcohol, caffeine, and nicotine all tend to aggravate symptoms as well.
Periodic Limb Movements During Sleep
This is the one you might not know about, because it happens while you’re asleep. Periodic limb movements of sleep (PLMS) involve repetitive twitching or kicking of the legs, typically every 20 to 40 seconds, cycling throughout the night. Most people with this condition have no idea they’re doing it. A bed partner who complains about being kicked is often the first clue.
The movements can fragment your sleep without fully waking you, leading to daytime fatigue and sleepiness that seems to have no explanation. Adults are diagnosed when a sleep study records more than 15 limb movements per hour. In children, the threshold is lower: more than five per hour. If you wake up tired despite what seemed like a full night of sleep, and especially if someone has noticed you kicking, a sleep study can confirm whether this is happening.
What You Can Do at Home
For hypnic jerks, the fixes are mostly about sleep hygiene: reduce caffeine intake (particularly after noon), manage stress, and avoid going to bed overtired. A consistent sleep schedule helps your nervous system make that wakefulness-to-sleep transition more smoothly.
For restless legs, several non-drug approaches have evidence behind them. Stretching exercises reduce both the frequency and severity of symptoms. Regular aerobic exercise, even moderate walking or cycling, has a similar effect. Foot massage, performed for several weeks consistently, has been shown to reduce symptom severity in clinical studies. Both standard massage and reflexology techniques were effective.
Some people find relief through hot or cold applications to the legs, yoga, or relaxation techniques like deep breathing and meditation. Mental engagement also helps. Activities that occupy your attention, such as puzzles, card games, reading, or knitting, can ease the discomfort during flare-ups. Even basic sleep hygiene matters: keeping a regular bedtime, using the bed only for sleep, and avoiding heavy meals, caffeine, and alcohol in the evening.
Signs It’s Worth Getting Checked
Occasional leg twitches as you fall asleep are normal and don’t need medical attention. But if your legs jump repeatedly throughout the night, if you’re consistently tired during the day despite getting enough hours in bed, or if an uncomfortable urge to move your legs is regularly keeping you from falling asleep, those patterns point to something worth investigating. A sleep study can identify periodic limb movements, and a simple blood test for ferritin can reveal whether low iron is driving restless legs. Both are straightforward to test for and, in many cases, straightforward to treat.

