What Causes Styes on Your Eye and How to Prevent Them

A stye is caused by a bacterial infection in one of the small glands along your eyelid. The bacterium responsible is almost always Staphylococcus aureus, a common germ that lives on your skin and can work its way into a blocked or irritated gland. Once inside, it triggers a painful, red bump that looks similar to a pimple.

How a Stye Forms

Your eyelids contain dozens of tiny oil glands that help lubricate the surface of your eye. When one of these glands gets clogged by dead skin cells, dried oil, or debris, bacteria that normally sit harmlessly on your skin can multiply inside the blocked gland. Your immune system responds with inflammation, and the result is a swollen, tender lump.

There are two types. An external stye forms in a gland near the base of an eyelash, right at the outer edge of the lid. This is the more common kind. An internal stye develops deeper inside the eyelid, in the larger oil glands embedded in the eyelid’s inner structure. Internal styes tend to be more painful because they press against the eyeball, and they drain inward toward the inner surface of the lid rather than outward near the lash line.

Common Triggers and Risk Factors

Anything that introduces bacteria to your eyelid or blocks those oil glands raises your chances of getting a stye. The most common culprits are everyday habits you might not think twice about.

  • Touching your eyes with unwashed hands. Staph bacteria transfer easily from your fingers to your eyelids. This is the simplest and most frequent way infections start.
  • Sleeping in makeup. Cosmetics, especially eyeliner and mascara, can clog the gland openings along your lash line overnight. Old or expired products are even riskier because bacteria accumulate in the containers over time.
  • Poor contact lens hygiene. Contacts don’t cause styes directly, but handling them without clean hands, skipping disinfection, or wearing them longer than recommended can transfer bacteria to your eye.
  • Sharing towels, pillowcases, or eye makeup. These items collect bacteria and can pass them between people.

Dirty pillowcases are an underappreciated factor. Bacteria build up on bedding over days, and pressing your face into a contaminated pillowcase for hours every night gives germs easy access to your eyelids.

Underlying Conditions That Increase Risk

Some people get styes repeatedly, and that often points to a chronic eyelid condition rather than a one-time hygiene lapse. Blepharitis, a persistent low-grade inflammation of the eyelid margins, is the most common underlying cause of recurrent styes. It creates an environment where the oil glands are chronically irritated and partially blocked, making bacterial infection much more likely. Blepharitis itself can be triggered by skin conditions like seborrheic dermatitis (the same condition that causes dandruff) or rosacea that affects the eyes.

If you get styes more than once or twice a year, blepharitis is worth looking into. It’s manageable with consistent eyelid cleaning but rarely goes away on its own.

One common belief is that diabetes increases stye risk. A large cohort study published in Diabetes Care specifically tested this and found no association between diabetes and stye occurrence. The odds were essentially the same for people with type 1 diabetes, type 2 diabetes, and people without diabetes. Glycemic control didn’t make a difference either. So if you have diabetes and keep getting styes, the cause is more likely blepharitis or a hygiene issue than your blood sugar.

Stye vs. Chalazion

Not every bump on your eyelid is a stye. A chalazion looks similar but forms when a gland gets blocked without an active bacterial infection. The key difference is pain: a stye is tender, red, and often comes with a visible whitehead of pus. A chalazion is usually painless, firmer, and grows more slowly. Styes can sometimes turn into chalazia if the infection clears but the gland remains blocked, leaving behind a hard, non-tender lump.

How Long a Stye Lasts

Most styes resolve on their own within two to five days. In some cases they can linger for a week or longer, but the vast majority don’t need medical treatment. Applying a clean, warm compress for 10 to 15 minutes several times a day is the single most effective thing you can do to speed healing. The warmth loosens the clogged oil, encourages the gland to drain, and increases blood flow to the area. Resist the urge to squeeze or pop a stye, which can spread the infection deeper into the eyelid.

Preventing Styes From Coming Back

Prevention comes down to keeping bacteria away from your eyelid glands and keeping those glands from getting clogged. The American Optometric Association recommends a short list of habits that cover both goals:

  • Wash your hands before touching your eyes. Every time, no exceptions.
  • Remove all eye makeup before bed. Use a gentle cleanser or eye-specific wipes.
  • Replace eye makeup every three months. Mascara and liquid liner are especially prone to bacterial growth.
  • Never share eye makeup, towels, or pillows.
  • Clean contact lenses properly and follow the recommended wearing schedule. Don’t stretch daily lenses into multi-day use.
  • Wash pillowcases frequently. Once a week is a reasonable target.

If you’ve been diagnosed with blepharitis, daily eyelid scrubs with a mild cleanser become part of the routine. Warm compresses applied to closed eyes for a few minutes each morning can also help keep the oil glands flowing freely, reducing the chance that one gets blocked and infected again.