How Do You Get an Ear Infection: Causes & Types

Ear infections develop when bacteria or viruses get trapped in parts of the ear where they don’t belong, usually after something blocks normal drainage or breaks down the ear’s natural defenses. The specific way you get one depends on which part of the ear is affected: the middle ear (behind the eardrum) or the outer ear canal.

How Middle Ear Infections Start

The middle ear is a small air-filled space behind your eardrum, connected to the back of your throat by a narrow passage called the eustachian tube. This tube has one critical job: equalizing pressure and draining fluid away from the middle ear. When it gets blocked, typically from swelling caused by a cold, allergies, or a sinus infection, the chain of events leading to an ear infection begins.

First, the blocked tube traps air in the middle ear. The lining of the middle ear absorbs that trapped air, creating negative pressure that pulls the eardrum inward. You might notice this as a feeling of fullness or muffled hearing. Over time, fluid accumulates in the space, and if bacteria contaminate that fluid, you get an acute middle ear infection. The three bacteria most commonly found in infected middle ear fluid are types that already live in the nose and throat, which travel up the eustachian tube when it’s swollen and not clearing properly.

Not every middle ear infection is bacterial. Studies of fluid samples from children with ear infections find bacteria in roughly 55 to 92 percent of cases, while viruses alone account for 4 to 26 percent. In 16 to 25 percent of cases, no pathogen is detected at all. This is why not every ear infection requires antibiotics, and many resolve on their own.

Why Children Get Ear Infections So Often

Children’s eustachian tubes are shorter, narrower, and more horizontal than those of adults. That geometry makes it harder for fluid to drain downward and easier for mucus or bacteria from the throat to reach the middle ear. As children grow, the tubes lengthen and angle more steeply, which is why most kids outgrow frequent ear infections by age seven or eight.

Several environmental factors stack the odds further. Attending daycare or being around other children increases exposure to the colds that trigger eustachian tube swelling. Having siblings at home does the same. Parental smoking, particularly maternal smoking, raises the risk of recurrent infections. Research shows that it’s not just secondhand smoke after birth that matters: children exposed to smoke both during pregnancy and after birth have a significantly higher risk of repeated ear infections compared to those exposed only after birth.

Other risk factors include a family history of ear infections, being male, and not being breastfed. Having an early first ear infection (before six months old) also predicts more infections later.

How Outer Ear Infections Develop

Outer ear infections, commonly called swimmer’s ear, affect the ear canal rather than the space behind the eardrum. The mechanism is completely different from a middle ear infection.

Your ear canal has a built-in defense system: a thin layer of earwax that’s slightly acidic, creating an environment hostile to bacteria. When water sits in the canal for extended periods, it wears down this protective wax and softens the skin underneath. That creates a warm, moist environment where bacteria multiply rapidly. The two bacteria most commonly responsible are types that thrive in damp conditions. Fungal infections can also develop, especially in humid climates or after antibiotic use has disrupted the ear canal’s normal microbial balance.

You don’t have to be a swimmer to get this type of infection. Anything that disrupts the earwax barrier can set the stage: aggressive cleaning with cotton swabs, wearing earbuds for long stretches, or scratching the ear canal. The CDC specifically recommends against trying to remove earwax, since it serves as a frontline defense against infection.

What Happens If an Ear Infection Goes Untreated

Most ear infections clear up within a few days to a couple of weeks, either on their own or with treatment. But when a middle ear infection lingers or keeps coming back, fluid pressure can eventually cause the eardrum to perforate, creating a small hole that lets infected fluid drain out. While this sometimes relieves pain, it can also lead to hearing problems.

The more serious risk is the infection spreading to the mastoid bone, the honeycomb-like bone directly behind the ear. This condition, called mastoiditis, typically happens when middle ear infections go untreated. From there, infection can potentially reach surrounding structures, causing complications ranging from hearing loss to infection of the tissues around the brain. These outcomes are rare but underscore why persistent ear pain or symptoms lasting more than a few days deserve attention.

Reducing Your Risk

For middle ear infections, prevention is mostly about reducing the triggers that cause eustachian tube swelling. Staying up to date on vaccinations matters more than many people realize. The pneumococcal vaccine targets one of the most common bacteria behind ear infections, and a large review of clinical trials found it reduced bacterial ear infections by 11 to 53 percent in vaccinated children compared to controls. Annual flu shots help too, since influenza and other respiratory viruses are the upstream cause of the eustachian tube blockage that starts the whole process.

The CDC recommends exclusive breastfeeding for the first six months and continued breastfeeding for at least 12 months, as breast milk provides antibodies that help protect against the infections that precede ear infections. Keeping children away from secondhand smoke, practicing regular hand washing, and limiting exposure to large groups of sick children during cold season all lower the odds as well.

For swimmer’s ear, the prevention strategy is simpler: keep your ear canals dry. Tilt your head to each side after swimming or showering to let water drain out. Leave your earwax alone. If you swim frequently, over-the-counter drying drops (a mix of rubbing alcohol and vinegar) can help restore the ear canal’s acidic environment after water exposure.