A stye is caused by a bacterial infection in one of the small glands along your eyelid. The bacterium responsible is almost always Staphylococcus aureus, a common species that naturally lives on your skin and eyelashes. When this bacteria gets trapped inside a blocked gland or hair follicle, it multiplies, triggers inflammation, and produces the painful red bump you recognize as a stye.
How Bacteria Infect Eyelid Glands
Your eyelids contain several types of tiny glands that keep your eyes lubricated. Oil glands at the base of each eyelash (called the glands of Zeis) produce a thin layer of sebum, while modified sweat glands sit nearby. Deeper inside the eyelid, larger oil glands called meibomian glands produce the lipid layer of your tear film, the oily coating that keeps tears from evaporating too quickly.
Staphylococcus aureus bacteria, which are part of the normal bacterial community on your skin, produce enzymes called lipases. These enzymes break down the oils inside eyelid glands, releasing fatty acids and cholesterol that accumulate in the gland’s duct. That buildup blocks the duct, trapping bacteria inside. Your immune system responds by flooding the area with white blood cells, which creates the swelling, redness, and pus that form the stye.
External vs. Internal Styes
Not all styes form in the same place, and the location determines what type you have. An external stye develops at the base of an eyelash, where the small oil or sweat glands become infected. These are the most common type and appear as a red, swollen bump right at the eyelid’s edge.
An internal stye forms deeper inside the eyelid, in one of the meibomian glands. Because these glands sit within the thicker tissue of the eyelid (the tarsal plate), internal styes tend to be more painful and can sometimes cause the entire eyelid to swell. Both types are caused by the same bacterial process, just in different glands.
Everyday Triggers That Lead to Styes
Anything that introduces bacteria to your eyelid or blocks its glands raises your risk. The most common everyday triggers are related to hygiene habits you might not think twice about.
- Touching your eyes with unwashed hands. Bacteria from your fingers transfer directly to your eyelashes and eyelid glands.
- Old or shared eye makeup. Eyelashes naturally carry bacteria, and as soon as a brush touches your lash line, the product is contaminated. Over time, bacteria build up inside the container. Experts recommend replacing eye cosmetics every three to four months and never sharing brushes or eyeliners.
- Sleeping in contact lenses or handling them with dirty hands. This traps bacteria against the eyelid surface for hours.
- Heat exposure to cosmetics. Storing makeup at temperatures above 85°F (for example, in a hot car) weakens the preservatives that keep bacterial growth in check.
One less obvious trigger: spitting into mascara or eyeliner to moisten it. The bacteria in your mouth can colonize the product and cause an infection the next time you apply it.
Chronic Conditions That Cause Recurring Styes
If you keep getting styes, a one-time hygiene slip probably isn’t the explanation. Two chronic conditions are closely linked to recurrent styes: blepharitis and ocular rosacea.
Blepharitis is ongoing inflammation of the eyelid margins. It creates a cycle where oil glands stay partially blocked, bacteria thrive along the lash line, and styes develop repeatedly. People with blepharitis often notice flaky, crusty buildup at the base of their eyelashes, especially in the morning.
Ocular rosacea is an inflammatory condition that affects the eyes in 10% to 50% of people with skin rosacea, and it can appear even without any facial redness. It involves an overactive immune response on the eye’s surface, with chronic inflammation that keeps the meibomian glands irritated and prone to blockage. Patients with ocular rosacea commonly present with recurrent styes as one of the earliest signs. Tiny mites called Demodex, which live naturally on eyelashes, may contribute to this inflammation. Bacteria inside these mites can trigger additional immune reactions on the eyelid surface.
Stress, Sleep, and Immune Function
No clinical study has directly proven that stress causes styes, but the connection isn’t purely anecdotal either. Some ophthalmologists report that patients who are sleep-deprived or under heavy stress develop styes more frequently, and there’s a plausible biological reason for it.
Stress weakens your immune system’s ability to keep bacteria in check. Research shows that stress hormones can be converted into compounds that actually help bacteria colonize vulnerable tissues. Sleep deprivation has a similar effect: it specifically reduces the activity of T cells, the immune cells responsible for fighting off infections. When your immune defenses dip, the Staphylococcus bacteria already living on your eyelids are more likely to cause an active infection.
Styes vs. Chalazia
A stye is sometimes confused with a chalazion, and the distinction matters because the causes are different. A stye is a bacterial infection. It’s very painful, appears as a red, sore lump near the eyelid’s edge, and can make the entire eyelid swell. A chalazion is a blocked oil gland without an active infection. It forms farther back on the eyelid, is usually painless (at least at first), and rarely causes the whole eyelid to swell.
A stye that doesn’t fully resolve can sometimes turn into a chalazion once the infection clears but the gland remains blocked. If you have a painless bump that has lingered for weeks, it’s more likely a chalazion than a stye.
How Long Styes Last
Most styes resolve on their own within one to two weeks. Warm compresses, applied for 10 to 15 minutes several times a day, are the standard home treatment. The heat softens the blocked material inside the gland and encourages it to drain naturally.
If pain and swelling haven’t started improving after 48 hours of warm compresses, that’s the point to see an eye doctor. You should also seek care if your eye swells shut, pus or blood leaks from the bump, blisters form on the eyelid, your eyelids feel hot, or your vision changes. In stubborn cases, a doctor can drain the stye with a small incision. For people who get styes repeatedly, a doctor may take a small tissue sample to rule out other conditions.