How Do You Get a Stye? Causes and Risk Factors

Styes form when bacteria infect a blocked oil gland or hair follicle along the eyelid. The process is straightforward: one of the tiny glands lining your eyelid gets clogged, bacteria (usually staph) multiply inside, and within a day or two you have a red, painful bump. Understanding exactly how this happens reveals why some people get styes repeatedly and what makes certain habits risky.

What Happens Inside Your Eyelid

Your eyelids contain dozens of small glands that serve different purposes. Oil glands along the lash line (called glands of Zeis) and sweat glands (Moll glands) sit near each eyelash follicle. Deeper inside the eyelid, a row of larger oil glands called meibomian glands produce the oily layer of your tear film that keeps your eyes from drying out.

When any of these glands gets blocked, oil and debris build up inside, creating a warm, sealed environment where bacteria thrive. Most styes are external, forming at the base of an eyelash when a follicle and its neighboring oil or sweat gland become obstructed and infected. Internal styes are less common and develop when a meibomian gland deeper in the lid gets infected. Internal styes tend to be more painful because they press against the eyeball.

The blockage itself can happen for simple reasons: dead skin cells, dried oil, or makeup residue accumulates at the gland opening. Once bacteria colonize the trapped material, your immune system responds with inflammation, producing the classic swelling, redness, and tenderness.

Chronic Eyelid Conditions That Set the Stage

Some people get styes once and never again. Others deal with them repeatedly, and that pattern almost always traces back to an underlying eyelid condition. Meibomian gland dysfunction is the most common culprit. In this condition, the oil glands in your eyelids either produce poor-quality oil or stop secreting enough of it. The glands fill up, oil can’t escape, and the resulting blockages create a cycle of chronic styes.

Blepharitis, a persistent low-grade inflammation of the eyelid margins, also raises your risk significantly. The inflamed lid environment promotes bacterial overgrowth and gland obstruction at the same time. Ocular rosacea, a form of rosacea that affects the eyes, is another known driver. Recurrent styes are listed among its hallmark symptoms, likely because rosacea causes blocked eyelid glands and chronic inflammation.

Everyday Habits That Cause Styes

Beyond underlying conditions, specific daily behaviors introduce bacteria to your eyelids or promote gland blockage.

Touching your eyes with unwashed hands is the single most common trigger. Your fingers carry staph bacteria, and even brief contact with your lash line can deposit enough to start an infection in a vulnerable gland. This is especially true if you rub your eyes frequently.

Sleeping in eye makeup is a major risk factor. Mascara, eyeliner, and eyeshadow can physically block gland openings overnight, giving bacteria hours to multiply in the trapped residue. Even if you usually remove your makeup, skipping it on a tired night is sometimes all it takes.

Old or contaminated cosmetics are a less obvious but well-documented problem. Eyelashes naturally carry bacteria, so every time a mascara wand touches your lashes, it transfers those organisms back into the tube. Over weeks and months, bacterial counts inside the container climb. Experts recommend replacing eye cosmetics every three to four months. Sharing eye makeup is also risky, since another person’s bacteria may be harmful to you. Storing cosmetics above 85°F (like in a hot car) weakens the preservatives that keep bacterial growth in check.

Wearing contact lenses improperly contributes as well. Handling lenses with dirty hands, using expired solution, or sleeping in contacts all increase the bacterial load around your eyelids.

How Stress and Sleep Factor In

No study has directly proven that stress causes styes, but many ophthalmologists report seeing the connection in their patients. The likely explanation is indirect. Stress weakens your immune system, making it harder for your body to fight off the low levels of bacteria that are always present on your eyelids. Research has also found that stress hormones can be converted into compounds that actually help attract bacteria to susceptible areas of the body.

Sleep deprivation works through a similar pathway. Poor sleep reduces the activity of T cells, a type of immune cell critical for fighting infection. There’s also a practical side to it: when you’re exhausted, you’re more likely to skip eye hygiene routines, fall asleep with makeup on, or rub your eyes without thinking.

Who Gets Styes Most Often

Certain groups face a higher baseline risk. People with rosacea or seborrheic dermatitis produce more inflammatory compounds around the face and eyelids, keeping those glands in a perpetually vulnerable state. Anyone with dandruff carries a higher-than-average bacterial and fungal load near the eyes. People who wear heavy eye makeup daily or use false eyelashes with adhesive glue introduce more potential gland-blocking material.

Having had one stye also makes future ones more likely, particularly if the underlying cause (gland dysfunction, poor hygiene habits, or a chronic skin condition) hasn’t been addressed.

What a Stye Looks Like as It Develops

Styes typically follow a predictable arc. The first sign is usually a tender, slightly itchy spot on the eyelid. Within 24 hours, a visible red bump forms, often with a small white or yellow head at the center where pus is collecting. The eyelid may swell noticeably, and tearing is common. Most styes come to a head and drain on their own within a week to ten days.

Warm compresses speed this process. Holding a clean, warm washcloth against the affected eye for 10 to 15 minutes, several times a day, softens the blocked material and encourages the stye to open and drain naturally. Gently cleaning the eyelid with diluted baby shampoo or a mild soap helps keep bacteria from spreading. Avoid squeezing or popping a stye, since that can push the infection deeper into the lid.

Preventing Styes Before They Start

If you’ve had a stye before, the habits that prevent recurrence are straightforward but require consistency. Wash your hands before touching your face or eyes, every time. Remove all eye makeup before bed, using a gentle cleanser that dissolves oil-based products fully. Replace mascara and liquid eyeliner every three to four months, and never share these products.

If you have blepharitis or meibomian gland dysfunction, a daily eyelid hygiene routine makes a significant difference. This means warm compresses for a few minutes each morning followed by gentle lid massage to express oil from the glands, then cleaning the lid margins with a dedicated eyelid scrub or diluted baby shampoo. Wash your pillowcases frequently, since bacteria accumulate on fabric that contacts your face nightly.

For contact lens wearers, the basics matter: clean hands before insertion and removal, fresh solution every time, and replacing lenses on schedule. Prioritizing consistent sleep and managing stress won’t guarantee you’ll never get a stye, but both support the immune function that keeps eyelid bacteria in check.