Why Do My Eyes Twitch When I Close Them?

Eyelid twitching when you close your eyes is almost always eyelid myokymia, a spontaneous, involuntary quivering of the orbicularis oculi muscle that rings each eye. It is one of the most common neuromuscular complaints people bring to doctors, and the vast majority of cases are harmless, self-limiting, and tied to everyday stressors like poor sleep, too much caffeine, or prolonged screen use. The reason you tend to notice it when closing your eyes is partly anatomical and partly perceptual, and both are worth understanding.

Why Eyelid Muscles Are Built to Twitch

The orbicularis oculi is unusual among facial muscles. Studies of its fiber composition show it is dominated by fast-twitch fibers, which make up roughly 88% of the muscle on average.1The Journal of Craniofacial Surgery. Muscle Fiber Types of Human Orbicularis Oculi Muscle That proportion is higher than the muscles around the mouth, which explains why blinking is faster than, say, pursing your lips. Fast-twitch fibers are great for rapid, precise movements like blinking, but they are also fatigue-prone, meaning they fire quickly and run out of steam quickly.2PubMed. Morphological substrate for eyelid movements: innervation and structure of primate levator palpebrae superioris and orbicularis oculi muscles When these fibers become hyperexcitable from fatigue, stimulants, or stress, they can start firing on their own in tiny, repetitive bursts. That is the flutter or pulse you feel under your eyelid.

When you close your eyes deliberately, you are engaging this muscle. If some of its motor units are already in a hyperexcitable state, the act of voluntary contraction can set off or amplify the involuntary twitching. You also lose the visual distractions that would normally keep you from noticing a subtle flutter. With your eyes shut, your attention narrows to what you can feel in the eyelid tissue, making a twitch that was present all along suddenly very obvious.

The Usual Suspects Behind Everyday Twitching

Eyelid myokymia is linked to motor unit hyperexcitability triggered by a handful of familiar lifestyle factors: stress, fatigue, stimulant use (especially caffeine), and exhaustion.3Uva Clinical Anaesthesia and Intensive Care. Eyelid Myokymia: Clinical Perspectives, Pathophysiological Insights, and Management Strategies Most people who experience it can point to at least one of these in their recent history. The twitch typically affects one eyelid at a time, lasts a few days to a few weeks, and then vanishes on its own once the triggering stressor eases up.

Caffeine deserves a specific mention because it is so common and so easily overlooked. People who have gradually increased their coffee, tea, or energy drink intake often do not register the change until the twitching starts. Caffeine increases the excitability of nerve terminals at the neuromuscular junction, which means those already-prone fast-twitch fibers around your eye are more likely to fire spontaneously. Cutting back or switching to decaf for a week is one of the simplest first experiments you can try.

Sleep deprivation is similarly underestimated. Even modest sleep debt over several nights can push eyelid motor neurons into a more excitable state. The fact that many people first notice the twitching when they lie down and close their eyes at night makes sense in this context: you are exhausted, your muscles have been active all day, and you have finally removed all competing sensory input.

Screen Time and the Digital Strain Connection

Prolonged screen use has emerged as a strong and independent trigger. A study comparing people with eyelid twitching to a matched control group found that those with twitching spent significantly more hours in front of digital screens, averaging close to seven hours per day compared to about five in the control group. More striking, there was a strong positive correlation between how long the twitching lasted and how much screen time the person logged.4PubMed Central. Association Between Eyelid Twitching and Digital Screen Time, Uncorrected Refractive Error, Intraocular Pressure, and Blood Electrolyte Imbalances Interestingly, the same study found no significant differences in refractive error, eye pressure, or blood electrolyte levels between the two groups, which suggests the screen time itself, not an underlying eye condition or mineral deficiency, was doing the heavy lifting.

Why screens provoke twitching is likely a combination of factors. You blink less when staring at a screen, which dries the corneal surface. The sustained focus demands constant fine adjustments from the muscles around your eye. And long screen sessions tend to coincide with other triggers like sitting in a fixed posture, staying up late, and drinking caffeine to stay alert. The twitching you notice at the end of a long workday, when you finally close your laptop and shut your eyes, is the accumulated result of all of this.

Dry Eyes and Corneal Irritation as a Feedback Loop

Dry eye is not just a side effect of screen time; it can be a direct driver of involuntary eyelid movements. Researchers have proposed that irritation of the corneal surface ramps up sensory input to the brainstem circuits that control blinking, and that over time, this heightened reflex activity can morph into sustained or repetitive eyelid spasms.5PubMed Central. Dry eye, blinking, and blepharospasm In other words, your eyes are dry, so your blink reflex goes into overdrive, and that hyperactive reflex starts producing twitches you did not ask for.

Allergies can compound this. Eye rubbing, which most allergy sufferers do without thinking, triggers a measurable increase in itching, swelling, and redness of the eye surface, even without allergen exposure. When allergens are present, the rubbed eye shows significantly worse symptoms at five, fifteen, and thirty minutes compared to the unrubbed eye.6Elsevier / ScienceDirect (Ophthalmology). Effect of eye rubbing on signs and symptoms of allergic conjunctivitis in cat-sensitive individuals The inflammation and irritation caused by rubbing feeds back into the blink reflex loop, potentially sustaining the twitching longer than it would last otherwise. If your twitching tends to flare during allergy season, this mechanism is probably part of the reason.

Twitching at the Edge of Sleep

Some people notice their eyelids twitching specifically as they are falling asleep, and this can be a slightly different phenomenon from daytime myokymia. During the transition from wakefulness to sleep, the brain progressively reduces its control over voluntary muscles. Small, fragmentary muscle contractions can occur throughout the body during this window. When these fragments involve the eyelid or facial muscles, they feel exactly like the twitching you get from caffeine or stress, but the mechanism is more about the brain letting go of motor control than about peripheral nerve excitability.

A related condition called excessive fragmentary hypnic myoclonus involves tiny muscle jerks that persist across different stages of sleep and even during relaxed wakefulness just before sleep onset.7Sleep Medicine. Excessive fragmentary hypnic myoclonus: clinical and neurophysiological findings In most cases, this is considered benign and does not disrupt sleep quality, but it can be unsettling if you are aware of it. The eyelids, with their high concentration of fatigue-prone fast-twitch fibers, are a common site for these sleep-transition twitches.

Do Minerals Actually Matter?

You will find plenty of advice online telling you to take magnesium supplements for eye twitching. The evidence for this is thinner than the internet suggests. A study comparing patients with blepharospasm (a more severe form of involuntary eye closure) to healthy controls found no significant difference in magnesium, phosphorus, or vitamin D levels between the two groups. The one mineral that did show a difference was calcium: patients with blepharospasm had significantly lower serum calcium, though their levels were still within the normal clinical range.8PubMed. Serum calcium, magnesium, phosphorus, and vitamin D in benign essential blepharospasm

The screen-time study mentioned earlier also found no significant electrolyte differences between people with eyelid twitching and those without.4PubMed Central. Association Between Eyelid Twitching and Digital Screen Time, Uncorrected Refractive Error, Intraocular Pressure, and Blood Electrolyte Imbalances This does not mean magnesium is irrelevant to muscle function in general, but it does mean that if your diet is reasonably balanced and your bloodwork is normal, magnesium supplements are unlikely to be the fix. They remain a plausible intervention for someone who is genuinely deficient, but “take magnesium” has become a reflexive recommendation that overshoots what the data actually supports for routine eyelid twitching.

Medications That Can Trigger or Worsen Twitching

Certain psychiatric medications are known to induce eyelid spasms. A case series documented twelve patients who developed blepharospasm while taking psychotropic drugs. On average, their symptoms started to improve about four weeks after stopping the medication, and two-thirds of them recovered completely.9PubMed Central. Twelve cases of drug-induced blepharospasm improved within 2 months of psychotropic cessation The medications implicated tend to be ones that alter dopamine signaling, including certain antipsychotics and antidepressants. If your eyelid twitching started shortly after beginning a new medication, mention this to your prescriber. Drug-induced cases are one of the more treatable forms because the fix is often straightforward: adjusting or switching the drug.

Eyelid myokymia has also been linked in clinical reviews to medication exposure more broadly, though the cases are uncommon enough that the association rests on individual reports and small series rather than large trials.3Uva Clinical Anaesthesia and Intensive Care. Eyelid Myokymia: Clinical Perspectives, Pathophysiological Insights, and Management Strategies Still, if you are on a medication and the twitching is persistent, it is worth having that conversation rather than assuming the twitching is just stress.

When Twitching Might Be Something More Serious

The overwhelming majority of eyelid twitching is benign myokymia that resolves on its own. But there are a few conditions where persistent or worsening twitching warrants medical attention.

  • Blepharospasm: This is a form of focal dystonia where the orbicularis oculi contracts forcefully and involuntarily, sometimes to the point of keeping the eyes squeezed shut. Unlike myokymia, which feels like a subtle ripple, blepharospasm involves strong, sustained contractions. EMG studies have identified distinct patterns of abnormal activity in these patients, ranging from dystonic discharges limited to the orbicularis oculi muscle to alternating tremulous discharges affecting both the closing and opening muscles of the eyelid.10Oxford Academic (Brain). Electromyographic features of levator palpebrae superioris and orbicularis oculi muscles in blepharospasm
  • Hemifacial spasm: This involves involuntary twitching that spreads beyond the eyelid to other muscles on the same side of the face, like the cheek or corner of the mouth. It is usually caused by a blood vessel compressing the facial nerve where it exits the brainstem. A study of hemifacial spasm patients found measurable differences in eyelid measurements between primary hemifacial spasm and cases that developed after facial nerve injury, suggesting different underlying mechanisms even within this one diagnosis.11PubMed Central. Periocular clinical differences between primary and postparalytic hemifacial spasm: A retrospective comparative study
  • Multiple sclerosis: In rare cases, facial myokymia or hemifacial spasm can be a presenting symptom of MS. A case report documented a 33-year-old man whose first MS symptom was eyelid myokymia that progressed to hemifacial spasm on the same side.12PubMed Central. Multiple Sclerosis Presenting with Facial Twitching (Myokymia and Hemifacial Spasms) This is uncommon enough that it should not cause alarm, but twitching that spreads, worsens over weeks, or is accompanied by numbness, vision changes, or weakness elsewhere deserves neurological evaluation.

The practical rule of thumb: if the twitch is limited to one eyelid, comes and goes, and has been present for less than a few weeks, it is almost certainly benign. If it involves both eyelids simultaneously, spreads to other facial muscles, persists beyond three months, or is accompanied by any other neurological symptom, get it checked.

The Anxiety Feedback Loop

Eyelid twitching has an ironic tendency to feed on itself. It starts because of stress or fatigue, you notice it, you worry about it, and the worry keeps it going. This pattern is well-documented with benign fasciculations more broadly. Patients with benign fasciculation syndrome frequently develop health anxiety, and the anxiety is overwhelmingly focused on fears of serious neurological disease like motor neuron disease.13Psychosomatics. The Association Between Benign Fasciculations and Health Anxiety: A Report of Two Cases and a Systematic Review of the Literature

With eyelid twitching specifically, the visibility of the symptom makes it worse. You can feel it, and if you look in a mirror, you can often see it. Every time you check whether the twitch is still there, you are directing attention to it, tensing the surrounding muscles, and reinforcing the cycle. If a doctor has confirmed the twitching is benign, one of the most effective things you can do is stop monitoring it. That sounds dismissive, but it is genuinely therapeutic: reducing the attentional spotlight allows the overexcited motor units to settle down faster.

Treatment for Persistent Cases

For ordinary eyelid myokymia, the treatment is the boring stuff: sleep more, reduce caffeine, manage stress, take breaks from screens, and use lubricating eye drops if your eyes feel dry. Most episodes resolve within a few weeks with these adjustments alone.

When twitching is severe enough to cross into blepharospasm or hemifacial spasm territory, botulinum toxin injections become the standard treatment. The toxin temporarily weakens the overactive muscle fibers, providing relief that lasts several months per injection cycle. It has been used effectively for blepharospasm, hemifacial spasm, and even chronic benign eyelid fasciculations that do not respond to conservative measures.14Canadian Journal of Neurological Sciences. Botulinum Toxin Injections in the Treatment of Blepharospasm, Hemifacial Spasm, and Eyelid Fasciculations Side effects are usually transient and include temporary drooping of the eyelid and dry eyes.15Survey of Ophthalmology. Botulinum A toxin (Oculinum®) in ophthalmology

One nuance worth knowing: in patients who have both blepharospasm and dry eye, botulinum toxin effectively stops the spasms but does not necessarily improve the dry eye symptoms. All patients in one study were relieved of their blepharospasm after injections, but only a minority noticed improvement in their dry eye.16PubMed Central. Botulinum toxin A treatment in patients suffering from blepharospasm and dry eye If dry eye is contributing to your twitching, as the feedback-loop model described earlier suggests, treating the spasm without addressing the underlying ocular surface problem may leave you in a cycle where the twitching keeps returning once the toxin wears off. This is why many specialists now treat both the muscle and the eye surface in parallel rather than focusing on one alone.

Why Some People Get It Constantly and Others Never Do

Individual susceptibility to eyelid myokymia varies a lot, and the reasons are not fully understood. Part of it is the threshold at which your particular motor neurons become hyperexcitable. People with naturally lower thresholds will start twitching from one bad night of sleep, while others can run on caffeine and four hours of rest without a single flutter. Genetics likely play a role in setting that threshold, but no specific gene variants have been pinpointed for ordinary myokymia.

The composition of the orbicularis oculi itself also varies between individuals. While the average is around 88% fast-twitch fibers, the range in studied specimens ran from about 86% to 92%.1The Journal of Craniofacial Surgery. Muscle Fiber Types of Human Orbicularis Oculi Muscle Someone at the higher end of that range has a muscle that is slightly more biased toward rapid, fatigue-prone contractions and could plausibly be more susceptible to spontaneous firing under stress. This is speculative at the level of individual prediction, but it fits the broader physiological picture.

Environmental factors also stack. A person who sleeps seven hours, drinks two cups of coffee, stares at screens for eight hours, has mild seasonal allergies, and is under work pressure is piling up five modest risk factors that together push the eyelid muscles past their tipping point. Remove any two of those factors and the twitching may stop. This stacking effect is why the same person can go years without a single episode and then have a month where it will not quit: the convergence of triggers matters more than any single one.