Styes are caused by bacterial infection of the tiny oil glands or hair follicles along your eyelid margin. The bacterium responsible is almost always Staphylococcus aureus, a common skin bacterium that normally lives on your face without causing problems. A stye forms when one of your eyelid’s glands gets blocked, trapping oil inside and giving bacteria a warm, stagnant environment to multiply. But the blockage itself can be triggered by a surprisingly wide range of factors, from old mascara to poor sleep to chronic skin conditions.
How Blocked Glands Lead to Infection
Your eyelids contain dozens of small glands that produce oils to keep your eyes lubricated and your tears from evaporating too quickly. The upper eyelid alone has 40 to 50 of these oil glands (called meibomian glands), while the lower lid has 20 to 25. Additional smaller glands sit right at the base of your eyelashes. When any of these glands gets clogged, the oil thickens and backs up. Bacteria that are already present on your skin colonize the trapped secretions, triggering the painful, red, swollen bump you recognize as a stye.
This is why styes tend to appear right at the eyelid edge. External styes, the more common type, form around an eyelash follicle and often develop a visible yellowish head near the lash line. Internal styes develop deeper in the lid, inside the larger oil glands embedded in the eyelid’s cartilage. These tend to be more painful because the swelling presses against the eye itself, and they drain inward toward the inner surface of the lid rather than outward.
Blepharitis: The Most Common Underlying Cause
Most styes don’t appear out of nowhere. The single biggest predisposing factor is blepharitis, a chronic low-grade inflammation of the eyelid margins. If you’ve ever noticed crusty debris along your lash line in the morning, redness at the lid edges, or a gritty sensation in your eyes, you likely have some degree of blepharitis. This ongoing inflammation thickens the oil your glands produce and narrows their openings, making blockages far more likely.
Blepharitis is extremely common, and many people have it without realizing it. It tends to wax and wane, which is why styes can seem to come and go in clusters. If you get styes repeatedly, unmanaged blepharitis is the most likely explanation.
Skin Conditions That Raise Your Risk
Ocular rosacea is a well-established cause of recurrent styes. Rosacea doesn’t just affect the cheeks and nose. It frequently involves the eyes, causing redness, dryness, and dysfunction of the eyelid oil glands. Healthcare providers sometimes describe ocular rosacea as meibomian gland dysfunction because the two overlap so heavily. If you have facial rosacea and keep getting styes, the connection is likely direct.
Seborrheic dermatitis, the same condition that causes dandruff on the scalp, can also affect the eyelids and contribute to chronic gland blockage. Any skin condition that increases flaking, oil production, or bacterial load around the eyes raises the odds of developing a stye.
Diabetes and Immune Function
People with poorly controlled diabetes get styes more often, and their styes tend to be more severe and slower to heal. The reasons are layered. High blood sugar impairs the immune cells that would normally clear bacteria quickly. It alters the composition of eyelid oils, making gland blockages more likely. It reduces blood flow to small vessels in the eyelid, which means fewer immune cells reach the infection site and any treatment penetrates the tissue less effectively.
Diabetes also damages the nerve endings that regulate gland secretions, leading to abnormal buildup of oils. The result is a cycle: glands clog more easily, infections take hold faster, and the body is slower to resolve them. People with diabetes are also more likely to develop multiple styes at once or to see a simple stye progress into a deeper, more widespread infection.
Any condition or medication that suppresses your immune system can have a similar effect. If your body is less equipped to keep skin bacteria in check, those bacteria are more likely to cause problems when a gland gets blocked.
Stress and Sleep Deprivation
Ophthalmologists frequently note that styes cluster during periods of high stress or poor sleep, and the biological rationale is solid even if large clinical trials haven’t been done. Stress hormones suppress the activity of T cells, the immune cells responsible for fighting off bacterial infections. Sleep deprivation compounds this by further reducing immune surveillance. One 2017 study found that stress hormones get converted into a compound that may actually attract bacteria to vulnerable areas of the body.
There’s also a behavioral link. When you’re tired or stressed, you’re more likely to rub your eyes, skip your nighttime face-washing routine, or fall asleep with makeup on. All of these increase the chance of transferring bacteria to your eyelid glands.
Makeup, Contact Lenses, and Hygiene Habits
Old eye makeup is a surprisingly potent source of eyelid infections. Liquid products like mascara and liquid eyeliner are especially prone to harboring bacteria over time because the moist environment inside the tube is ideal for bacterial growth. The general recommendation is to replace liquid eye makeup every three months, and to throw it out immediately if you develop any eye infection to avoid reinfecting yourself or spreading bacteria from one eye to the other.
Sharing makeup brushes, applicators, or eye makeup with others transfers bacteria between people. Adding water or saliva to dried-out products introduces even more bacteria. These might sound like minor habits, but they directly deposit bacteria onto the exact glands where styes form.
Contact lens wearers face additional risk if they handle their lenses without washing their hands first or wear lenses longer than recommended. Touching your eyes repeatedly throughout the day, whether to adjust contacts or just out of habit, gives bacteria more opportunities to reach the eyelid glands.
Stye vs. Chalazion
Not every bump on your eyelid is a stye. A chalazion looks similar but forms differently. A stye is an active infection: red, tender, warm, and often with a visible pus-filled head. A chalazion is a blocked oil gland without active infection. It’s typically firm, painless, and presents more as a cosmetic lump than a painful one. Chalazia develop when a blocked gland triggers a chronic inflammatory reaction rather than an acute bacterial infection.
The distinction matters because chalazia don’t respond to the same approaches. A stye that doesn’t resolve can sometimes evolve into a chalazion once the infection clears but the gland remains blocked and inflamed. If you have a painless, firm bump that’s been sitting on your eyelid for weeks without changing, it’s more likely a chalazion than a stye.
When a Stye Becomes Something More Serious
Most styes resolve on their own within a week or two with warm compresses. Rarely, the infection spreads beyond the gland into the surrounding eyelid tissue, a condition called preseptal cellulitis. Warning signs include swelling that spreads across the entire eyelid or beyond, fever, and increasing pain. In children especially, preseptal cellulitis can progress to orbital cellulitis, a deeper infection that causes the eye to bulge, pain with eye movement, and vision changes. A fever combined with significant swelling around the eye socket warrants immediate medical attention, particularly in kids.
People with diabetes or compromised immune systems are at higher risk for this kind of progression, which is another reason recurrent styes in these groups deserve closer follow-up rather than repeated home treatment alone.

