How Do You Get a Stye? Causes and Risk Factors

Styes form when bacteria infect one of the tiny oil or sweat glands along your eyelid margin. In 90% to 95% of cases, the culprit is Staphylococcus aureus, a common bacterium that already lives on your skin and around your nose. It only becomes a problem when it gets trapped inside a clogged gland, where it multiplies and triggers a painful, pus-filled bump.

How a Stye Actually Forms

Your eyelids are lined with dozens of small glands. Some produce oil that keeps your tear film from evaporating too quickly. Others are attached to your eyelash follicles and secrete oil or sweat. When any of these glands gets blocked by dead skin cells, dried oil, or debris, bacteria that normally sit harmlessly on your skin surface can colonize the trapped material and cause an infection.

The result is a localized abscess: your immune system sends white blood cells to fight the bacteria, fluid and pus accumulate, and the area swells into a tender red bump. This whole process can happen quickly, sometimes overnight. Most styes last one to two weeks and resolve on their own as the pus drains.

There are two types. An external stye forms at the base of an eyelash, in one of the oil or sweat glands near the lid margin. An internal stye develops deeper inside the eyelid, in one of the larger oil-producing glands. Internal styes tend to be more painful because they press against the eyeball, but both types follow the same basic infection process.

Common Causes and Risk Factors

Most styes come down to bacteria reaching a place they shouldn’t be. Here are the most common ways that happens:

  • Touching or rubbing your eyes with unwashed hands. This is the single most common route. Your fingers carry staph bacteria from surfaces you touch throughout the day, and rubbing your eyes deposits them directly onto your eyelid glands.
  • Old or shared eye makeup. Mascara, eyeliner, and eyeshadow brushes accumulate bacteria over time. Liquid and gel eyeliners are especially prone because their moisture content encourages bacterial growth; they should be replaced every three to six months. Pencil eyeliners last longer (up to two years) because sharpening removes the contaminated surface. Sharing any eye makeup transfers bacteria between people.
  • Sleeping in contact lenses. Wearing lenses overnight traps bacteria against your eye and reduces oxygen flow to the surface. The CDC recommends removing lenses before sleeping, swimming, or showering. Poor lens hygiene in general, like reusing old solution or not washing your hands before handling lenses, raises your risk.
  • Leaving eye makeup on overnight. Makeup residue can block gland openings while you sleep, creating exactly the kind of environment bacteria thrive in.

Chronic Conditions That Make Styes Recurrent

If you get styes repeatedly, a one-off hygiene issue probably isn’t the full story. Two chronic conditions are closely linked to recurrent styes.

Blepharitis is ongoing inflammation of the eyelid margins. It causes the oil glands along your lash line to become chronically clogged, creating a near-constant opportunity for bacterial infection. People with blepharitis often notice flaky, crusty debris at the base of their eyelashes, especially in the morning. This condition doesn’t go away on its own but can be managed with regular eyelid cleaning.

Rosacea, particularly when it affects the eyes (ocular rosacea), disrupts the function of the oil glands in your eyelids. The chronic inflammation leads to frequent styes and chalazia. Tiny mites called Demodex, which live on most people’s skin in small numbers, tend to overpopulate in rosacea and can worsen the inflammatory cycle. Bacteria living inside these mites may further provoke the immune response on your eyelid surface.

Stye vs. Chalazion

Not every eyelid bump is a stye. A chalazion looks similar but develops differently. While a stye is a bacterial infection that comes on fast and hurts, a chalazion forms slowly when a blocked oil gland becomes chronically inflamed without bacterial involvement. The key difference: a chalazion usually doesn’t hurt, even when you press on it. It tends to sit on the inner part of the eyelid as a firm, round lump without visible pus. Chalazia can linger for weeks or months, while styes typically peak within a few days and clear up within one to two weeks.

If your bump doesn’t hurt, grows slowly, and doesn’t have a yellow pus point, it’s more likely a chalazion than a stye.

How to Prevent Styes

The core strategy is keeping your eyelid margins clean and reducing the bacterial load around your lash line.

Warm compresses are the simplest tool. A clean washcloth soaked in warm water, held against your closed eyelid for 5 to 10 minutes, softens hardened oil in the glands and helps them drain normally. This is especially useful if you’re prone to blepharitis or have already felt the early twinges of a stye forming.

Eyelid scrubs take cleaning a step further. You can use pre-moistened eyelid wipes, a cotton swab, or your fingertip to gently clean along the lash line. Several cleaning agents work well. Diluted baby shampoo (roughly one part shampoo to ten parts water) removes oily debris and scales. Hypochlorous acid wipes, available over the counter, are particularly effective against Staphylococcus aureus and can break down the bacterial films that build up on eyelid margins. Tea tree oil products (typically at 5% concentration in commercial lid scrubs) have antibacterial and anti-parasitic properties that also target Demodex mites.

Beyond cleaning, a few habits make a real difference: wash your hands before touching your face or eyes, replace mascara and liquid eyeliner every few months, never share eye makeup, remove all eye makeup before bed, and if you wear contact lenses, follow the full hygiene routine of rubbing and rinsing lenses with fresh solution, cleaning the case after every use, and replacing the case at least every three months.

When a Stye Needs Attention

Most styes drain and heal without treatment. But if pain and swelling haven’t started improving after 48 hours of warm compresses, or if they get noticeably worse after two to three days, the infection may need professional care. In rare cases, the infection can spread beyond the eyelid into the surrounding tissue of the eye socket. Signs that something more serious is happening include swelling that extends well beyond the eyelid, fever, vision changes, or pain with eye movement. These complications are uncommon, especially in otherwise healthy people, but they warrant prompt evaluation.