A stye forms when bacteria infect one of the small glands along your eyelid. The culprit is almost always Staphylococcus aureus, a common bacterium that many people carry on their skin and inside their nose without any problems. The infection starts when that bacteria finds its way into a gland opening, usually through touching your eyes with unwashed hands, and the gland becomes blocked and inflamed.
What Happens Inside Your Eyelid
Your eyelids contain dozens of tiny oil-producing glands. Some sit right at the base of your eyelashes, and others are embedded deeper inside the eyelid itself. These glands produce oils that keep your tears from evaporating too quickly and protect the surface of your eye. When bacteria get into one of these glands and the opening becomes clogged, the gland swells with infected material and forms the painful red bump you recognize as a stye.
Most styes are external, meaning they develop at the root of an eyelash follicle near the outer edge of your eyelid. Internal styes form when the infection hits a larger oil gland deeper inside the lid. Internal styes tend to be more painful because they press against the eyeball, but both types follow the same basic process: bacteria plus a blocked gland equals infection. A stye typically comes to a head and forms a visible pimple-like bump within 3 to 5 days.
The Most Common Ways Bacteria Reach Your Eyes
The single biggest risk factor is touching your eyes with dirty hands. The staph bacteria that cause styes live on skin surfaces and especially inside the nose. Rubbing your nose and then rubbing your eye is one of the most direct routes for transferring those bacteria to your eyelid glands.
Eye makeup is another major source. Every time you apply mascara, eyeliner, or eyeshadow, the applicator touches both the product and your eyelid, transferring bacteria back and forth. Over time, the product itself becomes contaminated. Old makeup is especially problematic because bacteria multiply in it. Mascara and liquid eyeliner should be replaced every four months, and pencil eyeliners can last up to a year before they pose a higher risk.
Contact lenses add another layer of risk. Handling lenses means touching your eyes frequently, and if your hands aren’t clean each time, you’re introducing bacteria to your lids. Reusing old lens solution, skipping cleaning steps, or wearing lenses past their replacement schedule all increase the chance of infection. If a stye does develop while you’re wearing contacts, the lens can rub against the swollen lid and trap bacteria near the eye, making things worse.
Conditions That Make Styes More Likely
Some people get styes repeatedly, and that often points to an underlying eyelid condition. Blepharitis, a chronic inflammation of the eyelid margins, is the most common one. It causes the oil glands to thicken and clog more easily, creating the perfect setup for bacterial infection. If your eyelids frequently feel crusty, irritated, or greasy at the lash line, blepharitis may be involved.
Ocular rosacea, a form of rosacea that affects the eyes and surrounding skin, also increases stye risk. It disrupts the function of the oil glands in the eyelids in much the same way blepharitis does. Styes are listed among the most common symptoms of ocular rosacea. People with either condition often need a daily eyelid cleaning routine to keep their glands clear and reduce flare-ups.
Stress, Sleep, and Your Immune System
No study has directly proven that stress causes styes, but the connection isn’t imaginary. Stress weakens your immune system, and a weaker immune system is less effective at fighting off the bacteria that cause styes. Research has also found that stress hormones can be converted into compounds that actually help attract bacteria to vulnerable areas of the body.
Sleep deprivation works through a similar pathway. Poor sleep reduces the activity of T cells, the immune cells responsible for fighting infections. There’s also a practical side to it: when you’re exhausted, you’re more likely to skip habits that protect your eyes. You might fall asleep without removing your makeup, forget to wash your hands before taking out contacts, or rub your eyes more often throughout the day. Those small lapses add up.
Can You Catch a Stye From Someone Else?
Styes are not contagious in the way a cold or the flu is. You won’t get one from sitting near someone who has one or being in the same room. That said, the bacteria that cause styes can, in rare cases, transfer through direct contact or shared items like towels and pillowcases. Sharing eye makeup or applicators carries a similar risk. The practical takeaway is to avoid sharing anything that touches your face or eyes with someone who has an active stye.
If you already have a stye, never squeeze or pop it. The bump contains bacteria-filled pus that can spread the infection to other parts of your eye or to the surrounding skin.
How to Prevent Styes
Keeping your hands away from your eyes is the most effective prevention. Wash your hands thoroughly before touching your face, handling contact lenses, or applying makeup. Replace eye cosmetics on schedule and never share them.
If you’re prone to styes or have blepharitis, a daily warm compress routine helps keep your oil glands from clogging. Place a warm, damp washcloth over your closed eye for 5 to 10 minutes, re-wetting it as it cools, then gently massage the eyelid. Doing this two to three times a day can help an existing stye drain on its own and prevent new ones from forming. Washing your eyelids gently with mild soap and water also reduces the bacterial load along your lash line.

