What Causes a Stye: Bacteria, Blocked Glands & More

A stye is caused by a bacterial infection in one of the tiny oil-producing glands or hair follicles along your eyelid. The bacterium responsible is almost always Staphylococcus aureus, a common skin microbe that normally lives on your face without causing problems. When one of the small gland openings along your lash line gets blocked, bacteria multiply inside, triggering the painful red bump most people recognize as a stye.

How a Stye Forms

Your eyelids contain dozens of small glands that produce oils to keep your eyes lubricated and your tears from evaporating too quickly. Some of these glands sit right at the base of your eyelashes, while larger ones are embedded deeper inside the eyelid itself. Each gland has a tiny opening that can become clogged by dead skin cells, dried oil, or debris.

Once one of those openings is blocked, the oil meant to flow onto your eye’s surface gets trapped. Bacteria that were already living on the skin surface now have a warm, sealed-off pocket of nutrients to feed on. Your immune system responds with inflammation, and within a day or two, a tender, swollen bump forms. That’s the stye. It fills with pus as white blood cells flood the area to fight the infection.

External vs. Internal Styes

Not all styes form in the same spot, and the location determines how they feel and how quickly they resolve.

External styes are the most common type. They develop at the base of an eyelash, in one of the small oil or sweat glands near the lash follicle. These are the ones you can usually see as a visible pimple-like bump right along the edge of your eyelid.

Internal styes form deeper inside the eyelid, in the larger oil glands that line its inner surface. Because they’re buried under more tissue, internal styes tend to be more painful and may not produce an obvious head. You might feel a deep ache when you blink or notice swelling across a broader area of the lid. Internal styes sometimes take longer to drain and are more likely to turn into a chalazion, a firm, painless lump that lingers after the infection clears.

Risk Factors That Make Styes More Likely

Some people get styes once and never again. Others deal with them repeatedly. The difference usually comes down to conditions that keep the eyelid glands chronically irritated or blocked.

Blepharitis is the single biggest risk factor. This is ongoing, low-grade inflammation of the eyelid margins that causes crusty debris to build up along your lash line. That debris clogs gland openings, creating the perfect setup for infection. If you wake up with sticky, flaky eyelids on a regular basis, blepharitis is likely the underlying issue driving recurrent styes.

Ocular rosacea is another common contributor. People with rosacea on their face often develop it around their eyes as well, where it disrupts the function of the oil glands in the eyelids. Cleveland Clinic notes that healthcare providers sometimes describe ocular rosacea as meibomian gland dysfunction, because the glands become chronically inflamed and produce thickened, sluggish oil that blocks easily. Styes and chalazia are listed among the most common symptoms.

Other everyday factors increase your risk too:

  • Touching your eyes with unwashed hands transfers bacteria directly to the eyelid margin.
  • Sleeping in eye makeup clogs gland openings with cosmetic residue overnight.
  • Old or contaminated makeup can harbor bacteria, especially mascara and eyeliner that contact the lash line.
  • Contact lens handling with poor hygiene introduces bacteria near the eye.
  • Stress and sleep deprivation weaken your immune response, making it harder to keep normal skin bacteria in check.

Stye vs. Chalazion

These two bumps look similar enough that even doctors sometimes find them hard to tell apart initially. The key difference is what’s happening inside. A stye is an active bacterial infection: red, warm, tender, and often with a visible pus-filled center. A chalazion is a blocked gland without active infection. It forms when trapped oil hardens and triggers a slow inflammatory reaction, producing a firm, painless lump that can persist for weeks or months.

In practice, a stye can become a chalazion. Once the infection clears but the gland remains blocked, the leftover inflammation solidifies into that characteristic hard nodule. If you have a bump on your eyelid that was painful at first but has since become painless and firm, it has likely transitioned from a stye to a chalazion.

How Long a Stye Lasts

Most styes resolve on their own within one to two weeks. The bump gradually comes to a head, drains (often while you sleep or during a warm compress), and the swelling subsides. Warm compresses are the standard home treatment: a clean washcloth soaked in warm water and held against the closed eye for 10 to 15 minutes, several times a day. The heat softens the blocked oil and encourages the stye to drain naturally.

You should avoid squeezing or popping a stye. Forcing it open can push the infection deeper into the eyelid tissue or spread bacteria to surrounding glands, potentially causing multiple styes at once.

When a Stye Becomes Serious

Styes are almost always harmless, but in rare cases the infection can spread beyond the gland into the surrounding skin and soft tissue of the eyelid. This is called preseptal (periorbital) cellulitis, and it looks noticeably different from a simple stye. Instead of a localized bump, the entire eyelid becomes red, swollen, and warm to the touch. If the infection spreads even deeper into the eye socket, it can cause fever, eye pain, vision changes, or bulging of the eye. That progression requires emergency care.

Signs that a stye needs medical attention include swelling that spreads beyond the eyelid, redness extending across your cheek or brow, a fever, any change in your vision, or a stye that hasn’t improved at all after two weeks of warm compresses. Recurrent styes, meaning three or more in a year, also warrant a visit to check for underlying blepharitis or rosacea that may need ongoing treatment.