One second you’re dreaming, the next you’re wide-eyed, limping around the room, doing that awkward no-noise scream while desperately stretching the muscle.

If this happens way too often, you’re far from alone. So why do your legs decide to rebel at 3 a.m.?

These are the most common reasons, learned the hard way and backed up by actual research:

You’re not drinking enough water
Even mild dehydration can mess with your electrolytes, making your muscles extra irritable once you lie down.

You’re low on key minerals
Magnesium, potassium, and calcium matter a lot. Sweat, poor diet, or skipping these nutrients can invite cramps to the party.

You overdid it earlier
Hard workouts or long walks during the day often come back to haunt you when your body finally relaxes.

Too much sitting—or standing
Staying in one position for hours tightens muscles, and they don’t appreciate it when bedtime rolls around.

Sneaky bad posture
Slouching on the couch or locking your knees while standing adds stress that builds up over time.

Nerve-related problems
Issues like sciatica or lower back irritation can trigger cramps that feel random but aren’t.