What Causes a Sty in Your Eye and How to Prevent It

A sty forms when one of the tiny oil-producing glands along your eyelid gets blocked and infected, almost always by Staphylococcus aureus, a bacterium that naturally lives on your skin. The blockage traps oily secretions inside the gland, creating a warm, stagnant environment where bacteria multiply and trigger a small abscess. The result is that familiar red, painful bump at the edge of your eyelid.

How a Blocked Gland Becomes Infected

Your eyelids contain dozens of small glands that produce oils to keep your tears from evaporating too quickly. When one of these glands gets clogged, its secretions thicken and stagnate. That stagnation is the first step. Bacteria already present on your skin then colonize the trapped material, and your immune system responds by flooding the area with white blood cells. The bump you see and feel is essentially a tiny pocket of immune cells and debris packed into the blocked gland.

This process can happen in two slightly different locations, which is why doctors distinguish between two types:

  • External sty: Forms in the smaller oil or sweat glands (called Zeis or Moll glands) at the base of an eyelash. This is the more common type and appears right at the eyelid margin.
  • Internal sty: Forms deeper in the eyelid, in the larger meibomian glands embedded in the firm tissue of the lid. These tend to be more painful and may point inward toward the eye rather than outward.

The Most Common Triggers

Anything that introduces bacteria to your eyelid or promotes gland blockages raises your risk. The most frequent triggers are everyday habits you might not think twice about.

Touching your eyes with unwashed hands is the single most direct way to transfer staph bacteria to your eyelid glands. Children are especially prone to styes for this reason, since frequent eye rubbing and inconsistent handwashing are normal parts of childhood. Old eye makeup is another major culprit. Bacteria grow readily in mascara and eyeliner, which is why cosmetics experts recommend replacing mascara at least every six months. Sleeping in eye makeup compounds the problem by leaving pore-clogging material on your lash line for hours.

Contact lens hygiene matters too. Inserting or removing lenses without clean hands, or wearing lenses longer than recommended, gives bacteria easy access to the eyelid area.

Blepharitis and Chronic Eyelid Inflammation

If you get styes repeatedly, the underlying cause is often blepharitis, a chronic low-grade inflammation of the eyelid margins. Blepharitis causes the oil glands to produce thicker, stickier secretions that are more likely to clog. It also changes the bacterial balance along the lash line, encouraging staph overgrowth. Many people with blepharitis don’t realize they have it because the symptoms (mild redness, flaky skin near the lashes, a gritty feeling) are easy to dismiss.

Ocular rosacea, a form of rosacea that affects the eyes, works through a similar mechanism. It inflames the meibomian glands and makes them prone to blockage. Tiny skin mites called Demodex, which live in eyelash follicles in small numbers on most adults, can also contribute when their population grows large enough to irritate the glands.

Do Stress and Poor Sleep Play a Role?

There is no direct scientific evidence linking stress to styes. However, the connection people notice is not imaginary. Stress hormones suppress parts of your immune system, making your body less effective at keeping staph bacteria in check. A 2017 study found that certain stress hormones break down into compounds that may actually attract bacteria to vulnerable areas of the body.

Sleep deprivation works along similar lines. Poor sleep reduces the effectiveness of T cells, a type of immune cell critical for fighting infections. There’s also a practical angle: when you’re exhausted, you’re more likely to skip nighttime routines like removing makeup or washing your face, leaving your eyelid glands exposed to bacteria overnight.

What a Sty Feels and Looks Like

A sty typically starts as tenderness or a slight swelling along the eyelid edge. Within a day or two, a visible red bump forms, often with a small white or yellow center where pus is collecting. The eyelid may swell enough to make it hard to open fully, and your eye might water more than usual. Most styes come to a head and drain on their own within a few days. Without any treatment, the full cycle from first twinge to complete resolution usually takes one to two weeks.

Warm compresses speed things along. Holding a clean, warm washcloth against the closed eyelid for 10 to 15 minutes several times a day softens the blocked secretions and encourages the sty to drain naturally. Resist the urge to squeeze or pop it, which can spread the infection deeper into the eyelid tissue.

When a Bump Is Not a Sty

Most eyelid bumps are harmless styes or chalazia (a chalazion is a similar bump caused by a blocked gland without active infection). But a small number of eyelid lumps turn out to be something more serious. Sebaceous carcinoma, a rare cancer of the oil glands, can mimic the appearance of a recurring sty. The warning signs that set it apart include a firm, painless, yellowish bump that doesn’t resolve in a few weeks, a sore on the eyelid that bleeds or keeps coming back after appearing to heal, loss of eyelashes near the bump, and thickened or crusty skin along the lash line. Any eyelid lump that persists beyond a month or keeps recurring in the exact same spot deserves a closer look from an eye doctor.

Reducing Your Risk

Preventing styes comes down to keeping bacteria away from your eyelid glands and keeping those glands flowing freely. Wash your hands before touching your face or eyes. Remove all eye makeup before bed, and toss mascara and liquid eyeliner after six months regardless of how much is left. If you wear contact lenses, follow the recommended replacement schedule and always handle them with clean hands.

For people with blepharitis or a history of recurrent styes, a daily eyelid hygiene routine makes a real difference. This means applying a warm compress to your closed eyelids for several minutes each day to soften gland secretions, then gently cleaning along the lash line with diluted baby shampoo or a commercial lid scrub. This is the same first-line approach recommended by the American Academy of Ophthalmology for managing chronic eyelid inflammation. Done consistently, it keeps the glands open and reduces the bacterial load that leads to infection.