How Do You Get a Stye? Causes and Risk Factors

A stye forms when bacteria, almost always Staphylococcus aureus, infect one of the small glands or hair follicles along your eyelid margin. The result is a painful, red, swollen bump that looks a lot like a pimple and usually resolves on its own within a week or two. But the infection itself is only the final step in a chain of events, and the real question for most people is why it happened in the first place. The causes range from blocked oil glands and microscopic mites to skin conditions and simple habits like rubbing your eyes.

The Bacterium Behind Almost Every Stye

Staphylococcus aureus is the culprit in the vast majority of styes. This bacterium lives harmlessly on the skin and eyelids of most people, but when it finds a way into a blocked or damaged gland, it triggers the acute infection we recognize as a stye. S. aureus is capable of infecting virtually every structure of the eye, from the tear duct and eyelid to the conjunctiva and cornea.1Europe PMC. The Pathogenesis of Staphylococcus aureus Eye Infections So the germ is almost always already present. What matters is whether something opens the door for it.

Other bacteria occasionally cause styes as well, including Staphylococcus epidermidis and certain streptococcal species, but these are far less common. In practical terms, asking “how do you get a stye?” is really asking “what blocks the gland or disrupts the eyelid environment enough for staph to take hold?”

External Versus Internal Styes

Your eyelids contain two distinct types of structures that can become infected, and which one is involved determines whether you have an external or internal stye. External styes (also called external hordeola) develop in the glands of Zeis or Moll, which sit right at the base of your eyelashes. These look and feel like a small pimple at the lash line. Internal styes develop deeper in the eyelid, inside the meibomian glands, which are larger oil-producing glands embedded in the tarsal plate of the lid. Internal styes tend to be more painful and may point inward toward the eyeball rather than outward on the skin.

The distinction matters because internal styes are more closely tied to chronic conditions like meibomian gland dysfunction, while external styes are more often linked to lash-line hygiene issues such as old makeup or debris. Both types are bacterial infections at their core, but the underlying risk factors can differ.

Meibomian Gland Dysfunction

The meibomian glands run vertically through both your upper and lower eyelids, and their job is to secrete an oily layer (called meibum) that coats your tear film and prevents it from evaporating too quickly. When these glands become obstructed or stop working properly, the condition is known as meibomian gland dysfunction, or MGD. Once gland disruption occurs, both the quality and quantity of meibum change, and the downstream effects on the eyelid and ocular surface can be significant.2Europe PMC / Ophthalmology. Meibomian Gland Disease: The Role of Gland Dysfunction in Dry Eye Disease

Thick, waxy meibum plugs the gland opening. Bacteria that would normally be flushed away by healthy oil flow now have a warm, stagnant environment to multiply in. This is one of the most common pathways to a stye, and it is also the reason styes tend to recur in people with MGD. If the underlying gland problem is not addressed, clearing one stye just sets the stage for the next.

MGD is extremely common, particularly in older adults and people who spend long hours staring at screens (because you blink less when concentrating, and blinking is what expresses meibum from the glands). It also frequently accompanies dry eye disease, so if you have chronic dry eyes, your risk of styes is higher than average.

Blepharitis and the Inflamed Eyelid

Blepharitis is a chronic inflammation of the eyelid margins, and it overlaps heavily with MGD. In anterior blepharitis, the inflammation centers on the lash line and is often driven by bacterial overgrowth or seborrheic dermatitis. In posterior blepharitis, the meibomian glands themselves are inflamed. Either form creates an eyelid environment where styes are far more likely.

A large international study across eleven countries found that eyelid disorders were diagnosed in about 78% of ophthalmology patients and were statistically associated with conditions including atopic dermatitis, seborrheic dermatitis, dry eye, diabetes, allergy, and MGD.3PubMed Central. Eyelid Disorders in Ophthalmology Practice: Results from a Large International Epidemiological Study in Eleven Countries That broad web of associations means that people with any of these conditions are walking around with eyelid margins that are chronically primed for trouble, including styes.

If you have dandruff-like flaking at the base of your lashes, persistent redness along your lid margins, or a gritty sensation in your eyes, you likely have some degree of blepharitis. Treating it with regular eyelid hygiene is one of the most effective ways to prevent styes from forming.

Demodex Mites and Recurrent Styes

This is the part that makes people squirm: tiny mites called Demodex folliculorum and Demodex brevis live in most adult eyelash follicles and meibomian glands. In low numbers, they are harmless. But when their population grows out of control, they cause a form of blepharitis called demodicosis, and the consequences for the eyelid are considerable.

Demodex infestation can cause chronic blepharitis, conjunctival inflammation, and meibomian gland dysfunction.4Scientific Reports. Clinical characteristics of Demodex-associated recurrent hordeola: an observational, comparative study When the mites die and decompose inside the glands, the chitin in their exoskeletons may provoke a local inflammatory reaction that has been hypothesized to lead directly to stye or chalazion formation.5PubMed Central. Demodex Blepharitis: A Comprehensive Review of the Disease, Current Management, and Emerging Therapies

Demodex infestation becomes more common with age, and it is especially prevalent in people over 60. If you find yourself getting styes repeatedly and standard treatments are not helping, your doctor may examine your lashes under a microscope for signs of mites. A cylindrical dandruff at the base of the lashes is one of the hallmark signs. Targeted treatments, including tea tree oil-based lid scrubs and newer prescription options, can reduce mite counts and break the cycle of recurrent styes.

Rosacea and Its Effect on the Eyes

Many people think of rosacea as a skin condition that causes facial flushing and redness, but it frequently involves the eyes as well. Ocular rosacea can be the primary or even the only manifestation of the disease, and styes are among its most recognizable complications. Patients with ocular rosacea commonly present with chronic red eye, blepharitis, and frequent styes as early signs of ongoing inflammation.6PubMed Central. Ocular Rosacea: An Updated Review

The connection runs through the meibomian glands once again. Rosacea drives chronic inflammation of the eyelid margin and meibomian gland dysfunction, which in turn leads to recurrent styes and chalazia.7Arquivos Brasileiros de Oftalmologia. Ocular rosacea: a review If you get styes often and also notice facial redness, visible blood vessels on your cheeks or nose, or a tendency to flush easily, it is worth mentioning both symptoms to your doctor. Treating the rosacea can reduce the frequency of styes.

Other skin conditions tied to eyelid problems include seborrheic dermatitis and atopic dermatitis (eczema). Both can inflame the eyelid margins and alter the local bacterial environment in ways that make styes more likely.3PubMed Central. Eyelid Disorders in Ophthalmology Practice: Results from a Large International Epidemiological Study in Eleven Countries

Everyday Habits That Raise Your Risk

Beyond the medical conditions, some of the most common causes of styes come down to routine behavior. These are the factors you have the most control over:

  • Touching your eyes: Your hands carry bacteria, including S. aureus, throughout the day. Rubbing your eyes or touching your lash line with unwashed hands is probably the single most common way bacteria get introduced to a vulnerable gland.
  • Old or shared makeup: Mascara, eyeliner, and eye shadow can harbor bacteria after a few months of use. Sharing eye makeup with someone else transfers their eyelid bacteria to your lash line. The general recommendation is to replace eye makeup every three to six months and never share it.
  • Sleeping in makeup: Leaving eye makeup on overnight clogs the gland openings along your lash line, creating exactly the kind of blocked, bacteria-friendly environment that leads to styes.
  • Contact lens hygiene: Handling lenses with dirty hands, sleeping in contacts not designed for overnight wear, or reusing old contact lens solution all increase your exposure risk. Contact lens use has been shown to affect the composition and diversity of the ocular surface microbiome.8Europe PMC. The Ocular Surface Microbiome in Homeostasis and Dysbiosis

None of these habits guarantee a stye, but they all tilt the odds. Someone with healthy eyelid glands and a robust tear film can probably get away with occasionally rubbing their eyes. Someone who already has mild blepharitis or MGD is playing with much thinner margins.

Does Diabetes Cause Styes?

This is a widespread belief, and the logic seems reasonable: diabetes impairs immune function and increases susceptibility to infections generally, so it should increase the risk of styes. But the data are more nuanced than the conventional wisdom suggests.

A cohort study examining the relationship between diabetes, glycemic control, and various eye infections found no association between diabetes and styes or chalazia in the overall population.9PubMed Central. The association between diabetes, level of glycaemic control and eye infection: Cohort database study That result surprised many clinicians, because diabetes does raise the risk of other eye infections. The large international eyelid study mentioned earlier did find a statistical association between diabetes and eyelid disorders broadly, but that category includes many conditions beyond styes.3PubMed Central. Eyelid Disorders in Ophthalmology Practice: Results from a Large International Epidemiological Study in Eleven Countries

The honest takeaway is that diabetes can contribute to eyelid inflammation and dry eye, both of which make styes somewhat more likely, but it does not appear to be a direct and independent cause the way many health websites claim. If you have diabetes and get frequent styes, the styes are probably driven more by MGD or blepharitis than by blood sugar alone.

Stye Versus Chalazion

People often confuse styes with chalazia (the plural of chalazion), and the distinction is worth understanding because the two conditions have different causes, timelines, and treatments. A stye is an acute bacterial infection. It hurts, it is red, and it comes on within a day or two. A chalazion is a chronic, sterile (non-infectious) granuloma that forms when a meibomian gland becomes blocked and the trapped oil provokes an inflammatory reaction but no active infection. Chalazia are usually painless, harder to the touch, and can linger for weeks or months.

The reason confusion is so common is that a stye can evolve into a chalazion. When the acute infection resolves but the gland remains blocked, the leftover inflammatory tissue may harden into a chalazion. And because both originate in the meibomian glands, both share the same upstream risk factors: MGD, blepharitis, Demodex, and rosacea. The practical difference is that warm compresses and time usually resolve a stye, while a persistent chalazion may eventually need a steroid injection or minor in-office drainage.

The Ocular Surface Microbiome

Your eyelids and the surface of your eye host a community of microorganisms that, under normal conditions, actually help protect you. These commensal microbes interact with the local immune system to promote tolerance of the normal flora while helping to fend off invading pathogens.8Europe PMC. The Ocular Surface Microbiome in Homeostasis and Dysbiosis When this balance is disrupted, whether by antibiotics, contact lens wear, aging, or disease, the door opens for pathogenic bacteria like S. aureus to gain a foothold.

This microbiome perspective helps explain why styes are not simply a hygiene problem. Two people can have identical hand-washing habits and makeup routines, yet one gets styes repeatedly while the other never does. The difference often lies in the health and composition of their eyelid microbiome and the integrity of their meibomian glands. It also explains why broad-spectrum antibiotic eye drops, while they kill the bacteria causing an active stye, can paradoxically set you up for the next one by disrupting the protective microbial community.

Why Some People Get Styes Over and Over

Occasional styes are common and not a cause for concern. Recurrent styes, defined loosely as getting several per year, usually signal an underlying condition that is not being addressed. The most common culprits in recurrent cases are chronic blepharitis, untreated MGD, Demodex overgrowth, and ocular rosacea. Each of these conditions creates a persistently abnormal eyelid environment where glands are partially blocked, inflammation is simmering, and bacteria have an easy path into the glands.

Stress and sleep deprivation are frequently cited as stye triggers in popular health advice. The evidence for a direct link is thin, but the indirect connection is plausible: when you are tired and stressed, you are more likely to rub your eyes, less likely to remove makeup carefully, and your immune defenses may dip just enough to let an opportunistic infection take hold.

Children get styes more often than adults, likely because they touch their faces and eyes more frequently and are less consistent about hand hygiene. In kids, recurrent styes less commonly point to an underlying gland disorder and more commonly reflect behavior, though Demodex and blepharitis should still be considered if styes keep coming back.

Practical Prevention

Most of the prevention advice for styes flows directly from understanding the causes. If the infection starts with a blocked gland colonized by bacteria, the goal is to keep glands flowing and bacteria at bay. Eyelid hygiene, meaning routine cleansing and gentle massage of the eyelid margins, is well accepted as the foundation of prevention for many eyelid disorders.10Dove Press / Clin Ophthalmol (PubMed Central). How to promote and preserve eyelid health In practice, that looks like:

  • Warm compresses: Holding a clean, warm washcloth over your closed eyes for five to ten minutes softens hardened meibum and encourages the glands to drain. Doing this daily is especially useful if you have MGD or blepharitis.
  • Lid scrubs: Gently cleaning the lash line with a dilute baby shampoo solution or a commercial lid-cleaning wipe removes debris, bacterial biofilm, and Demodex mites.
  • Makeup discipline: Remove all eye makeup before bed. Replace mascara and eyeliner regularly. Do not share eye products.
  • Hand hygiene: Wash your hands before touching your eyes or handling contact lenses. This alone eliminates the most common route of bacterial introduction.

For people with identified conditions like rosacea, Demodex blepharitis, or severe MGD, eyelid hygiene alone may not be enough. Treatment of the underlying condition, whether with anti-inflammatory medications, in-office gland expression procedures, or targeted anti-parasitic therapy, is often necessary to break the cycle of recurrent styes. If you are getting more than two or three styes a year, a visit to an ophthalmologist or optometrist for a thorough eyelid evaluation is a reasonable next step rather than continuing to treat each stye in isolation.