Pneumonia is an infection in one or both lungs. Bacteria, viruses, and fungi cause it.

The infection causes inflammation in the air sacs in your lungs, which are called alveoli. The alveoli fill with fluid or pus, making it difficult to breathe.

Read on to learn more about pneumonia and how to treat it.

The germs that cause pneumonia are contagious. This means they can spread from person to person.

Both viral and bacterial pneumonia can spread to others through inhalation of airborne droplets from a sneeze or cough. You can also get these types of pneumonia by coming into contact with surfaces or objects that are contaminated with pneumonia-causing bacteria or viruses.

You can contract fungal pneumonia from the environment. However, it doesn’t spread from person to person.

Pneumonia symptoms can be mild to life-threatening. They can include:

  • coughing that may produce phlegm (mucus)
  • fever
  • sweating or chills
  • shortness of breath that happens while doing normal activities or even while resting
  • chest pain that’s worse when you breathe or cough
  • feelings of tiredness or fatigue
  • loss of appetite
  • nausea or vomiting
  • headaches

Other symptoms can vary according to your age and general health:

  • Children under 5 years old may have fast breathing or wheezing.
  • Infants may appear to have no symptoms, but sometimes they may vomit, lack energy, or have trouble drinking or eating.
  • Older people may have milder symptoms. They can also exhibit confusion or a lower than normal body temperature.

There are several types of infectious agents that can cause pneumonia.

Bacterial pneumonia

The most common cause of bacterial pneumonia is Streptococcus pneumoniae. Other causes include:

Viral pneumonia

Respiratory viruses are often the cause of pneumonia. Some examples include:

Viral pneumonia is usually milder and can improve in one to three weeks without treatment.

Fungal pneumonia

Fungi from soil or bird droppings can cause pneumonia. They most often cause pneumonia in people with weakened immune systems. Examples of fungi that can cause pneumonia include:

Pneumonia can also be classified according to where or how it was acquired.

Hospital-acquired pneumonia (HAP)

This type of bacterial pneumonia is acquired during a hospital stay. It can be more serious than other types, as the bacteria involved may be more resistant to antibiotics.

Community-acquired pneumonia (CAP)

Community-acquired pneumonia (CAP) refers to pneumonia that’s acquired outside of a medical or institutional setting.

Ventilator-associated pneumonia (VAP)

When people who are using a ventilator get pneumonia, it’s called VAP.

Aspiration pneumonia

Aspiration pneumonia happens when you inhale bacteria into your lungs from food, drink, or saliva. This type is more likely to occur if you have a swallowing problem or if you’re too sedate from the use of medications, alcohol, or other drugs.

Your treatment will depend on the type of pneumonia you have, how severe it is, and your general health.

Prescription medications

Your doctor may prescribe a medication to help treat your pneumonia. What you’re prescribed will depend on the specific cause of your pneumonia.

Oral antibiotics can treat most cases of bacterial pneumonia. Always take your entire course of antibiotics, even if you begin to feel better. Not doing so can prevent the infection from clearing, and it may be harder to treat in the future.

Antibiotic medications don’t work on viruses. In some cases, your doctor may prescribe an antiviral. However, many cases of viral pneumonia clear on their own with at-home care.

Antifungal medications are used to fight fungal pneumonia. You may have to take this medication for several weeks to clear the infection.

At-home care

Your doctor may also recommend over-the-counter (OTC) medication to relieve your pain and fever, as needed. These may include:

Your doctor may also recommend cough medicine to calm your cough so you can rest. Keep in mind coughing helps remove fluid from your lungs, so you don’t want to eliminate it entirely.

You can help your recovery and prevent a recurrence by getting a lot of rest and drinking plenty of fluids.


If your symptoms are very severe or you have other health problems, you may need to be hospitalized. At the hospital, doctors can keep track of your heart rate, temperature, and breathing. Hospital treatment may include:

  • intravenous antibiotics injected into a vein
  • respiratory therapy, which involves delivering specific medications directly into the lungs or teaching you to perform breathing exercises to maximize your oxygenation
  • oxygen therapy to maintain oxygen levels in your bloodstream (received through a nasal tube, face mask, or ventilator, depending on severity)

Anyone can get pneumonia, but certain groups do have a higher risk. These groups include:

  • infants from birth to 2 years old
  • people ages 65 years and older
  • people with weakened immune systems because of disease or use of medications, such as steroids or certain cancer drugs
  • people with certain chronic medical conditions, such as asthma, cystic fibrosis, diabetes, or heart failure
  • people who’ve recently had a respiratory infection, such as a cold or the flu
  • people who’ve been recently or are currently hospitalized, particularly if they were or are on a ventilator
  • people who’ve had a stroke, have problems swallowing, or have a condition that causes immobility
  • people who smoke, use certain types of drugs, or drink excessive amounts of alcohol
  • people who’ve been exposed to lung irritants, such as pollution, fumes, and certain chemicals

In many cases, pneumonia can be prevented.


The first line of defense against pneumonia is to get vaccinated. There are several vaccines that can help prevent pneumonia.

Prevnar 13 and Pneumovax 23

These two pneumonia vaccines help protect against pneumonia and meningitis caused by pneumococcal bacteria. Your doctor can tell you which one might be better for you.

Prevnar 13 is effective against 13 types of pneumococcal bacteria. The Centers for Disease Control and Prevention (CDC) recommends this vaccine for:

  • children under the age of 2
  • adults ages 65 years and older
  • people between ages 2 and 64 years with chronic conditions that increase their risk for pneumonia

Pneumovax 23 is effective against 23 types of pneumococcal bacteria. The CDC recommends it for:

  • adults ages 65 years and older
  • adults ages 19 to 64 years who smoke
  • people between ages 2 and 64 years with chronic conditions that increase their risk for pneumonia

Flu vaccine

Pneumonia can often be a complication of the flu, so be sure to also get an annual flu shot. The CDC recommends that everyone ages 6 months and older get vaccinated, particularly those who may be at risk for flu complications.

Hib vaccine

This vaccine protects against Haemophilus influenzae type b (Hib), a type of bacteria that can cause pneumonia and meningitis. The CDC recommends this vaccine for:

  • all children under 5 years old
  • unvaccinated older children or adults who have certain health conditions
  • individuals who’ve gotten a bone marrow transplant

According to the National Institutes of Health (NIH), pneumonia vaccines won’t prevent all cases of the condition. But if you’re vaccinated, you’re likely to have a milder and shorter illness as well as a lower risk for complications.

Other prevention tips

In addition to vaccination, there are other things you can to avoid pneumonia:

  • If you smoke, try to quit. Smoking makes you more susceptible to respiratory infections, especially pneumonia.
  • Regularly wash your hands with soap and water.
  • Cover your coughs and sneezes. Promptly dispose used tissues.
  • Maintain a healthy lifestyle to strengthen your immune system. Get enough rest, eat a healthy diet, and get regular exercise.

Together with vaccination and additional prevention steps, you can help reduce your risk for getting pneumonia. Here are even more prevention tips.

Your doctor will start by taking your medical history. They’ll ask you questions about when your symptoms first appeared and your health in general.

They’ll then give you a physical exam. This will include listening to your lungs with a stethoscope for any abnormal sounds, such as crackling. Depending on the severity of your symptoms and your risk for complications, your doctor may also order one or more of these tests:

Chest X-ray

An X-ray helps your doctor look for signs of inflammation in your chest. If inflammation is present, the X-ray can also inform your doctor about its location and extent.

Blood culture

This test uses a blood sample to confirm an infection. Culturing can also help identify what may be causing your condition.

Sputum culture

During a sputum culture, a sample of mucus is collected after you’ve coughed deeply. It’s then sent to a lab to be analyzed to identify the cause of the infection.

Pulse oximetry

A pulse oximetry measures the amount of oxygen in your blood. A sensor placed on one of your fingers can indicate whether your lungs are moving enough oxygen through your bloodstream.

CT scan

CT scans provide a clearer and more detailed picture of your lungs.

Fluid sample

If your doctor suspects there’s fluid in the pleural space of your chest, they may take a fluid sample using a needle placed between your ribs. This test can help identify the cause of your infection.


A bronchoscopy looks into the airways in your lungs. It does this using a camera on the end of a flexible tube that’s gently guided down your throat and into your lungs. Your doctor may do this test if your initial symptoms are severe, or if you’re hospitalized and not responding well to antibiotics.

Walking pneumonia is a milder case of pneumonia. People with walking pneumonia may not even know they have pneumonia, as their symptoms may feel more like a mild respiratory infection than pneumonia.

The symptoms of walking pneumonia can include things like:

  • mild fever
  • dry cough lasting longer than a week
  • chills
  • shortness of breath
  • chest pain
  • reduced appetite

Additionally, viruses and bacteria, like Streptococcus pneumoniae or Haemophilus influenzae, often cause pneumonia. However, in walking pneumonia, bacteria like Mycoplasma pneumoniae, Chlamydophilia pneumoniae, and Legionella pneumoniae cause the condition.

Despite being milder, walking pneumonia may require a longer recovery period than pneumonia.

Several different types of infectious agents can cause pneumonia. Viruses are just one of them. The others include bacteria and fungi.

Some examples of viral infections that can cause pneumonia include:

Although the symptoms of viral and bacterial pneumonia are very similar, cases of viral pneumonia are often milder than those of bacterial pneumonia. According to the NIH, people with viral pneumonia are at risk for developing bacterial pneumonia.

One big difference between viral and bacterial pneumonia is treatment. Viral infections don’t respond to antibiotics. Many cases of viral pneumonia may be treated with at-home care, although antivirals may sometimes be prescribed.

Pneumonia and bronchitis are two different conditions. Pneumonia is an inflammation of the air sacs in your lungs. Bronchitis is the inflammation of your bronchial tubes. These are the tubes that lead from your windpipe into your lungs.

Infections cause both pneumonia and acute bronchitis. Additionally, persistent or chronic bronchitis can develop from inhaling pollutants, like cigarette smoke.

A viral or bacterial infection can lead to a bout of acute bronchitis. If the condition remains untreated, it can develop into pneumonia. Sometimes it’s hard to tell if this has happened. The symptoms of bronchitis and pneumonia are very similar.

If you have bronchitis, it’s important to get it treated to prevent developing pneumonia.

Pneumonia can be a rather common childhood condition. Researchers estimate there are 120 million cases of pediatric pneumonia worldwide each year.

The causes of childhood pneumonia can vary by age. For example, pneumonia due to respiratory viruses, Streptococcus pneumoniae, and Haemophilus influenzae is more common in children under 5 years old.

Pneumonia due to Mycoplasma pneumoniae is frequently observed in children between the ages of 5 and 13. Mycoplasma pneumoniae is one of the causes of walking pneumonia. It’s a milder form of pneumonia.

See your pediatrician if you notice your child:

  • is having trouble breathing
  • lacks energy
  • has changes in appetite

Pneumonia can become dangerous quickly, particularly in young children. Here’s how to avoid complications.

Although home remedies don’t actually treat pneumonia, there are some things you can do to help ease symptoms.

Coughing is one of the most common symptoms of pneumonia. Natural ways to relieve a cough include gargling salt water or drinking peppermint tea.

Things like OTC pain medication and cool compresses can work to relieve a fever. Drinking warm water or having a nice warm bowl of soup can help with chills. Here are six more home remedies to try.

Although home remedies can help ease symptoms, it’s important to stick to your treatment plan. Take any prescribed medications as directed.

Most people respond to treatment and recover from pneumonia. Like your treatment, your recovery time will depend on the type of pneumonia you have, how severe it is, and your general health.

A younger person may feel back to normal in a week after treatment. Others may take longer to recover and may have lingering fatigue. If your symptoms are severe, your recovery may take several weeks.

Consider taking these steps to aid in your recovery and help prevent complications from occurring:

  • Stick to the treatment plan your doctor has developed and take all medications as instructed.
  • Make sure to get plenty of rest to help your body fight the infection.
  • Drink plenty of fluids.
  • Ask your doctor when you should schedule a follow-up appointment. They may want to perform another chest X-ray to make sure your infection has cleared.

Pneumonia may cause complications, especially in people with weakened immune systems or chronic conditions, such as diabetes.

Worsened chronic conditions

If you have certain preexisting health conditions, pneumonia could make them worse. These conditions include congestive heart failure and emphysema. For certain people, pneumonia increases their risk for having a heart attack.


Bacteria from the pneumonia infection may spread to your bloodstream. This can lead to dangerously low blood pressure, septic shock, and in some cases, organ failure.

Lung abscesses

These are cavities in the lungs that contain pus. Antibiotics can treat them. Sometimes they may require drainage or surgery to remove the pus.

Impaired breathing

You may have trouble getting enough oxygen when you breathe. You may need to use a ventilator.

Acute respiratory distress syndrome

This is a severe form of respiratory failure. It’s a medical emergency.

Pleural effusion

If your pneumonia isn’t treated, you may develop fluid around your lungs in your pleura, called pleural effusion. The pleura are thin membranes that line the outside of your lungs and the inside of your rib cage. The fluid may become infected and need to be drained.


In some cases, pneumonia can be fatal. According to the CDC, more than 49,000 people in the United States died from pneumonia in 2017.

A variety of infectious agents cause pneumonia. With proper recognition and treatment, many cases of pneumonia can be cleared without complications.

For bacterial infections, stopping your antibiotics early can cause the infection to not clear completely. This means your pneumonia could come back. Stopping antibiotics early can also contribute to antibiotic resistance. Antibiotic-resistant infections are more difficult to treat.

Viral pneumonia often resolves in one to three weeks with at-home treatment. In some cases, you may need antivirals. Antifungal medications treat fungal pneumonia and may require a longer period of treatment.

Pneumonia may be classified based off the area of the lungs it’s affecting:


Bronchopneumonia can affect areas throughout both of your lungs. It’s often localized close to or around your bronchi. These are the tubes that lead from your windpipe to your lungs.

Lobar pneumonia

Lobar pneumonia affects one or more lobes of your lungs. Each lung is composed of lobes, which are defined sections of the lung.

Lobar pneumonia can be further divided into four stages based off how it’s progressed:

  1. Congestion. Lung tissue appears heavy and congested. Fluid filled with infectious organisms has accumulated in the air sacs.
  2. Red hepatization. Red bloods cells and immune cells have entered into the fluid. This makes the lungs appear red and solid in appearance.
  3. Gray hepatization. The red blood cells have begun to break down while immune cells remain. The breakdown of red blood cells causes a change in color, from red to gray.
  4. Resolution. Immune cells have begun to clear the infection. A productive cough helps eject remaining fluid from the lungs.

Pneumonia that occurs during pregnancy is called maternal pneumonia. Pregnant women are more at risk for developing conditions like pneumonia. This is due to the natural suppression of the immune system that happens when you’re pregnant.

The symptoms of pneumonia don’t differ by trimester. However, you may notice some of them more later on in your pregnancy due to other discomforts you may be encountering.

If you’re pregnant, contact your doctor as soon as you start experiencing symptoms of pneumonia. Maternal pneumonia can lead to a variety of complications, such as premature birth and low birth weight.