A stye is caused by a bacterial infection in one of the tiny oil glands or hair follicles along your eyelid margin. The culprit is almost always Staphylococcus aureus, a common bacterium that many people carry on their skin and inside their nose without any problems. When that bacterium gets into a blocked or vulnerable gland on your eyelid, it triggers a painful, red bump that fills with pus.
But the infection itself is only part of the story. Several everyday habits, skin conditions, and body changes can set the stage for a stye by clogging those glands or introducing bacteria to your eyes in the first place.
How the Infection Starts
Your eyelids contain dozens of small glands that produce oils to keep your tears from evaporating too quickly. There are also tiny glands attached to each eyelash follicle. When any of these glands gets blocked by dead skin cells, dried oil, or debris, bacteria that are already living on your skin can multiply inside the clogged gland. Your immune system responds with inflammation, and the result is a swollen, tender bump.
External styes form at the base of an eyelash, in the smaller oil or sweat glands along the outer edge of your lid. Internal styes develop deeper inside the eyelid, in the larger oil-producing glands (called meibomian glands) embedded in the lid tissue. Internal styes tend to be less visible from the outside but can feel more uncomfortable because they press against the surface of the eye.
Everyday Triggers That Block Glands
The single most common trigger is touching or rubbing your eyes with unwashed hands. Staphylococcus bacteria live in large numbers inside the nose. If you touch your nose and then rub your eye, you can transfer bacteria directly to a vulnerable gland opening. This is also why styes sometimes show up when you’re sleep-deprived or run down: you’re more likely to rub tired eyes without thinking about it, and less likely to keep up with hygiene routines like removing makeup before bed.
Eye cosmetics are another major contributor. Eyelashes naturally carry bacteria, so the moment a mascara wand or eyeliner brush touches your lashes, the product is contaminated. Over weeks and months, bacteria build up inside the cosmetics container, raising the infection risk with every application. Experts at the University of Rochester Medical Center suggest replacing eye makeup every three to four months to limit that buildup. Sharing eye makeup, brushes, or applicators with someone else compounds the risk further.
Contact lenses can also play a role if you handle them without washing your hands first, or if you sleep in lenses not designed for overnight wear. Anything that introduces bacteria to the lid margin or disrupts the normal oil flow increases your chances.
Skin Conditions That Raise Your Risk
Some people get styes repeatedly, and the reason often traces back to a chronic eyelid or skin condition rather than a single hygiene slip.
Blepharitis, a common condition where the eyelid margins become chronically inflamed, is the biggest ongoing risk factor. In blepharitis, the oil glands along the lash line don’t drain properly. Oily particles and bacteria coat the base of the eyelashes, creating an environment where infections start easily. If you notice persistent flaking, crusting, or irritation along your eyelids, blepharitis may be why styes keep coming back.
Rosacea, particularly the form that affects the eyes (ocular rosacea), and seborrheic dermatitis both increase stye risk as well. These conditions alter the quality and flow of oil from the eyelid glands, making blockages more frequent. People with either condition often deal with recurrent styes or chalazia (the non-painful bumps that form when a blocked gland becomes chronically inflamed without active infection).
The Role of Stress and Sleep
There’s no direct scientific evidence that stress causes styes, but there are plausible indirect links. Stress hormones can weaken your immune response, making it harder for your body to keep normal skin bacteria in check. One 2017 study found that certain stress hormones break down into compounds that may actually attract bacteria to susceptible areas of the body.
Poor sleep has a more concrete connection. Sleep deprivation reduces the effectiveness of T cells, key immune cells that fight off infections. On top of that, when you’re exhausted you’re more likely to skip the small habits that matter: removing eye makeup, washing your face thoroughly, keeping your hands away from your eyes. The combination of lowered immunity and relaxed hygiene creates an opening for infection.
Styes vs. Chalazia
People often confuse styes with chalazia because both appear as bumps on the eyelid. The key differences are pain and location. A stye is painful from the start and usually sits right at the edge of the eyelid, near the lash line. A chalazion is typically painless and develops farther back on the lid, away from the edge. Chalazia form when a blocked oil gland becomes inflamed but not actively infected. A stye that doesn’t resolve can sometimes turn into a chalazion once the acute infection subsides but the gland remains plugged.
Can You Spread a Stye?
Styes are rarely contagious, but the bacteria inside them can transfer to another person through direct contact or shared items like towels and pillowcases. The more important concern is spreading the infection to yourself. Touching or squeezing a stye can push bacteria-filled pus into surrounding tissue, potentially turning a small bump into a more serious eyelid infection. Never pop a stye. If it needs to drain, warm compresses applied for 10 to 15 minutes several times a day will usually encourage it to open on its own.
Reducing Your Risk
Most stye prevention comes down to keeping the eyelid glands clean and unblocked. Washing your hands before touching your face, removing all eye makeup before sleep, and replacing mascara and eyeliner every three to four months covers the basics. If you wear contact lenses, clean them according to the schedule your eye care provider recommended and avoid handling them with unwashed fingers.
For people with blepharitis or rosacea, daily lid hygiene makes a significant difference. This usually means gently cleaning the lash line each morning with a warm, damp washcloth or a dedicated lid scrub. Warm compresses held against closed eyelids for several minutes help soften and release oil that might otherwise harden and block the glands. Keeping these conditions well managed is the most effective way to break the cycle of recurring styes.

