Styes are caused by bacterial infection of the small glands in your eyelid, almost always by Staphylococcus aureus, a bacterium that commonly lives on your skin and around your nose. When this bacterium gets into one of the oil or sweat glands at the base of your eyelashes, it triggers a painful, red, pus-filled bump that looks and feels a lot like a pimple.
But knowing the bacterium is only part of the picture. What most people really want to understand is why they got a stye in the first place, and whether something in their routine, health, or environment made it more likely.
How a Stye Forms
Your eyelids contain dozens of tiny glands. Along the lash line, small oil glands (called glands of Zeis) and sweat glands (glands of Moll) keep your eyelashes lubricated and protected. Deeper inside the eyelid, larger oil glands called meibomian glands produce the oily outer layer of your tear film, which stops your tears from evaporating too quickly.
A stye develops when bacteria enter one of these glands and multiply, creating a localized abscess. If the infection hits a gland near the eyelash root, the bump appears on the outer edge of the lid. This is the classic stye most people recognize. If bacteria infect a meibomian gland deeper in the lid, the swelling forms on the inner surface of the eyelid, pointing inward toward the eye. Both types cause redness, tenderness, and swelling that can sometimes spread across the whole lid before concentrating into a visible bump.
The Bacteria Behind It
Staphylococcus aureus is responsible for the vast majority of styes. This bacterium is remarkably common. Roughly 30% of people carry it on their skin or in their nasal passages at any given time without symptoms. It only becomes a problem when it migrates to a vulnerable spot, like a blocked or irritated eyelid gland, and gains a foothold.
In more serious or recurrent cases, a drug-resistant strain called community-associated MRSA (CA-MRSA) can be responsible. This strain produces a toxin that destroys tissue and white blood cells, which can lead to deeper lid abscesses. In one Dallas health system study, 86% of patients with MRSA-related lid infections had the community-associated strain rather than the hospital-acquired type. For most people with a single, uncomplicated stye, standard staph bacteria are the culprit, but recurrent or unusually severe styes may warrant testing for resistant strains.
Everyday Habits That Raise Your Risk
Bacteria need a way in. Several common habits make that easier:
- Touching your eyes with unwashed hands. This is the most straightforward route. Rubbing your eyes transfers staph bacteria from your fingers directly to the gland openings along your lash line.
- Old or shared eye makeup. Bacteria grow readily in mascara, eyeliner, and eyeshadow. Stanford Health Care recommends replacing eye makeup, especially mascara, at least every six months. Sharing makeup transfers someone else’s bacterial colonies directly to your lid margins.
- Sleeping in contact lenses. Overnight lens wear reduces oxygen flow to the eye surface and creates a warm, moist environment where bacteria thrive. It also makes you more likely to touch your eyes during insertion and removal.
- Not removing makeup before bed. Leftover cosmetics can clog the gland openings overnight, trapping bacteria inside.
None of these habits guarantee a stye, but each one shifts the odds. People who get styes repeatedly can often trace it back to one or more of these patterns.
Chronic Eyelid Conditions
Some people are prone to styes not because of a single bad habit but because of an ongoing condition affecting their eyelid glands.
Blepharitis, a chronic inflammation of the eyelid margins, is one of the most common culprits. It creates a cycle: the lid margins stay irritated, bacterial colonies build up along the lash line, and glands become partially blocked. Each of those factors makes infection more likely. People with blepharitis often describe getting styes in clusters or having one resolve only for another to appear weeks later.
Ocular rosacea is another significant driver. A study of ocular rosacea patients found that 85% had dysfunction of their meibomian glands. When those glands can’t secrete oil properly, they become plugged, and plugged glands are an invitation for bacterial infection. The National Rosacea Society notes that swollen eyelids and styes are common features of ocular rosacea, which can affect people even if they don’t have obvious facial rosacea symptoms.
Systemic Health Factors
Your overall health plays a role too. Diabetes is the most well-documented systemic risk factor. High blood sugar impairs the immune system’s ability to fight off bacterial infections throughout the body, and the eyelids are no exception. The Texas Department of State Health Services lists styes specifically among the bacterial infections that people with diabetes are more susceptible to, alongside boils and infections of the hair follicles.
Chronic stress and sleep deprivation can also contribute, though the mechanism is less direct. Both suppress immune function over time, making it harder for your body to contain staph bacteria before they establish an infection. People who notice styes appearing during high-stress periods aren’t imagining the connection.
Who Gets Styes Most Often
Styes can happen at any age, but they aren’t evenly distributed. A large Japanese study tracking over one million procedures for styes and related eyelid lumps over nine years found a revealing pattern: invasive treatments for styes peaked in children aged 10 to 14 and again in adults in their 30s. Young women were especially likely to need treatment, with the female-to-male ratio reaching nearly 2:1 in the 15 to 24 age range.
The reasons likely overlap with the risk factors above. Adolescents are beginning to use cosmetics, may have inconsistent hygiene habits, and experience hormonal changes that affect oil production. Adults in their 30s face the combination of workplace stress, contact lens use, and the early stages of age-related changes in oil gland function.
What Helps a Stye Resolve
Most styes drain on their own within a week or two. The standard first-line approach is warm compresses: a clean, warm cloth held against the closed eyelid for 10 to 15 minutes, several times a day. The heat softens the blocked material inside the gland and encourages it to drain naturally. Consistency matters more than intensity. A few minutes once won’t do much, but regular compresses over several days typically bring relief.
Resist the urge to squeeze or pop a stye. Forcing it open can push the infection deeper into the lid tissue or spread bacteria to neighboring glands. If a stye doesn’t improve with warm compresses after a couple of weeks, or if the swelling spreads beyond a localized bump, antibiotic drops or ointment can help clear the infection. In severe or persistent cases, a minor in-office procedure to drain the stye may be needed, though this is uncommon.
Preventing Recurrence
If you’ve had one stye, you’re statistically more likely to get another. The bacteria that caused the first infection are still present on your skin, and whatever conditions allowed it to take hold probably haven’t changed on their own.
The most effective prevention targets the glands themselves. Daily lid hygiene, gently cleaning the base of your eyelashes with diluted baby shampoo or a commercial lid scrub, removes the bacterial buildup and debris that block gland openings. For people with blepharitis or rosacea, this daily cleaning is especially important because those conditions create a perpetual low-grade environment for infection.
Replacing mascara and eyeliner regularly, washing your hands before touching your face, removing all makeup before sleep, and following proper contact lens care are simple changes that meaningfully reduce your risk. If you have diabetes, maintaining stable blood sugar helps your immune system do its job at the eyelid level, just as it does everywhere else in the body.