An eye infection is inflammation caused by bacteria, viruses, or fungi invading any part of the eye or its surrounding tissue. Infections can affect the outer surface, the eyelids, the cornea, or even the interior of the eye, and they range from mild irritation that clears on its own to serious conditions that threaten your vision. The most common type by far is conjunctivitis, better known as pink eye, which is especially frequent in children and highly contagious.
Where Eye Infections Occur
The location of an infection determines both how it feels and how serious it is. Conjunctivitis targets the thin membrane lining the white of the eye and the inner eyelid, producing redness, discharge, and that telltale gritty feeling. Blepharitis affects the eyelid margins, often causing flaky debris and warmth along the lash line. It frequently overlaps with chronic conjunctivitis, and symptoms can persist for four weeks or longer.
Keratitis is an infection of the cornea, the clear dome covering your iris and pupil. Because the cornea is directly in the path of light entering your eye, keratitis symptoms are more disruptive: blurred or decreased vision, sharp pain, extreme light sensitivity, excessive tearing, and a persistent sensation that something is stuck in your eye. Left untreated, keratitis can cause chronic corneal scarring, open sores called corneal ulcers, and permanent vision loss or blindness.
Deeper infections are less common but more dangerous. Uveitis involves the middle layer of the eye wall and can result from infection or autoimmune processes. Endophthalmitis is an infection inside the eyeball itself, typically following eye surgery or a penetrating injury, and it requires emergency treatment to save the eye.
Bacterial, Viral, and Fungal Causes
Most eye infections fall into one of three categories based on the pathogen involved, and each behaves differently.
Bacterial infections tend to produce thick, yellow-green discharge that may crust your eyelids shut overnight. Acute bacterial conjunctivitis is the most common form and typically resolves on its own within one to two weeks, though antibiotic eye drops can shorten that timeline. Hyperacute bacterial conjunctivitis is rare but aggressive, with rapid onset, severe swelling, heavy discharge, pain, and decreased vision. This form needs prompt treatment.
Viral conjunctivitis is usually milder and produces a watery rather than thick discharge. Most cases clear up in 7 to 14 days without treatment, though some take two to three weeks or more. Antibiotics don’t work against viruses, so management focuses on comfort: cool compresses, artificial tears, and keeping the infected eye clean. Viral conjunctivitis is extremely contagious during the active phase, spreading through direct contact with eye secretions or contaminated surfaces.
Fungal eye infections are uncommon but tend to be more stubborn and difficult to diagnose. They’re most often seen after an eye injury involving plant material (a branch scratch, for example) or in people with weakened immune systems. Fungal keratitis in particular can progress slowly, delaying diagnosis and increasing the risk of corneal damage.
Contact Lenses and Infection Risk
Wearing contact lenses is one of the biggest modifiable risk factors for corneal infection. Research published in the British Journal of Ophthalmology found that the risk varies significantly by lens type and wearing schedule. People who sleep in conventional hydrogel lenses (extended wear) had the highest rate of severe keratitis: roughly 90 cases per 10,000 wearers per year. Daily-wear rigid lenses carried the lowest risk. Even daily disposable soft lenses aren’t risk-free, with about 5 severe keratitis cases per 10,000 wearers annually.
The CDC outlines specific habits that reduce your risk. Wash your hands thoroughly with soap and water before touching your lenses, and dry them with a clean cloth. Never rinse or store lenses in tap water. After each use, clean your lens case by rubbing and rinsing it with fresh contact lens solution, then store it upside down with the caps off to air dry. Replace the case at least every three months. If you develop eye pain, redness, discharge, or light sensitivity while wearing contacts and symptoms don’t improve within a few hours of removing your lenses, see an eye care provider promptly.
Eye Infections in Newborns
Newborns are vulnerable to a specific set of eye infections, usually contracted during delivery. A mother with untreated chlamydia can pass the bacteria to her baby, causing chlamydial conjunctivitis that typically appears 5 to 14 days after birth, sometimes earlier if the amniotic sac ruptured during labor. Symptoms include watery or bloody discharge, swollen and reddened eyelids, and thickened tissue on the inner eye surface. Gonococcal conjunctivitis, passed from a mother with untreated gonorrhea, can cause severe eye damage if not treated quickly.
Herpes viruses (both genital and oral strains) and normal vaginal bacteria can also cause newborn eye infections. To prevent these, most U.S. states require hospitals to apply antibiotic eye drops, typically erythromycin, within two to three hours of birth. Ironically, these preventive drops themselves sometimes cause mild chemical irritation and temporary redness, which resolves on its own.
How Eye Infections Are Diagnosed
Many common eye infections, particularly straightforward conjunctivitis, are diagnosed based on symptoms and a physical exam. Your doctor will look at the type of discharge, the pattern of redness, and whether one or both eyes are affected. Bacterial conjunctivitis is more likely to involve thick discharge and affect one eye initially, while viral conjunctivitis often starts in one eye and spreads to the other with watery discharge.
When an infection is severe, recurrent, or not responding to initial treatment, more specialized testing may be needed. A slit-lamp exam uses a high-powered microscope to examine the cornea and other structures in detail. For suspected keratitis, a doctor may gently scrape a small sample from the cornea to identify the organism under a microscope or grow it in a culture. Rapid point-of-care tests can detect adenovirus (a common cause of viral pink eye) from a swab of eye fluid in about 10 minutes. Molecular testing, which detects pathogen DNA, is increasingly used for difficult cases because it’s more sensitive than traditional cultures.
What Treatment Looks Like
Treatment depends entirely on the cause. Mild viral conjunctivitis needs no medication. You manage it with cold compresses and artificial tears for comfort while your immune system does the work over one to three weeks.
Bacterial infections are treated with antibiotic eye drops or ointments. For routine cases, older antibiotic formulas remain effective. Moderate to severe infections may call for newer-generation drops. You’ll typically apply drops several times a day for five to seven days, and symptoms often improve within the first 48 hours. Steroid-containing drops are sometimes considered alongside antibiotics to control inflammation, but their use is controversial. Steroids can slow healing, increase pressure inside the eye, and in some cases worsen corneal damage.
Fungal and parasitic infections require targeted treatment and tend to need longer courses. These infections often involve closer monitoring, including follow-up exams to check that the cornea is healing properly.
Symptoms That Need Urgent Attention
Most eye infections are uncomfortable but not dangerous. A few warning signs, however, signal something more serious. Seek urgent care from an eye specialist if you experience sudden partial or complete vision loss, severe eye pain (especially deep, throbbing pain), extreme sensitivity to light, or significant swelling of the eyelids and surrounding tissue. These symptoms can indicate a corneal ulcer, a deeper infection, or another serious condition that needs same-day evaluation.
Rapid-onset conjunctivitis with heavy discharge, intense redness, and pain may be hyperacute bacterial conjunctivitis, which can damage the cornea within hours if untreated. Any eye pain following contact lens use that persists after lens removal is also a reason for prompt evaluation, since contact lens-related keratitis can progress quickly.

