How Do You Get a Stye? Causes and Prevention

Styes form when bacteria infect one of the tiny oil glands along your eyelid margin. The most common culprit is Staphylococcus aureus, a bacterium that naturally lives on your skin and inside your nose. When an oil gland gets blocked, its secretions stagnate, creating the perfect environment for that bacteria to multiply. The result is a red, painful bump that looks and feels like a small pimple on your eyelid.

What Happens Inside Your Eyelid

Your eyelids contain dozens of small glands that produce oils to keep your eyes lubricated. When one of these glands becomes clogged, the oil thickens and backs up. Bacteria that are already present on your skin move into the stalled gland and trigger an infection. Your immune system responds with inflammation, and a tender, swollen lump forms near the lash line.

There are two types. External styes are far more common and develop when an oil gland attached to an eyelash follicle gets infected. Each lash has one or two of these small glands. Internal styes occur deeper in the eyelid, in the larger oil glands embedded within the eyelid’s cartilage-like tissue. Internal styes tend to be more painful because the swelling presses against the eye itself.

The Most Common Causes

Touching Your Eyes With Dirty Hands

This is the single most direct route. Staph bacteria live in your nose, on your fingertips, and on surfaces you touch throughout the day. Rubbing your eye or adjusting your lashes transfers those bacteria straight to the glands along your eyelid. People who wear contact lenses are especially vulnerable because inserting and removing lenses means frequent hand-to-eye contact. The lenses themselves don’t cause styes, but the handling creates more opportunities for bacteria to reach your eyelids.

Old or Shared Makeup

Your eyelashes naturally carry bacteria. The moment a mascara wand or eyeliner brush touches your lashes, it picks up those microbes and deposits them back into the product. Over time, bacteria build up inside the container, and each use increases the chance of infection. Experts recommend replacing eye cosmetics every three to four months, even if there’s product left. Sharing makeup is riskier still, since you’re introducing someone else’s bacteria directly to your eyelid. Storing cosmetics in hot environments (above 85°F) also weakens preservatives and lets bacteria grow faster.

Chronic Eyelid Inflammation

If you have blepharitis (ongoing irritation and flaking at the base of your lashes) or meibomian gland dysfunction, your oil glands are already partially blocked on a regular basis. That chronic thickening and stasis of gland secretions makes secondary bacterial infection much more likely. People with these conditions tend to get styes repeatedly rather than as a one-time event.

Rosacea

About 13 million Americans have rosacea, a skin condition that produces redness, broken blood vessels, and small pus-filled bumps. Rosacea can affect the eyes too, a form called ocular rosacea, which blocks oil glands around the eyelids and makes recurring styes significantly more common.

Are Styes Contagious?

Technically, yes, but it’s rare. The bacteria that cause styes can transfer from one person to another through direct contact or shared items like towels and pillowcases. The more realistic risk is self-contamination: touching a stye on one eye and then touching the other eye, or rubbing your nose and then your eyelid. If you have an active stye, using your own towels and washing pillowcases frequently reduces the small chance of spreading it.

How Long Styes Last

Most styes resolve on their own in one to two weeks. They typically come to a head, drain, and shrink without any medical treatment. Warm compresses speed the process by softening the clogged oil and encouraging the gland to open. Soak a clean cloth in hot (not scalding) water and hold it against the closed eyelid for 10 to 15 minutes, reheating the cloth as it cools. Doing this several times a day is the most effective home treatment.

If the pain and swelling haven’t started improving after 48 hours of consistent warm compresses, or if they get worse after the first two to three days, it’s worth having an eye doctor take a look. Occasionally a stye that doesn’t drain on its own hardens into a painless but persistent lump called a chalazion, which may need a minor in-office procedure to clear.

When a Stye Becomes Something More Serious

In rare cases, the infection can spread beyond the gland into the surrounding eyelid tissue, a condition called periorbital cellulitis. Warning signs include a fever alongside increasing swelling that spreads across the entire eyelid or around the eye socket, significant eye pain, vision changes, or the eye itself starting to bulge forward. These symptoms need immediate medical attention, particularly in children, because the infection can progress deeper into the eye socket if untreated.

Preventing Styes From Coming Back

If you’ve had one stye, you’re more likely to get another, especially if you have an underlying eyelid condition. A simple daily routine can make a real difference. Apply a warm compress to your closed eyelids for 10 to 15 minutes, then gently massage the lids toward the lash line to keep the oil glands flowing. Use a clean cotton swab to wipe away any crusts or debris along the lash margin. The UK’s National Institute for Health and Care Excellence recommends continuing this routine even when your eyes feel fine, not just during flare-ups.

Beyond the compress routine, a few habits help keep bacteria away from your eyelids:

  • Wash your hands before touching your eyes or handling contact lenses.
  • Replace eye makeup every three to four months and never share it.
  • Clean contact lenses with fresh solution every time, follow the replacement schedule, and swap out the lens case regularly.
  • Discard contacts you were wearing when a stye developed, especially monthly or bi-weekly lenses, to avoid reintroducing bacteria.
  • Avoid rubbing your eyes, particularly after touching your nose, where staph bacteria commonly live.