What Causes a Stye in the Eye and How to Prevent It

A stye is caused by a bacterial infection in one of the tiny oil or sweat glands along your eyelid margin. The bacterium responsible is almost always Staphylococcus aureus, a common germ that lives on skin and around the nose. When one of these glands gets blocked, the trapped secretions create a breeding ground for bacteria, and the result is the painful, red bump you recognize as a stye.

How the Infection Starts

Your eyelids contain several types of small glands that produce oils and fluids to keep the eye surface lubricated. A stye forms when one of these glands becomes clogged and bacteria multiply inside it. The blockage comes first, trapping oily secretions that would normally flow out onto the eyelash base or inner lid surface. Staph bacteria, which are already present on your skin in small numbers, then colonize the stagnant material and trigger an infection.

There are two types, depending on which gland is affected. An external stye develops in the Zeis or Moll glands, which sit near the base of your eyelashes. These are the more common kind and appear as a visible bump right at the eyelid edge. An internal stye forms deeper inside the lid, in the meibomian glands that line the inner surface. Internal styes tend to be more painful because they press against the eyeball, and the swelling may not be as visible from the outside.

Common Triggers and Risk Factors

Anything that introduces bacteria to your eyelid or clogs those tiny glands raises your risk. The most straightforward cause is touching or rubbing your eyes with unwashed hands, which transfers staph bacteria directly to the lid margin. But several other everyday habits play a role.

  • Old or shared eye makeup. Mascara and liquid eyeliner are considered safe for about three months after opening. Beyond that, bacteria accumulate in the product and applicator. Sharing eye makeup transfers someone else’s bacteria to your lids.
  • Sleeping in makeup. Leaving cosmetics on overnight blocks the gland openings along your lash line, creating exactly the kind of stagnation that leads to infection.
  • Contact lens habits. Handling lenses with dirty hands, wearing them longer than recommended, or not cleaning and storing them properly all increase the chance of bacterial transfer to the eye area.
  • Chronic eyelid inflammation (blepharitis). If your eyelids are frequently red, flaky, or crusty at the base of the lashes, you have ongoing low-grade inflammation that disrupts normal gland function. People with blepharitis get styes more often because their glands are already partially blocked.
  • Skin conditions like rosacea. Ocular rosacea often causes meibomian gland dysfunction, meaning the oil glands in your lids don’t work properly. Styes and chalazia are among the most common complications.

Stress and sleep deprivation are often cited as triggers, likely because they weaken immune defenses enough to let a minor gland blockage progress into a full infection. Hormonal changes can also alter the consistency of the oils your eyelid glands produce, making blockages more likely.

Stye vs. Chalazion

A chalazion looks similar but develops differently. Both start with a blocked gland, but a chalazion is an inflammatory reaction to trapped oil rather than a bacterial infection. In the first day or two, they can be hard to tell apart. After that, the differences become clearer: a stye stays painful and localizes to the eyelid margin, while a chalazion settles into a small, painless nodule closer to the center of the lid. Chalazia tend to last longer and sometimes need minor drainage if they don’t resolve on their own. An internal stye can sometimes turn into a chalazion if the acute infection clears but the gland remains blocked.

What to Expect During Healing

Most styes resolve on their own in one to two weeks without any medical treatment. The standard approach is applying a warm compress to the affected eye for 10 to 15 minutes, several times a day. The heat loosens the clogged material inside the gland and encourages it to drain naturally. You may notice a small amount of pus at the head of the bump before it opens and the swelling starts to go down.

Resist the urge to squeeze or pop a stye. Forcing it open can spread the infection to surrounding tissue. Let it drain on its own, and keep the area clean. If you wear contact lenses, switch to glasses until the stye heals. Avoid eye makeup during this time as well.

When a Stye Becomes Serious

Styes rarely cause problems beyond temporary discomfort, but in uncommon cases the infection can spread beyond the gland into the surrounding eyelid tissue. This is called preseptal cellulitis, and it causes the entire eyelid to become hot, red, and significantly swollen. If swelling spreads past the eyelid, you develop fever, your vision changes, you see double, or you can’t move your eye normally, the infection may have reached deeper tissues behind the eye. These signs need prompt medical attention, particularly in children, who are more vulnerable to orbital infections spreading quickly.

A stye that doesn’t improve after two weeks, keeps coming back in the same spot, or grows large enough to press on the eyeball and blur your vision is also worth having evaluated. Recurrent styes sometimes signal an underlying issue like chronic blepharitis or meibomian gland dysfunction that benefits from targeted treatment.

Reducing Your Risk

Since most styes trace back to bacteria meeting a blocked gland, prevention focuses on keeping both in check. Wash your hands before touching your face or handling contact lenses. Replace mascara and liquid eyeliner every three months, and never share eye cosmetics. Remove all eye makeup before bed.

If you’re prone to styes, a daily lid hygiene routine helps. After your warm compress, gently clean the base of your lashes with diluted baby shampoo or a commercially available lid scrub. This clears away the debris and bacterial buildup that contribute to gland blockages. For people with rosacea or chronic blepharitis, managing the underlying condition is the most effective way to break the cycle of recurring styes.