What Causes a Stye: Bacteria, Habits, and More

A stye is caused by a bacterial infection in one of the small glands along your eyelid. The bacterium responsible in most cases is Staphylococcus aureus, a common germ that lives on skin and can slip into a gland opening when conditions are right. The result is a red, painful bump that looks a bit like a pimple on the edge of your eyelid. Most styes resolve on their own within one to two weeks, but understanding what triggers them can help you avoid repeat episodes.

How a Stye Forms

Your eyelids contain dozens of tiny glands that produce oils to keep your eyes lubricated. When one of these glands gets clogged, secretions build up behind the blockage. That stagnant environment gives bacteria, especially staph, an easy foothold. The gland becomes infected, swells, and fills with pus.

The blockage itself can happen for several reasons. The oils your glands produce can thicken over time, especially with age or hormonal changes. Dead skin cells can accumulate around the gland opening. Once the flow of oil slows or stops, bacteria that were harmlessly sitting on your skin surface now have a warm, enclosed space to multiply.

External vs. Internal Styes

Not all styes form in the same spot, and the location depends on which gland is involved.

An external stye is the more common type. It develops at the base of an eyelash, where a small oil gland opens directly into the hair follicle. You’ll see redness and swelling right at the lash line, centered around a single eyelash root.

An internal stye forms deeper in the eyelid, inside one of the larger oil-producing glands that line the inner surface. These tend to be more painful because the swelling presses against the eye itself. When an internal stye “points,” it shows as a yellowish spot on the inside of the eyelid rather than the outer edge.

Conditions That Raise Your Risk

Certain chronic conditions make styes significantly more likely because they create ongoing inflammation or gland dysfunction along the eyelid.

Blepharitis is the most direct risk factor. This is chronic inflammation of the eyelid margins that causes flaking, crusting, and irritation along the lash line. The inflammation disrupts normal gland function and creates an environment where bacteria thrive. People with blepharitis often get styes repeatedly.

Rosacea can extend beyond facial skin to affect the eyes, a condition called ocular rosacea. It causes recurrent eyelid infections, including styes, likely because the condition leads to blocked glands in the eyelids. If you have facial rosacea and get frequent styes, the two are probably connected.

Meibomian gland dysfunction is a condition where the oil glands in your eyelids become chronically obstructed. The lining of the gland ducts thickens and the oils they produce become waxy and viscous. Studies of lid swabs from people with this condition show higher rates of Staphylococcus aureus colonization compared to healthy eyelids, which helps explain the stye connection.

The Role of Eyelid Mites

Microscopic mites called Demodex live in the hair follicles and oil glands of most adults. They’re usually harmless, but when their population grows too large, they can contribute to eyelid problems. One species, Demodex folliculorum, clusters around lash follicles and has been linked to anterior blepharitis. Another species, Demodex brevis, lives inside the oil glands themselves and is associated with gland dysfunction.

These mites cause trouble in a few ways. They physically block the openings of glands, trapping secretions inside. They consume the lining of follicles to lay eggs, which distorts the follicle structure. Their outer shells can also trigger an inflammatory response from your immune system. While the mites’ direct role in causing individual styes is still debated, heavy infestations clearly set the stage for the kind of chronic eyelid inflammation that makes styes more frequent.

Makeup and Hygiene Habits

Old cosmetics are a surprisingly potent source of the bacteria that cause styes. A study published in a medical journal found that Staphylococcus aureus bacteria are present in mascara after just three months of use. Over time, bacteria and mold steadily contaminate makeup products, and applying contaminated cosmetics directly to your lash line delivers those organisms right to the glands where styes develop.

Sharing eye makeup multiplies the risk because you’re introducing someone else’s bacterial flora to your eyelids. Sleeping in makeup is another common trigger. When cosmetics sit on your lids overnight, they mix with natural oils and dead skin to form a paste that clogs gland openings. Any habit that brings bacteria closer to your eyelid glands, or blocks those glands from draining normally, increases your chances of developing a stye.

Touching your eyes with unwashed hands is the simplest and most common way staph bacteria reach your eyelids. Most people touch their face dozens of times a day without thinking about it.

Stress, Sleep, and Immune Function

No study has directly proven that stress causes styes, but the indirect connection is plausible enough that many eye specialists consider it a contributing factor. Stress hormones can weaken your immune response, making your body less effective at keeping bacterial populations in check. One 2017 study found that stress hormones get converted into a compound that may actually help attract bacteria to vulnerable areas of the body.

Sleep deprivation works through a similar pathway. Poor sleep specifically reduces the effectiveness of T cells, the immune cells responsible for fighting off infections. There’s also a practical angle: when you’re exhausted, you’re less likely to remove eye makeup before bed or wash your hands before rubbing your tired eyes. The combination of lowered immunity and lapsed hygiene habits is a recipe for eyelid infections.

Styes vs. Chalazia

A stye and a chalazion can look similar, but they have different causes. A stye is an active bacterial infection, which is why it’s painful, red, and tender from the start. A chalazion is a clogged oil gland without infection. It forms a firm, usually painless bump that tends to sit farther back on the eyelid than a stye does.

The distinction matters because a stye that doesn’t fully resolve can sometimes turn into a chalazion. Once the acute infection clears, if the gland remains blocked, the trapped oils harden into a painless lump that can linger for weeks or months. So while the two conditions are different, they exist on a related spectrum of eyelid gland problems.

Signs That Need Attention

Most styes drain and heal without any treatment. Warm compresses held against the eyelid for 10 to 15 minutes, several times a day, help the gland open and drain faster. If pain and swelling haven’t started improving after 48 hours of home care, that’s a reasonable point to see an eye doctor.

Certain symptoms warrant a quicker visit: your eye swelling shut, pus or blood leaking from the bump, blisters forming on your eyelid, your eyelids feeling hot to the touch, or any change in your vision. Styes that keep coming back also deserve professional evaluation, since recurrent styes often signal an underlying condition like blepharitis or meibomian gland dysfunction that benefits from targeted treatment.