Skip to main content

to schedule an appointment

What is Pneumonia?

U.S. News & World Report Badge Emblem for High Performing Hospitals in Pneumonia Care 2023-2024

Pneumonia is a bacterial, viral, or fungal infection of one or both sides of the lungs that causes the air sacs, or alveoli, of the lungs to fill up with fluid or pus. Symptoms can be mild or severe and may include a cough with phlegm (a slimy substance), fever, chills, and trouble breathing. Many factors affect how serious pneumonia is, such as the type of germ causing the lung infection, your age, and your overall health. Pneumonia tends to be more serious for children under the age of five, adults over the age of 65, people with certain conditions such as heart failure, diabetes, or COPD (chronic obstructive pulmonary disease), or people who have weak immune systems due to HIV/AIDS, chemotherapy (a treatment for cancer), or organ or blood and marrow stem cell transplant procedures.

To diagnose pneumonia, your doctor will review your medical history, perform a physical exam, and order diagnostic tests. This information can help your doctor determine what type of pneumonia you have. If your doctor suspects you got your infection while in a hospital, you may be diagnosed with hospital-acquired pneumonia. If you have been on a ventilator to help you breathe, you may have ventilator-associated pneumonia. The most common form of pneumonia is community-acquired pneumonia, which is when you get an infection outside of a hospital.

Treatment depends on whether bacteria, viruses, or fungi are causing your pneumonia. If bacteria are causing your pneumonia, you usually are treated at home with oral antibiotics. Most people respond quickly to treatment. If your symptoms worsen you should see a doctor right away. If you have severe symptoms or underlying health problems, you may need to be treated in a hospital. It may take several weeks to recover from pneumonia.

Explore this Health Topic to learn more about pneumonia, our role in research and clinical trials to improve health, and where to find more information.

Find A Pneumonia Doctor


Bacteria, viruses, and fungi infections can cause pneumonia. These infections cause inflammation in the air sacs, or alveoli, of the lungs. This inflammation causes the air sacs to fill with fluid and pus.


Bacteria are the most common cause of pneumonia in adults. Many types of bacteria can cause bacterial pneumonia. Streptococcus pneumoniae or pneumococcus bacteria are the most common cause of bacterial pneumonia in the United States.

If your pneumonia is caused by one of the following types of bacteria, it is called atypical pneumonia.

  • Legionella pneumophila. This type of pneumonia sometimes is called Legionnaire's disease, and it has caused serious outbreaks. Outbreaks have been linked to exposure to cooling towers, whirlpool spas, and decorative fountains.
  • Mycoplasma pneumoniae. This is a common type of pneumonia that usually affects people younger than 40 years old. People who live or work in crowded places like schools, homeless shelters, and prisons are at higher risk for this type of pneumonia. It's usually mild and responds well to treatment with antibiotics. However, Mycoplasma pneumoniae can be very serious. It may be associated with a skin rash and hemolysis. This type of bacteria is a common cause of “walking pneumonia”.
  • Chlamydia pneumoniae. This type of pneumonia can occur all year and often is mild. The infection is most common in people 65 to 79 years old.

Bacterial pneumonia can occur on its own or develop after you've had a viral cold or the flu. Bacterial pneumonia often affects just one lobe, or area, of a lung. When this happens, the condition is called lobar pneumonia.

Read more

Most of the time, the body filters bacteria out of the air that we breathe to protect the lungs from infection. Your immune system, the shape of your nose and throat, your ability to cough, and fine, hair-like structures called cilia help stop the germs from reaching your lungs. Read How the Lungs Work for more information.

Sometimes bacteria manage to enter the lungs and cause infections. This is more likely to occur if:

  • Your immune system is weak
  • A germ is very strong
  • Your body fails to filter out the bacteria from the air that you breathe. For example, if you can't cough because you've had a stroke or are sedated, bacteria may remain in your airways.

When bacteria reach your lungs, your immune system goes into action. It sends many kinds of cells to attack the bacteria. These cells cause inflammation in alveoli (air sacs) and can cause these spaces to fill up with fluid and pus. This causes the symptoms of pneumonia.


Viruses that infect the respiratory tract may cause pneumonia. The influenza or flu virus is the most common cause of viral pneumonia in adults. Respiratory syncytial virus (RSV) is the most common cause of viral pneumonia in children younger than one year old. Other viruses can cause pneumonia such as the common cold virus known as rhinovirus, human parainfluenza virus (HPIV), and human metapneumovirus (HMPV).

Most cases of viral pneumonia are mild. They get better in about one to three weeks without treatment. Some cases are more serious and may require treatment in a hospital. If you have viral pneumonia, you run the risk of getting bacterial pneumonia.


Pneumocystis pneumonia is a serious fungal infection caused by Pneumocystis jirovecii. It occurs in people who have weak immune systems due to HIV/AIDS or the long-term use of medicines that suppress their immune systems, such as those used to treat cancer or as part of organ or blood and marrow stem cell transplant procedures.

Other fungal infections also can lead to pneumonia. The following are three fungi that occur in the soil in some parts of the United States and can cause some people to get pneumonia.

  • Coccidioidomycosis. This fungus is found in Southern California and the desert Southwest. It is the cause of valley fever.
  • Histoplasmosis. This fungus is found in the Ohio and Mississippi River Valleys.
  • Cryptococcus. This fungus is found throughout the United States in bird droppings and soil contaminated with bird droppings.

Risk Factors

Many factors such as age, smoking, and other medical conditions can increase your chances of getting pneumonia and having more severe pneumonia.


Pneumonia can affect people of all ages. However, two age groups are at greater risk of developing pneumonia and having more severe pneumonia:

  • Infants who are two years old or younger because their immune systems are still developing during the first few years of life.
  • People who are 65 years old or older because their immune systems begin to change as a normal part of aging.


Your risk for pneumonia may increase if you have been exposed to certain chemicals, pollutants, or toxic fumes.

Lifestyle habits

Smoking cigarettes, excessive use of alcohol, or being undernourished also increases your risk for pneumonia.

Other medical conditions

Other conditions and factors also increase your risk for pneumonia. Your risk also goes up if you:

  • Have trouble coughing because of a stroke or other condition, or have problems swallowing.
  • Can't move around much or are sedated.
  • Recently had a cold or the flu.
  • Have a lung disease or other serious disease including cystic fibrosis, asthma, COPD (chronic obstructive pulmonary disease), bronchiectasis, diabetes, heart failure, or sickle cell disease.
  • Are in a hospital intensive-care unit, especially if you using a ventilator to help you breathe.
  • Have a weak or suppressed immune system due to HIV/AIDS, organ transplant or blood and marrow stem cell transplant, chemotherapy (a treatment for cancer), or long-term steroid use.

Signs, Symptoms, and Complications

The signs and symptoms of pneumonia vary from mild to severe. But some people are at risk for developing more severe pneumonia or potentially fatal complications.

Signs and Symptoms

See your doctor promptly if you have the following signs and symptoms:

  • Have a high fever
  • Have shaking chills
  • Have a cough with phlegm (a slimy substance), which doesn't improve or worsens
  • Develop shortness of breath with normal daily activities
  • Have chest pain when you breathe or cough
  • Feel suddenly worse after a cold or the flu

If you have pneumonia, you also may have other symptoms, including nausea (feeling sick to the stomach), vomiting, and diarrhea.

Symptoms may vary in certain populations. Newborns and infants may not show any signs of the infection. Or, they may vomit, have a fever and cough, or appear restless, sick, or tired and without energy.

Older adults and people who have serious illnesses or weak immune systems may have fewer and milder symptoms. They may even have a lower than normal temperature. If they already have a lung disease, it may get worse. Older adults who have pneumonia sometimes have sudden changes in mental awareness.


Often, people who have pneumonia can be successfully treated and do not have complications. Possible complications of pneumonia may include:

  • Bacteremia and septic shock. Bacteremia is a serious complication in which bacteria from the initial site of infection spread into the blood. It may lead to septic shock, a potentially fatal complication.
  • Lung abscesses. Lung abscesses usually are treated with antibiotics. Sometimes surgery or drainage with a needle is needed to remove the pus.
  • Pleural effusions, empyema, and pleurisy. These painful or even potentially fatal complications can occur if pneumonia is not treated. The pleura is a membrane that consists of two large, thin layers of tissue. One layer wraps around the outside of your lungs and the other layer lines the inside of your chest cavity. Pleurisy is when the two layers of the pleura become irritated and inflamed, causing sharp pain each time you breathe in. The pleural space is a very thin space between the two pleura. Pleural effusions are the build-up of fluid in the pleural space. If the fluid becomes infected, it is called empyema. If this happens, you may need to have the fluid drained through a chest tube or removed with surgery.
  • Renal failure
  • Respiratory failure


Sometimes pneumonia is hard to diagnose because it may cause symptoms commonly seen in people with colds or the flu. You may not realize it's more serious until it lasts longer than these other conditions. Your doctor will diagnose pneumonia based on your medical history, a physical exam, and test results. Your doctor may be able to diagnose you with a certain type of pneumonia based on how you got your infection and the type of germ causing your infection.

Medical history

Your doctor will ask about your signs and symptoms and how and when they began. To find out whether you have bacterial, viral, or fungal pneumonia, your doctor also may ask about:

  • Any recent traveling you've done
  • Your hobbies
  • Your exposure to animals
  • Your exposure to sick people at home, school, or work
  • Your past and current medical conditions, and whether any have gotten worse recently
  • Any medicines you take
  • Whether you smoke
  • Whether you've had flu or pneumonia vaccinations

Physical exam

Your doctor will listen to your lungs with a stethoscope. If you have pneumonia, your lungs may make crackling, bubbling, and rumbling sounds when you inhale. Your doctor also may hear wheezing. Your doctor may find it hard to hear sounds of breathing in some areas of your chest.

Diagnostic tests

If your doctor thinks you have pneumonia, he or she may recommend one or more of the following tests:

Chest x ray

A chest x-ray to look for inflammation in your lungs. A chest x ray is the best test for diagnosing pneumonia. However, this test won't tell your doctor what kind of germ is causing the pneumonia.

Blood tests

Tests such as a complete blood count (CBC) to see if your immune system is actively fighting an infection.

Blood culture

To find out whether you have a bacterial infection that has spread to your bloodstream. If so, your doctor can decide how to treat the infection.

Your doctor may recommend other tests if you're in the hospital, have serious symptoms, are older, or have other health problems.

Sputum test

Your doctor may collect a sample of sputum (spit) or phlegm (slimy substance from deep in your lungs) that was produced from one of your deep coughs and send the sample to the lab for testing. This may help your doctor find out if bacteria are causing your pneumonia. Then, he or she can plan your treatment.

Chest computed tomography (CT) scan

To see how much of your lungs is affected by your condition or to see if you have complications such as lung abscesses or pleural effusions. A CT scan shows more detail than a chest x ray.

Pleural fluid culture

For this test, a fluid sample is taken from the pleural space (a thin space between two layers of tissue that line the lungs and chest cavity). Doctors use a procedure called thoracentesis to collect the fluid sample. The fluid is studied for bacteria that may cause pneumonia.

Pulse oximetry

For this test, a small sensor is attached to your finger or ear. The sensor uses light to estimate how much oxygen is in your blood. Pneumonia can keep your lungs from moving enough oxygen into your bloodstream. If you're very sick, your doctor may need to measure the level of oxygen in your blood using a blood sample. The sample is taken from an artery, usually in your wrist. This test is called an arterial blood gas test.


This is a procedure used to look inside the lungs' airways. If you're in the hospital and treatment with antibiotics isn't working well, your doctor may use this procedure. Your doctor passes a thin, flexible tube through your nose or mouth, down your throat, and into the airways. The tube has a light and small camera that allow your doctor to see your windpipe and airways and take pictures. Your doctor can see whether something is blocking your airways or whether another factor is contributing to your pneumonia. Your doctor may use this procedure to collect samples of fluid from the site of pneumonia (called bronchoalveolar lavage or BAL) or to take small biopsies of lung tissue to help find the cause of your pneumonia.

Types of pneumonia

Your doctor may also diagnosis you with a certain type of pneumonia. Pneumonia is named for the way in which a person gets the infection or for the germ that causes the infection.

Community-Acquired Pneumonia (CAP)

CAP is the most common type of pneumonia and is usually caused by pneumococcus bacteria. Most cases occur during the winter. CAP occurs outside of hospitals and other health care settings. Most people get CAP by breathing in germs (especially while sleeping) that live in the mouth, nose, or throat.

Hospital-Acquired Pneumonia (HAP)

HAP is when people catch pneumonia during a hospital stay for another illness. HAP tends to be more serious than CAP because you're already sick. Also, hospitals tend to have more germs that are resistant to antibiotics that are used to treat bacterial pneumonia.

Ventilator-associated pneumonia (VAP)

VAP is when people who are on a ventilator machine to help them breathe get pneumonia.

Atypical pneumonia

Atypical pneumonia is a type of CAP. It is caused by lung infections with less common bacteria than the pneumococcus bacteria that cause CAP. Atypical bacteria include Legionella pneumophila, Mycoplasma pneumoniae, or Chlamydia pneumoniae.

Aspiration pneumonia

This type of pneumonia can occur if you inhale food, drink, vomit, or saliva from your mouth into your lungs. This may happen if something disturbs your normal gag reflex, such as a brain injury, swallowing problem, or excessive use of alcohol or drugs. Aspiration pneumonia can cause lung abscesses.


Treatment for pneumonia depends on the type of pneumonia you have, the germ causing your infection, and how severe your pneumonia is. Most people who have community-acquired pneumonia—the most common type of pneumonia—are treated at home. The goals of treatment are to cure the infection and prevent complications.

Bacterial pneumonia

Bacterial pneumonia is treated with medicines called antibiotics. You should take antibiotics as your doctor prescribes. You may start to feel better before you finish the medicine, but you should continue taking it as prescribed. If you stop too soon, the pneumonia may come back.

Most people begin to improve after one to three days of antibiotic treatment. This means that they should feel better and have fewer symptoms such as cough and fever.

Viral pneumonia

Antibiotics don't work when the cause of pneumonia is a virus. If you have viral pneumonia, your doctor may prescribe an antiviral medicine to treat it. Viral pneumonia usually improves in one to three weeks.

Treating severe symptoms

You may need to be treated in a hospital if:

  • Your symptoms are severe
  • You're at risk for complications because of other health problems

If the level of oxygen in your bloodstream is low, you may receive oxygen therapy. If you have bacterial pneumonia, your doctor may give you antibiotics through an intravenous (IV) line inserted into a vein.

General treatment advice and follow-up care

If you have pneumonia, follow your treatment plan, take all medicines as prescribed, and get follow-up medical care. Read Living With to learn more about recovery time for pneumonia, and when and what type of follow-up care you may need.


Pneumonia can be very serious and even life threatening. Vaccines can help prevent certain types of pneumonia. Good hygiene, quitting smoking, and keeping your immune system strong by exercising and healthy eating are other ways to prevent pneumonia.


Vaccines are available to prevent pneumonia caused by pneumococcal bacteria or the flu virus, or influenza. Vaccines can't prevent all cases of infection. However, compared to people who don't get vaccinated, those who are vaccinated and still get pneumonia tend to have:

  • Milder infections
  • Pneumonia that doesn't last as long
  • Fewer serious complications

Pneumococcal pneumonia vaccines

Two vaccines are available to prevent pneumococcal pneumonia and potentially fatal complications such as bacteremia and meningitis. Pneumococcal vaccines are particularly important for:

  • Adults who are 65 years old or older.
  • People who have chronic (ongoing) diseases, serious long-term health problems, or weak immune systems. For example, this may include people who have cancer, HIV/AIDS, asthma, sickle cell disease, or damaged or removed spleens.
  • People who smoke.
  • Children who are younger than five years old.
  • Children older than five years of age with certain medical conditions such as heart or lung diseases or cancer.

The Centers for Disease Control and Prevention (CDC) recommends that adults who are 65 and older should have two pneumococcal vaccinations. Visit the CDC’s Pneumococcal Vaccination for information about pneumococcal pneumonia vaccines for adults.

Influenza (flu) vaccine

Because many people get pneumonia after having influenza or the flu, your yearly flu vaccine can help you and your family not get pneumonia. The flu vaccine is usually given in September through November before the months when influenza or the flu is most frequently spread.

For more information about the influenza or flu vaccine, go to the CDC's Seasonal Influenza (Flu) Vaccination Web page.

Hib vaccine

Haemophilus influenzae type b (Hib) is a type of bacteria that can cause pneumonia and meningitis. The Hib vaccine is given to children to help prevent these infections. The vaccine is recommended for all children in the United States who are younger than five years old. The vaccine often is given to infants starting at two months of age.

For more information about the Hib vaccine, go to the CDC's Hib Vaccination Web page.

Other ways to help prevent pneumonia

You also can take the following steps to help prevent pneumonia:

  • Wash your hands with soap and water or alcohol-based rubs to kill germs.
  • Don't smoke. Smoking damages your lungs' ability to filter out and defend against germs. For information about how to quit smoking, read Smoking and Your Heart. Although this resource focuses on heart health, it includes general information about how to quit smoking.
  • Keep your immune system strong. Get plenty of rest and physical activity and follow a healthy diet. Read more about heart-healthy eating and physical activity.

Living With

If you have pneumonia, you can take steps to recover from the infection and prevent complications.

  • Get plenty of rest.
  • Follow your treatment plan as your doctor advises.
  • Take all medicines as your doctor prescribes. If you're using antibiotics, continue to take the medicine until it's all gone. You may start to feel better before you finish the medicine, but you should continue to take it. If you stop too soon, the bacterial infection and your pneumonia may come back.
  • Ask your doctor when you should schedule follow-up care. Your doctor may recommend a chest X ray to make sure the infection is gone.

It may take time to recover from pneumonia. Some people feel better and are able to return to their normal routines within a week. For other people, it can take a month or more. Most people continue to feel tired for about a month. Talk with your doctor about when you can go back to your normal routine.

If you have pneumonia, limit contact with family and friends. Cover your nose and mouth while coughing or sneezing, get rid of used tissues right away, and wash your hands. These actions help keep the infection from spreading to other people.

Source: National Heart, Lung, and Blood Institute, National Institutes of Health.