Eye infections can cause pain, discharge, and swelling. However, symptoms and treatment options vary depending on the cause, whether viral, bacterial, or fungal.

If you’ve noticed some pain, swelling, itching, or redness in your eye, you likely have an eye infection. Eye infections fall into three specific categories based on their cause: viral, bacterial, or fungal, and each is treated differently.

The good news is eye infections aren’t hard to spot, so you can seek treatment quickly.

Here’s everything you need to know about the eight most common eye infections so you can figure out the cause and what to do about it.

Infectious conjunctivitis, or pink eye, is one of the most common eye infections. It happens when blood vessels in the conjunctiva, the thin outermost membrane surrounding your eyeball, become infected by bacteria or a virus.

As a result, your eyes become pink or red and inflamed.

Conjunctivitis caused by bacteria or viruses is extremely contagious. Depending on the cause, you can still spread it up to two weeks after the infection starts. It can also result from allergies or exposure to chemicals, like chlorine, in swimming pools.

Depending on your type, you may need different treatments. This includes antibiotic eye drops and over-the-counter (OTC) antihistamines. Sometimes, the only treatment is to wait and apply a clean, warm, wet cloth to your eyes to relieve discomfort.

Infectious keratitis happens when your cornea gets infected. The cornea is the clear layer that covers your pupil and iris. Keratitis results from either an infection (bacterial, viral, fungal, or parasitic) or an eye injury. Keratitis means swelling of the cornea and isn’t always infectious.

If you notice any keratitis symptoms, see your doctor immediately to stop the infection. Some treatments for keratitis include.

Treatment usually involves eye drops. The symptoms of bacterial keratitis should improve in 2-7 days after starting treatment with antibiotics, whereas fungal infections can take many weeks to treat.

However, a viral infection cannot be fully eliminated, even with oral antiviral medications or eye drops. The symptoms may later return even with treatment.

Learn more about Keratitis symptoms.

Endophthalmitis is severe inflammation of the inside of the eye resulting from a bacterial or fungal infection. The most common type of endophthalmitis is exogenous, which means it develops from contracting a pathogen in your environment. Staphylococcus and streptococcus infections are the most common types.

Although it is rare, this condition can occur about 6 weeks after certain eye surgeries, such as cataract surgery, and it may also happen after an object penetrates your eye.

To treat the infection, antibiotics must be injected directly into your eye. You may also need a corticosteroid shot to reduce inflammation. If an object causes the infection, seek immediate medical attention instead of trying to remove it yourself. With proper treatment, symptoms can improve in a few days.

Learn more about endophthalmitis symptoms.

Blepharitis is an inflammation of the skin folds covering the eyes. It is usually caused by bacteria clogging the oil glands inside the eyelid skin at the base of the eyelashes, but it may have non-infectious causes. Even when the cause is bacteria, it’s not contagious.

Treatments for blepharitis include cleaning the eyelids with clean water and applying a warm, wet towel to relieve swelling, along with corticosteroid eye drops or ointments to help with inflammation.

You may also need lubricating eye drops to moisten your eyes and prevent irritation from dryness, as well as antibiotics, which may be oral, topical, or eye drops. Depending on what causes it, it can become a chronic condition that needs continuous management.

Learn more about blepharitis symptoms.

A stye (also called a hordeolum) is a pimple-like bump that develops from an oil gland on the outer edges of your eyelids. These glands can get clogged with dead skin, oils, and other matter, allowing bacteria to overgrow in your gland. The resulting infection causes a sty. Like blepharitis, styes are generally not contagious.

Some treatments for styes include applying a clean, warm, damp cloth to your eyelids for 5 minutes at a time a few times a day and using mild, scent-free soap and water to clean your eyelids.

You may need to use antibiotic ointments to help kill the infectious overgrowth and take over-the-counter (OTC) pain relievers, such as acetaminophen (Tylenol), to help with pain and swelling. While you’re being treated, you may need to stop using contact lenses or eye makeup.

See your doctor if the pain or swelling worsens, even with treatment. A stye should disappear in about 7 to 10 days. If it doesn’t, ask your doctor about other possible treatments.

Learn more about styes and their symptoms.

Uveitis is inflammation of the uvea, the central layer of the eyeball that transports blood to the retina and transmits images to the brain. It can be caused by immune system conditions, infections, or eye injuries.

Uveitis doesn’t usually cause any long-term problems, but you can lose vision if a severe case isn’t treated. It may be contagious, depending on the cause.

Treatment for uveitis may include:

  • wearing darkened glasses
  • eye drops that open up your pupil to relieve pain
  • corticosteroid eye drops or oral steroids that relieve inflammation
  • eye injections to treat symptoms
  • oral antibiotics for infections that have spread beyond your eye
  • medications that subdue your immune system (severe cases)

Uveitis usually starts to improve after a few days to weeks of treatment. Types that affect the back of your eye, called posterior uveitis, may take longer — up to several months if caused by an underlying condition.

Learn more about uveitis symptoms.

Eyelid cellulitis, also called periorbital or preseptal cellulitis, happens when eye tissues get infected. It’s often caused by an injury like a scratch to your eye tissues that introduces infectious bacteria, such as Staphylococcus (staph), or bacterial infections of nearby structures, such as sinus infections.

Young children are more likely to get cellulitis because they are more likely to contract the type of bacteria that causes this condition.

Treatment for cellulitis may include taking oral antibiotics, such as amoxicillin, or IV antibiotics for children under 4. In severe, though rare, cases, you may need surgery to relieve pressure within your eye.

Learn more about the symptoms of preseptal cellulitis vs orbital cellulitis.

Ocular herpes happens when your eye is infected by the herpes simplex virus (HSV-1). It’s often just called eye herpes.

Eye herpes is spread by contact with someone who has an active HSV-1 infection, not through sexual contact (that’s HSV-2).

The treatment may include taking antiviral medication, such as acyclovir (Zovirax), such as eye drops, oral medications, or topical ointments. You may also need debridement, which is brushing off your cornea with cotton to remove infected cells.

Some people may need corticosteroid eye drops to relieve inflammation if infection spreads further into your eye (the stroma). That said, it’s common for the condition to recur later on.

Learn more about the symptoms of herpes in the eye.

Do the following to help prevent eye infections or keep viral infections from recurring:

  • Don’t touch your eyes or face with dirty hands.
  • Bathe regularly and wash your hands frequently.
  • Eat a balanced diet, as nutritional deficiencies are thought to be related to the development of various eye diseases, including infection
  • Use clean towels and tissues on your eyes.
  • Don’t share eye and face makeup with anyone.
  • Wash your bedsheets and pillowcases at least once a week.
  • Wear contact lenses that fit well into your eye, and see your eye doctor regularly to check them.
  • Use contact solution to disinfect lenses every day.
  • Don’t touch anyone who has conjunctivitis.
  • Replace any object that’s been in contact with an infected eye.

What are the most common eye infections?

Conjunctivitis, keratitis, and endophthalmitis are the most common types of eye infections.

What does a bacterial eye infection look like?

This may depend on the cause. With conjunctivitis, for example, bacterial infections will be accompanied by yellow or green sticky discharge that persists all day, along with itchy eyes and swollen eyelids.

On the other hand, viral Conjunctivitis usually has watery discharge during the day and sticky discharge in the morning, along with significant swelling of the eyelids.

Eye infection symptoms often go away on their own in a few days.

But seek emergency medical attention if you have severe symptoms. Pain or loss of vision should prompt a visit to your doctor.

The earlier an infection is treated, the less likely you are to experience any complications.