A stye is caused by a bacterial infection in one of the tiny oil or sweat glands along your eyelid. The culprit is almost always Staphylococcus aureus, a common bacterium that lives on your skin and only causes trouble when it gets trapped inside a blocked gland. Once the gland is plugged, bacteria multiply, pus builds up, and you get that painful red bump near your lash line.
How a Stye Forms
Your eyelids contain dozens of small glands that produce oils and sweat to keep your eyes lubricated. When one of these glands gets clogged by dead skin cells, dried oil, or debris, bacteria that normally sit harmlessly on your skin can colonize the blocked gland. The result is a localized abscess: a small pocket of infection that swells, reddens, and becomes tender to the touch.
There are two types depending on which glands are affected. An external stye forms near the base of an eyelash, where oil and sweat glands sit close to the skin’s surface. Pus from an external stye tends to drain along the outer lash line. An internal stye develops deeper inside the eyelid in the meibomian glands, which produce the oily layer of your tear film. Your upper eyelid alone has 40 to 50 meibomian glands, and the lower lid has 20 to 25, which is why it’s possible to develop more than one stye at the same time. Internal styes are less common but can be more uncomfortable because they press against the eyeball.
Risk Factors That Set the Stage
The bacteria behind styes are already on your skin. What determines whether you get one is usually a combination of hygiene habits and underlying conditions that make gland blockages more likely.
The most straightforward risk factors are behavioral. Touching your eyes with unwashed hands introduces extra bacteria directly to the gland openings. Inserting contact lenses without disinfecting them or washing your hands first does the same. Sleeping in eye makeup is a significant contributor because cosmetics can physically block gland openings overnight, giving bacteria hours to settle in. Using old or expired makeup compounds the risk since bacteria accumulate in cosmetic containers over time.
Chronic eyelid conditions also play a major role. Blepharitis, a persistent low-grade inflammation of the eyelid margins, disrupts the normal flow of oil from glands and creates an environment where blockages happen more easily. Ocular rosacea, the eye-related form of the skin condition rosacea, is specifically linked to recurrent styes because it causes ongoing gland blockage and eyelid inflammation. If you get styes repeatedly, one of these underlying conditions may be the reason.
The Role of Stress and Sleep
There are no clinical studies proving that stress directly causes styes. However, many eye specialists observe that their patients develop styes more often during periods of high stress or poor sleep, and there are plausible biological reasons for this.
Stress hormones can weaken your immune response, making your body less effective at keeping the bacteria on your skin in check. Sleep deprivation has a similar effect: it specifically reduces the activity of T cells, a key part of your immune system’s ability to fight infection. There’s also a practical angle. When you’re exhausted, you’re more likely to skip good habits, like removing makeup before bed or washing your hands before rubbing your eyes. So while stress and sleep loss may not directly infect a gland, they create conditions where infection becomes more likely.
Stye vs. Chalazion
A chalazion looks similar to a stye but has a different cause and feels different. A stye is an active bacterial infection, so it’s red, swollen, and tender when you press on it. A chalazion is not an infection at all. It forms when oil from a meibomian gland leaks into surrounding tissue, triggering an inflammatory reaction. The result is a firm, painless nodule on the eyelid that can linger for weeks or months.
Sometimes a stye that doesn’t fully drain will turn into a chalazion after the infection clears. The key distinction: if the bump hurts, it’s likely a stye. If it’s a hard, painless lump, it’s probably a chalazion.
How Long a Stye Lasts
Most styes drain on their own within about a week. Applying a clean, warm washcloth over the closed eyelid for three to five minutes at a time helps soften the blockage and encourages the gland to open. Gently massaging along the eyelid afterward can help move trapped oil out. You can repeat this several times a day.
While a stye is healing, avoid covering it with makeup. Cosmetics can further plug the infected gland and slow recovery. Keep your hands away from the bump unless you’re applying a compress, and wash your hands before and after any contact with the area.
Reducing Your Risk
Since styes start with bacteria entering a blocked gland, prevention targets both of those factors. Washing your hands frequently, especially before touching your face or handling contact lenses, reduces the bacterial load around your eyes. Removing all eye makeup before sleep keeps gland openings clear overnight. Replacing mascara, eyeliner, and eyeshadow regularly, and never sharing cosmetics, limits bacterial contamination.
If you’re prone to recurrent styes or have blepharitis, a daily eyelid cleaning routine can make a real difference. Mix a small amount of baby shampoo with warm water, then use a clean washcloth or cotton swab to gently scrub along the base of your eyelashes. Use a separate cloth for each eye to avoid spreading bacteria. Doing this two to three times daily during flare-ups, or once daily as maintenance, helps keep the glands clear and reduces the bacterial population along the lid margin.

