Styes form when bacteria, almost always Staphylococcus aureus, infect an oil gland or hair follicle along your eyelid. The infection creates a small, painful abscess that looks like a pimple near your lash line. Understanding exactly how that bacteria gets there, and what makes some people more prone than others, can help you avoid repeat infections.
How a Stye Forms
Your eyelids contain dozens of tiny oil glands that produce a thin film to keep your eyes lubricated. These glands drain through small openings along your lash line. When debris, dead skin, dried oil, or makeup residue blocks one of those openings, the oil backs up inside the gland. Staph bacteria, which naturally live on your skin and inside your nose, seize the opportunity to multiply in that trapped, oily environment. The result is a localized infection: a red, swollen bump that fills with pus.
There are two types. External styes are the most common and develop at the base of an eyelash follicle, right along the lid margin. Internal styes form deeper in the eyelid, inside glands called meibomian glands. Internal styes tend to be more painful and may not be visible on the surface, but both types start the same way: a blocked gland plus bacteria.
Common Ways Bacteria Reach Your Eye
The single most common route is your own hands. Staph bacteria live in your nose, and rubbing your nose and then touching your eye is enough to transfer them. Any time you touch your eyelids without washing your hands first, you’re introducing bacteria to glands that could already be partially blocked.
Contact lenses are another major pathway. Handling lenses with unwashed hands, skipping daily disinfection, or sleeping in your contacts all push bacteria closer to your eyelid glands. Bacteria thrive in moist, dark environments, which is exactly the condition a contact lens creates against your eye overnight. If you already have a stye, wearing contacts can trap bacteria under the lens and make things worse.
Eye makeup plays a significant role, especially creamy or liquid products like mascara and eyeliner. Bacteria grow easily in these formulations, and the American Academy of Ophthalmology recommends tossing eye makeup every three months. Applying liner inside your lash line can physically block the oil gland openings, and leaving mascara on overnight lets dried product accumulate right where styes form. Sharing eye makeup, even with close family, spreads bacteria between people.
Why Some People Get Styes Repeatedly
If you get styes more than once or twice, an underlying eyelid condition is likely involved. Blepharitis, a chronic inflammation of the eyelid margins, is the most common culprit. It causes the oil glands to thicken and clog more easily, creating a cycle of blocked glands and infections. Ocular rosacea, a condition related to skin rosacea, also leads to recurrent styes, blocked glands, and general eyelid irritation.
Beyond these conditions, lifestyle factors stack up. Poor sleep, high stress, and inadequate nutrition all weaken your body’s ability to fight off minor infections before they take hold. People who frequently rub their eyes, whether from allergies or habit, are constantly introducing bacteria and irritating gland openings.
Are Styes Contagious?
A stye itself isn’t contagious in the way a cold is. You won’t catch one by being near someone who has one. However, the pus inside a stye contains a small amount of bacteria that could theoretically spread to another person through direct contact. Washing your hands after touching your eye area is enough to prevent this. Don’t share towels, pillowcases, or eye makeup with someone who has an active stye.
How Long a Stye Lasts
Most styes resolve on their own within one to two weeks. Applying a clean, warm compress for 10 to 15 minutes several times a day can speed healing by softening the blocked oil and encouraging the gland to drain. Resist the urge to squeeze or pop a stye. Forcing it open can spread the infection deeper into your eyelid.
If a stye becomes very painful, starts affecting your vision, produces significant pus, or the redness and swelling spread beyond the bump to the surrounding eyelid or cheek, those are signs the infection may need medical treatment. A stye that doesn’t improve after two weeks also warrants a visit, since a persistent, painless lump may actually be a chalazion (a blocked gland without active infection) that requires different care.
Preventing Styes
Daily eyelid hygiene is the most effective prevention. Wash your eyelids gently with diluted baby shampoo and warm water, cleaning along the lash margin where gland openings sit. This removes the oil, dead skin, and debris that lead to blockages. Duke Eye Center recommends this as a baseline habit, especially if you’ve had styes before.
A few specific habits make a measurable difference:
- Remove all eye makeup before bed. Mascara that dries on your lashes overnight is a direct route to clogged glands.
- Replace eye makeup regularly. Every three to six months, depending on the product. If you develop any eye infection, throw out everything you were using and start fresh once the infection clears.
- Apply eyeliner outside the lash line. Drawing it along the inner rim blocks the very gland openings you’re trying to keep clear.
- Disinfect contact lenses daily and never sleep in them unless specifically designed for overnight wear.
- Wash your eyelids after swimming. Pool water, hot tubs, and other shared water sources harbor chlorine-resistant bacteria that can trigger eye infections.
- Wash your eyelids after heavy sweating. Sweat and excess oil clog eyelid glands just like makeup does.
- Keep your hands away from your eyes. If you need to touch your eye area, wash your hands first.
If you get styes frequently despite good hygiene, it’s worth being evaluated for blepharitis or ocular rosacea. Treating the underlying condition breaks the cycle of recurring infections.

