A stye forms when bacteria infect one of the tiny oil-producing glands or hair follicles along your eyelid margin. The culprit is almost always Staphylococcus aureus, a bacterium that already lives on most people’s skin and only causes trouble when it gets trapped inside a blocked gland. The process is essentially the same as getting a pimple, just in an especially sensitive and annoying location. Understanding how bacteria reach those glands, and what makes some people more vulnerable than others, points directly to effective prevention.
What Happens Inside Your Eyelid
Your eyelids are packed with small glands that serve different purposes. Meibomian glands, embedded deep in the eyelid’s supportive tissue, produce an oily substance called meibum that forms the outermost layer of your tear film and keeps tears from evaporating too quickly. Closer to the surface, Zeis glands secrete oil into your eyelash follicles, and Moll glands produce sweat near the lash line. A stye begins when one of these glands or a lash follicle gets clogged with dead skin cells, dried oil, or debris. Once the opening is plugged, bacteria that would normally be swept away by blinking and tears instead multiply inside the blocked space. The immune system responds with inflammation, and the result is a red, painful, pus-filled bump.
External styes, which sit right at the eyelash line, are the more common type. They involve a Zeis oil gland or a Moll sweat gland associated with an eyelash follicle. Internal styes develop deeper inside the eyelid when a Meibomian gland becomes infected. Internal styes tend to be more painful because the swelling presses against the eyeball, but both types share the same basic mechanism of blockage followed by bacterial infection.
The Bacteria Behind It
Staphylococcus aureus is responsible for the vast majority of styes. This bacterium is remarkably versatile and can infect structures throughout the eye, from the tear duct and eyelid to the conjunctiva and cornea.1PubMed Central. The Pathogenesis of Staphylococcus aureus Eye Infections Most healthy people carry S. aureus on their skin or inside their nostrils without any symptoms. The bacterium only becomes a problem when it gains entry to a space it can colonize, like a blocked eyelid gland where it is shielded from your normal defenses.
Other staphylococcal species, particularly Staphylococcus epidermidis, can also play a role, especially in people who wear contact lenses or have chronic eyelid inflammation. But S. aureus is the dominant player. This is worth knowing because it means a stye is not something you “catch” from another person in the way you catch a cold. The bacteria are already on you. What triggers a stye is the local conditions that let those bacteria flourish.
How Bacteria Reach Your Eyelid Glands
The most straightforward route is your own fingers. Every time you rub your eyes, you transfer bacteria from your hands to your eyelid margin. If a gland opening is already slightly narrowed by dried oil or flaky skin, that bacterial deposit can be enough to start an infection. This is why styes are so common in children, who touch their faces constantly and are less consistent about hand washing.
Eye makeup is another frequent pathway. Eyeliner applied to the inner lash line (the waterline) is especially problematic because it sits right on top of the Meibomian gland openings. Research has found that people who apply eyeliner to the inner lash line show significantly higher rates of ocular surface irritation compared to the general population, because cosmetic particles interact with the tear film and meibomian glands with every blink.2Scientific Reports. The impact of eyeliner usage on dry eye symptoms Over time, this repeated disruption can contribute to gland blockage. Old makeup is worse, since bacteria multiply in cosmetic products that sit around for months. Mascara wands and eyeliner pencils that contact the lash line and then go back into a tube or cap create a perfect incubation cycle.
Contact lenses add another layer of risk. Lens storage solutions can harbor bacteria, with Pseudomonas aeruginosa and Staphylococcus epidermidis being the most commonly found contaminants. One study found that the highest rates of lens-related eye infections occurred in younger users and in those who wore lenses for extended periods, with infections rising sharply among people who kept lenses in for a full day compared to shorter wear times.3Integrative Biomedical Research. Risks, Identification, and Antibiotic Susceptibility Against High Prevalence of Bacterial Infection in Contact Lens Solutions Even if contaminated lenses do not directly cause a stye, they deposit bacteria along the eyelid margin every time you insert or remove them, raising the overall bacterial load near vulnerable glands.
Demodex Mites as a Hidden Factor
Tiny parasitic mites called Demodex live in the hair follicles and oil glands of most adults’ faces, including the eyelash follicles. In small numbers they are harmless, but when populations grow too large they can contribute to chronic eyelid inflammation known as blepharitis. What makes Demodex relevant to styes is that these mites physically carry bacteria. They harbor Streptococcus and Staphylococcus species on their body surface and a bacterium called Bacillus oleronius inside their gut, which produces antigens that provoke an immune reaction in the eyelid.4PubMed Central. Demodex Blepharitis: A Comprehensive Review of the Disease, Current Management, and Emerging Therapies – Section: Bacterial Dysbiosis
The connection creates a vicious cycle. Demodex overgrowth causes itching and irritation, so people rub their eyes. Rubbing transfers additional bacteria from the skin to the eyelid margin, and it physically pushes mites and their bacterial cargo deeper into follicles and glands. Studies have found a positive correlation between Staphylococcus epidermidis levels and Demodex mite density, meaning the more mites you have, the more staph bacteria are present on the eyelid.4PubMed Central. Demodex Blepharitis: A Comprehensive Review of the Disease, Current Management, and Emerging Therapies – Section: Bacterial Dysbiosis If you get styes repeatedly and also notice crusty, flaky debris at the base of your eyelashes, Demodex blepharitis could be an underlying driver worth treating.
Why Some People Get Styes Repeatedly
A single stye is usually just bad luck combined with a moment of poor hygiene. Recurrent styes point to something systemic that keeps tipping the odds in the bacteria’s favor.
Diabetes is one of the clearest associations. Elevated blood sugar impairs immune function and changes the composition of skin oils, making gland blockages and infections more likely. Medical reviews of diabetic eye complications consistently list recurrent styes and chalazia among the common ocular manifestations alongside better-known problems like diabetic retinopathy and cataracts.5Medical Journal of Eastern Nepal. Ocular Manifestations of Diabetes Mellitus: It’s Remedies and Prevention If you keep getting styes and have not had your blood sugar checked recently, it is worth mentioning to your doctor.
Chronic blepharitis, whether caused by Demodex mites, seborrheic dermatitis, or meibomian gland dysfunction, keeps the eyelid margin inflamed and its glands partially obstructed as a baseline. In that environment, a full-blown stye requires only a small additional push. Rosacea, which often coexists with blepharitis, follows a similar pattern. Hormonal changes during puberty or pregnancy can also alter oil gland output and make blockages more frequent.
Stress and sleep deprivation are harder to pin down with specific studies, but both suppress immune surveillance in the skin and mucous membranes. Many people notice that styes tend to appear during stressful periods, and while this is partly anecdotal, the immunological plausibility is real.
Stye Versus Chalazion
A bump on your eyelid is not always a stye. Chalazia are the most common lookalike, and the distinction matters because the treatment approach differs. A chalazion is a localized cyst that forms when a meibomian or Zeis gland becomes blocked and the trapped secretions provoke a chronic inflammatory reaction rather than an acute bacterial infection. A stye (hordeolum) is an acute, pus-filled infection often associated with an eyelash follicle or one of the superficial glands.6PubMed. The lowly chalazion
In practice, styes are typically painful, red, and tender to the touch, and they often develop a visible whitehead at the eyelid margin. Chalazia tend to be firmer, less painful, and located slightly away from the lash line. A stye that does not drain and resolve on its own can evolve into a chalazion as the acute infection subsides but the blocked gland remains inflamed. This is one reason ophthalmologists encourage early warm-compress treatment: resolving the blockage while it is still acute can prevent the lump from becoming a stubborn chronic cyst that takes weeks or months to go away on its own.
Why Warm Compresses Work
The standard first-line treatment for a stye is a warm compress applied to the closed eyelid for about ten to fifteen minutes, several times a day. This is not just a comfort measure. The oil produced by meibomian glands has a melting point that is already near body temperature. When glands are obstructed or inflamed, the melting point of that oil actually rises, making the blockage harder to clear under normal conditions. Applying gentle heat reduces the viscosity of the trapped oil so it can flow through the gland ducts again.7Ophthalmic Research. Mechanisms and Safety of Therapeutic Strategies in Meibomian Gland Dysfunction: A Narrative Review
A clean washcloth soaked in warm (not scalding) water works well. Reheating or re-wetting it every few minutes keeps the temperature effective. Microwavable eye masks designed for this purpose hold heat more evenly and for longer, which some people find more practical. The key is consistency over several days. A single session rarely resolves a stye, but repeated treatments help the gland drain and reduce the bacterial load inside it.
Resist the urge to squeeze or pop a stye. Squeezing can push infected material deeper into the eyelid tissue or rupture it inward, potentially spreading infection to surrounding structures. Most styes rupture and drain on their own once the warm compresses soften the blockage enough.
When Antibiotics or a Doctor Visit Are Needed
Most styes resolve within a week or two with warm compresses and basic hygiene. You should see a doctor if the stye does not improve after about a week of home treatment, if the swelling spreads beyond the eyelid to the cheek or surrounding skin, if your vision becomes affected, or if you develop a fever. These signs can indicate that the infection is moving beyond the superficial gland and into the deeper tissue around the eye. Spreading eyelid infections can progress to preseptal cellulitis, a more serious condition that requires oral antibiotics.
For uncomplicated styes that are slow to resolve, a doctor may prescribe a topical antibiotic ointment to apply along the eyelid margin. For internal styes that form a large pocket of pus, a minor in-office procedure to lance and drain the bump can speed recovery dramatically. Recurrent styes sometimes prompt a course of low-dose oral antibiotics or an investigation into underlying causes like uncontrolled diabetes or chronic blepharitis.
Practical Prevention
Because styes are driven by bacteria that already live on your skin, prevention is less about avoiding exposure and more about keeping the eyelid margin clean and its glands flowing freely.
- Hand hygiene: Wash your hands before touching your face or eyes. This single habit probably prevents more styes than anything else.
- Makeup discipline: Replace mascara and liquid eyeliner every three months. Never share eye cosmetics. Avoid applying eyeliner to the inner waterline if you are prone to styes, since particles from that area migrate directly into meibomian gland openings with every blink.
- Eyelid cleaning: If you have a history of blepharitis or recurrent styes, a nightly eyelid scrub with diluted baby shampoo or a commercially available lid wipe can remove accumulated debris and bacteria from the lash line.
- Contact lens care: Clean and replace lens cases on schedule. Use fresh solution every day rather than topping off old solution. Wash your hands before handling lenses, and avoid sleeping in lenses that are not approved for overnight wear.
- Remove makeup before bed: Sleeping in eye makeup gives cosmetic residue hours of uninterrupted contact with your eyelid glands.
There is also some evidence that dietary changes can support healthier meibomian gland function from the inside. A study that tracked patients taking omega-3 fatty acid supplements over twelve months found improvements in tear film stability and meibomian gland secretion quality over that period.8PubMed Central. The role of omega-3 dietary supplementation in blepharitis and meibomian gland dysfunction (an AOS thesis) The idea is that omega-3s shift the composition of the oils your glands produce, making them less prone to thickening and blocking the duct. This is more relevant for people dealing with chronic meibomian gland dysfunction and recurrent blockages than for someone who has had one stye, but it is a low-risk intervention if recurrent styes are a pattern for you. Fatty fish like salmon and mackerel are the richest dietary sources, and fish oil or flaxseed oil supplements are widely available alternatives.
Styes in Children
Children get styes frequently, partly because they touch their eyes more often and partly because their developing immune systems are still learning to manage skin bacteria efficiently. The good news is that childhood styes are almost always self-limiting and respond well to warm compresses. Convincing a five-year-old to sit still with a warm cloth on their eye for ten minutes is the harder challenge. Microwavable stuffed-animal-shaped eye masks exist for this exact reason, and even a few minutes of warmth applied a couple of times a day can help.
Parents sometimes worry that a stye means something more serious is going on. In the vast majority of cases, it does not. A child who gets a stye once or twice a year is within normal range. If styes become a monthly occurrence or always appear in the same spot, a pediatric ophthalmologist can check for underlying eyelid margin disease or a retained chalazion that keeps re-infecting.
Can You Spread a Stye to Someone Else?
Technically, the bacteria inside a stye are contagious. If pus from a ruptured stye gets on a towel and someone else presses that towel against their own eyelid, a transfer is possible. In practice, person-to-person transmission of styes is uncommon because the bacteria involved are species that most people already carry on their skin. The risk is less about catching a new germ and more about inoculating a vulnerable spot with a heavier-than-usual bacterial dose. Still, basic precautions make sense: do not share washcloths, towels, or pillowcases with someone who has an active stye, and avoid sharing eye makeup at all times regardless.
You also cannot give yourself a stye in the other eye through casual contact, though repeatedly rubbing both eyes with unwashed hands while one eyelid is infected is not ideal. The drainage from a stye does contain live bacteria, so washing your hands after touching the affected eye is a reasonable habit until the bump resolves.