Why Do My Eyes Twitch When I Close Them?

That fluttering sensation you feel when you close your eyes is almost always eyelid myokymia, a harmless and temporary twitch caused by tiny, involuntary contractions in the muscle that wraps around your eye. You notice it more when your eyes are closed because the act of closing removes visual distractions, and the thin skin of your eyelids makes even the smallest muscle ripple easy to feel. The twitch itself isn’t triggered by closing your eyes. It’s happening because of faulty nerve signals, and shutting your eyes simply makes you aware of it.

What’s Happening in the Muscle

Your eyelids are controlled by a flat, ring-shaped muscle called the orbicularis oculi. This muscle connects directly to your brain through your facial nerve, the seventh cranial nerve. When something disrupts the normal signaling along that nerve, small bundles of muscle fibers start firing on their own in slow, wave-like contractions. That’s the fluttering you feel.

These misfires are usually confined to the lower eyelid of one eye, though they can affect the upper lid too. The twitches tend to come and go over a period of days or weeks, sometimes pausing for hours before returning. When you close your eyes at night or during rest, you become hyper-aware of the sensation because there’s nothing else competing for your attention. The pressure of your lids pressing together can also make the tiny contractions more noticeable against the surface of the eye.

The Most Common Triggers

Eyelid myokymia is strongly linked to a short list of lifestyle factors. The most frequent culprits are fatigue, stress, and caffeine. Sleep deprivation makes your nervous system more excitable, which lowers the threshold for these spontaneous muscle firings. Stress does something similar, keeping your body in a heightened state where small nerve misfires are more likely. Caffeine is a direct muscle stimulant that can cause spasms in the eye muscles even at moderate doses.

Other recognized triggers include:

  • Eye strain from prolonged screen use or reading
  • Alcohol and nicotine
  • Bright light exposure
  • Dry eyes or eye surface irritation, which can worsen in winter when indoor heating dries the air
  • Wind and air pollution

Most people who experience eye twitching can trace it to one or two of these factors. The twitch often resolves within a few days once the trigger is removed.

Does Magnesium Deficiency Cause It?

You’ll find magnesium supplements widely recommended for eye twitching online, but the evidence doesn’t support this. A study comparing people with eyelid myokymia to those without found no significant differences in magnesium levels between the two groups. Calcium and phosphate levels were also the same. While magnesium plays a real role in muscle function throughout the body, low magnesium does not appear to be a meaningful driver of eyelid twitching specifically.

Dry Eyes and Eye Irritation

If your eyes are persistently dry, that surface irritation can contribute to twitching. The nerve endings on the surface of your eye are extremely sensitive, and when they’re irritated by dryness, dust, an eyelash, or inflammation of the eyelid margins (a condition called blepharitis), the signals traveling back along the facial nerve can become erratic enough to trigger muscle contractions. This is worth paying attention to because dry eye disease is treatable with lubricating drops and environmental adjustments, and resolving the irritation often stops the twitching.

How to Stop the Twitching

For the vast majority of people, eyelid twitching resolves on its own. The most effective steps you can take are straightforward: get more sleep, cut back on caffeine, and reduce screen time. If your eyes feel dry or gritty, over-the-counter artificial tears can help soothe the surface irritation that may be feeding the cycle. Reducing alcohol intake and finding ways to manage stress also make a difference.

Most episodes of myokymia last a few days to a few weeks. If the twitching persists beyond that, it’s worth tracking whether it’s genuinely constant or just recurring during periods of poor sleep or high stress.

When Twitching Signals Something More Serious

Ordinary eyelid myokymia affects one eye, stays confined to the eyelid, and comes and goes. Two rarer conditions look different and need medical evaluation.

Benign essential blepharospasm is a movement disorder that typically appears in mid- to late adulthood. It starts with increased blinking frequency, dry eyes, and sensitivity to light, wind, and pollution. It usually begins in one eye but eventually affects both. Over time, the spasms grow strong enough to force both eyes shut, making it difficult to see. In some people, the involuntary contractions spread to the jaw and tongue. This condition is distinct from common twitching and is thought to originate from a malfunction in the basal ganglia, a part of the brain that helps regulate movement.

Hemifacial spasm involves twitching that spreads beyond the eyelid to other muscles on the same side of the face. It’s typically caused by a blood vessel pressing on the facial nerve near the brainstem.

Both conditions are treated effectively with injections of a muscle-relaxing substance that calms the overactive nerve. Spasms typically begin to fade within a day to two weeks after treatment, and the relief lasts about three months before a repeat injection is needed. Surgery is reserved for cases where injections don’t work, either by removing the muscle causing spasms or by relieving pressure on the nerve.

The key differences to watch for: twitching that affects both eyes, spreads to other parts of your face, forces your eyes completely shut, or persists without improvement for more than a few weeks despite addressing common triggers like sleep and caffeine.