What Causes a Stye in Your Eye: Key Risk Factors

A stye forms when bacteria infect one of the tiny oil glands along your eyelid margin. In 90% to 95% of cases, the culprit is Staphylococcus aureus, a common bacterium that already lives on your skin and can slip into a gland when conditions are right. The remaining cases are typically caused by a related species, Staphylococcus epidermidis. Understanding what creates those “right conditions” is the key to knowing why styes happen and how to prevent them.

How a Stye Actually Forms

Your eyelids contain dozens of small oil-producing glands. Their job is to release a thin layer of oil every time you blink, which keeps your tears from evaporating too quickly. When one of these glands gets clogged, bacteria that are normally harmless on your skin surface can become trapped inside. The gland swells, fills with pus, and produces the red, painful bump you recognize as a stye.

There are two types. An external stye develops in a gland near the base of an eyelash, right at the outer edge of the lid. An internal stye forms deeper, in one of the larger oil glands embedded in the eyelid itself. Internal styes tend to be more painful because they press against the eyeball, but both types start the same way: a blocked gland plus bacteria.

Everyday Habits That Raise Your Risk

The most common triggers are things you do (or don’t do) every day. Touching or rubbing your eyes with unwashed hands is the simplest way to introduce extra bacteria to your eyelid margin. If you wear contact lenses and skip proper cleaning routines, you’re creating another pathway for bacteria to reach those glands.

Eye makeup is a particularly underappreciated risk factor. Mascara, eyeliner, and eyeshadow can physically block the openings of oil glands along the lash line. When makeup isn’t fully removed at night, those blocked glands sit in contact with bacteria for hours. Old cosmetics compound the problem. There’s little regulation around expiration dates for eye makeup, but bacterial contamination in used mascara tubes and eyeliner pencils is well documented. Ophthalmologists regularly see infections traced back to expired products.

Sharing towels, washcloths, or makeup with others can also transfer stye-causing bacteria from person to person. While a stye itself isn’t contagious in the traditional sense, the bacteria behind it absolutely can spread through shared items.

Chronic Eyelid Conditions

If you get styes repeatedly, an underlying eyelid condition is often the reason. Blepharitis, a chronic inflammation of the eyelid margins, is one of the most common. It creates a persistently irritated environment along the lash line where oil glands are more likely to clog and bacteria are more likely to thrive. People with blepharitis may notice flaky, crusty buildup at the base of their lashes, and styes can become a recurring frustration until the underlying inflammation is managed.

Rosacea and the Oil Gland Connection

Ocular rosacea, a form of rosacea that affects the eyes, is a significant but often overlooked cause of repeated styes. The condition triggers chronic inflammation of the eyelid margin and disrupts the normal function of the oil glands embedded in the lid. These glands become obstructed, and the resulting blockages can lead to styes or a related bump called a chalazion.

The mechanism involves an overactive immune response. In people with ocular rosacea, the body produces elevated levels of inflammatory signaling molecules that damage tissue around the oil glands. Tiny mites called Demodex, which naturally live on most people’s eyelashes in small numbers, can proliferate in rosacea and worsen the inflammatory cycle. Bacteria living inside these mites may further provoke the immune system, creating a feedback loop of inflammation and gland dysfunction. Hormonal factors, particularly androgen levels, also influence how well these oil glands function, which partly explains why rosacea-related eye problems can fluctuate over time.

Stress, Sleep, and Your Immune System

There’s no clinical trial proving stress directly causes a stye, but the indirect link is strong. Stress weakens your immune system, and a weakened immune system is less effective at keeping normally harmless skin bacteria in check. One proposed mechanism: stress hormones get converted into a compound called DHMA, which may actually help attract bacteria to vulnerable areas of the body.

Sleep deprivation works through a similar pathway. Poor sleep reduces the activity of T cells, the immune cells responsible for fighting off infections. When your body’s infection-fighting capacity drops, a minor gland blockage that your immune system would normally handle can escalate into a full stye. If you notice styes popping up during high-stress periods or after stretches of poor sleep, the connection is likely real for you, even if it’s hard to prove in a lab.

Other Health Conditions That Play a Role

Diabetes increases susceptibility to bacterial infections throughout the body, and the eyelids are no exception. High blood sugar impairs the immune response, making it harder for your body to clear bacteria from a clogged gland before an infection takes hold. People with poorly controlled diabetes may notice more frequent styes as one of many minor infection-related issues.

Any condition or medication that suppresses the immune system can have a similar effect. This includes autoimmune disorders treated with immunosuppressive drugs, as well as periods of general illness when your body’s defenses are stretched thin.

How to Reduce Your Risk

Since styes start with bacteria entering a blocked gland, prevention targets both sides of that equation. Keeping your hands away from your eyes, or at least washing them thoroughly before touching your face, limits bacterial transfer. If you wear contacts, clean them exactly as directed and replace them on schedule.

For makeup wearers, thorough removal every night is non-negotiable. Use a gentle cleanser or micellar water designed for the eye area, and make sure no residue remains along the lash line. Replace mascara every three months, even if the tube isn’t empty. Eyeliner and eyeshadow last a bit longer, but any product that touches your lash line should be discarded if it changes smell or texture. Never share eye cosmetics.

If you have blepharitis or ocular rosacea, a daily lid hygiene routine can dramatically reduce stye frequency. This typically involves warm compresses held against closed eyelids for five to ten minutes, followed by gentle cleaning of the lash line. The warmth loosens hardened oil in the glands and helps them drain normally. Over time, this simple habit keeps the glands clear and reduces the bacterial buildup that leads to infection.

If a stye does develop, avoid squeezing or popping it. Squeezing can push the infection deeper into the eyelid or spread bacteria to neighboring glands, potentially turning one stye into several. Warm compresses applied several times a day are the standard first-line approach, and most styes resolve on their own within a week or two.