That fluttering sensation in your eyelid is almost certainly a benign condition called eyelid myokymia, and it’s extremely common. The twitching comes from tiny, involuntary contractions of the muscle that circles your eye, firing in rapid bursts of 3 to 8 times per second. It looks and feels more dramatic than it actually is. In the vast majority of cases, it resolves on its own within days to a few weeks.
What’s Actually Happening in Your Eyelid
The muscle responsible is a thin, flat ring of tissue that wraps around your eye socket and controls blinking and squinting. When nerve fibers within this muscle become irritated, small groups of muscle fibers start firing on their own in rapid, semi-rhythmic bursts with just 100 to 200 milliseconds between each contraction. You feel it as a fluttering or pulsing, usually in the lower lid, though the upper lid can be affected too.
The exact trigger for this nerve irritability isn’t fully understood, but several well-established factors make it more likely.
Common Triggers
Sleep deprivation is the most frequently reported trigger. When you’re underslept, your nervous system becomes more excitable, and the small nerve fibers in your eyelid are particularly sensitive to this. Stress works through a similar mechanism, increasing baseline muscle tension and neural firing throughout the body.
Caffeine and alcohol both affect how nerves transmit signals, and many people notice their eyelid starts twitching during periods of higher intake. Eye strain from prolonged screen use is another common culprit. When you stare at a screen, you blink less often, your eye surface dries out, and the surrounding muscles fatigue from sustained focus. All of this can set off twitching.
Dry eyes, whether from screen use, contact lenses, allergies, or dry environments, can also irritate the nerve endings around the eye enough to trigger spasms.
Does Magnesium Deficiency Cause It?
This is one of the most popular explanations you’ll find online, but the evidence doesn’t support it. A cross-sectional study comparing 72 patients with eyelid twitching to 197 controls found no significant difference in magnesium levels between the two groups. Calcium and phosphate levels were also the same. Despite how widely this idea has spread, particularly in some countries where magnesium supplements are routinely recommended for twitching, there’s no clinical data backing the connection. That doesn’t mean magnesium is unimportant for muscle function generally, but low magnesium doesn’t appear to be what’s driving your eyelid twitch.
How to Stop the Twitching
Since the most reliable triggers are lifestyle-related, the fixes are straightforward. Getting more sleep is the single most effective intervention for most people. If you’ve been running on six hours a night and your eyelid starts twitching, that’s your body giving you a clear signal.
Cutting back on caffeine helps, especially if you’ve recently increased your intake. You don’t necessarily need to eliminate it, just reduce to a level where your nervous system calms down. Reducing screen time, or at least taking regular breaks using the 20-20-20 rule (every 20 minutes, look at something 20 feet away for 20 seconds), can relieve the eye strain component.
A warm compress placed gently over the closed eyelid for one to three minutes, twice a day, can relax the muscle and soothe irritation. Use a warm, damp cloth or a microwaveable eye mask from a pharmacy. Be careful not to make it hot enough to burn the thin skin of the eyelid. If dry eyes are a factor, preservative-free artificial tears can reduce the surface irritation that feeds the twitching cycle.
Most episodes resolve within a few days to two weeks once you address the underlying triggers. Some last longer, but even persistent cases typically stop on their own.
When Twitching Signals Something Else
Rarely, eyelid twitching can be part of a more serious neurological condition. Two in particular are worth knowing about.
Blepharospasm is a condition where both eyes are affected by forceful, sustained contractions, not just a subtle flutter. In severe cases, you may be unable to open your eyes for several minutes at a time. Symptoms tend to be minimal in the morning and worsen with fatigue, stress, or bright light. This is a different condition from common eyelid twitching and requires treatment.
Hemifacial spasm affects one side of the face and involves not just the eye but also the cheek and mouth on the same side. It’s sometimes caused by a blood vessel pressing against the facial nerve inside the skull, or by abnormal nerve rewiring after a previous episode of facial nerve paralysis.
Red Flags to Watch For
- Duration: the twitching hasn’t stopped after a few weeks
- Intensity: your eyelid closes completely with each twitch, or you have difficulty opening the eye
- Spread: twitching has moved to other parts of your face or body
- Physical changes: your eye is red, swollen, has discharge, or the eyelid is drooping
- Weakness or stiffness: the area around the eye feels weak or rigid
Any of these patterns suggest something beyond simple myokymia and warrant a medical evaluation.
Treatment for Persistent Cases
If your twitching has lasted for months and hasn’t responded to sleep, stress management, and reduced caffeine, a doctor may consider small injections of botulinum toxin into the eyelid muscle. This weakens the overactive muscle fibers and stops the contractions. The treatment works, but it carries risks including temporary eyelid drooping, difficulty fully closing the eye, and double vision. These side effects are usually temporary but can last weeks. For the upper eyelid specifically, injections need to be carefully placed to avoid affecting the muscle that lifts the lid.
This level of treatment is uncommon. The vast majority of eyelid twitching episodes end on their own once you catch up on sleep, ease off the caffeine, and give your eyes regular breaks from screens.

