Medically Reviewed by Expert Board

This page was fact checked by our expert Medical Review Board for accuracy and objectivity. Read more about our editorial policy and review process.

.
This article was last modified on

What Is Pneumonia?

Pneumonia is an infection in the lungs that can be caused by pathogens like bacteria, viruses, fungi, and parasites. Pneumonia can develop when the immune system doesn’t work properly or is overwhelmed by a pathogen. When this occurs, the lungs become inflamed, which can trigger a range of symptoms.

Symptoms of pneumonia vary but often include coughing, mucus production, fever, chills, and shortness of breath. Many cases of pneumonia are mild, but some people develop more severe pneumonia that can lead to serious lung damage and other life-threatening complications.

Pneumonia is more likely to pose serious health risks when it occurs in children, older adults, and people with weakened immune systems or other health problems. Because pneumonia has many potential causes and can be more severe in people with coexisting health conditions, it is one of the leading causes of death worldwide.

What are the types of pneumonia?

There are many different types of pneumonia that are generally categorized based on where an infection was acquired and the underlying cause of the infection. Some common categories of pneumonia include:

  • Community-acquired pneumonia: When pneumonia occurs in people who have not recently been in the hospital, it is classified as community-acquired pneumonia. This includes “walking pneumonia,” which is a nonmedical term that refers to pneumonia with mild symptoms.
  • Hospital-acquired pneumonia: This type of pneumonia develops as a result of an infection contracted while a person is in a hospital.
  • Ventilator-associated pneumonia: A ventilator is a device that uses a breathing tube to help people who are not able to breathe on their own. When people contract pneumonia as a result of using a ventilator, it is called ventilator-associated pneumonia.
  • Pneumocystis pneumonia: This type of pneumonia is caused by a fungal infection and is most common in people who have a weakened immune system.
  • Aspiration pneumonia: Aspiration pneumonia can occur when food, saliva, vomit, or another substance manages to enter the lungs. These substances can carry infectious pathogens or inflame or block the lungs and cause a pneumonia infection.

Recognizing the category of pneumonia can help doctors more quickly identify the specific germ causing the infection and initiate the treatment that is most likely to be effective.

The Role of Pneumonia Tests

Pneumonia tests may be performed for one or more of the following reasons:

  • Diagnosis: Many pneumonia tests are conducted in order to determine whether a person has pneumonia. Some symptoms of pneumonia also commonly occur with a cold or flu, so diagnostic testing can be important to identify the actual cause of those symptoms. Testing to rule out pneumonia is a part of diagnosing many other kinds of respiratory conditions.
  • Assessing disease severity: After pneumonia has been identified, testing can reveal its severity and whether it affects one or both lungs. Tests can also check for complications of pneumonia that can pose significant health risks.
  • Identifying the cause of pneumonia: There are multiple possible causes of pneumonia, and tests may be used to help find the bacteria, virus, fungus, or other pathogens that caused the infection. When possible, determining what pathogen is causing the infection can enable more tailored and effective treatment.
  • Monitoring: Continued testing after a diagnosis of pneumonia allows doctors to see whether treatment is working and whether a person’s condition is improving. Monitoring tests may lead to adjustments to the treatment plan or modifications to the initial pneumonia diagnosis.

The goal of any pneumonia test can depend on many factors including the type of pneumonia a person has along with their age, overall health, and symptom severity. A doctor is in the best position to explain the purpose of a particular pneumonia test in any individual patient’s case.

Who should get testing?

Testing is most often performed if you have symptoms that could be caused by pneumonia. This testing can help diagnose or rule out pneumonia as a cause of those symptoms.

The decision to order a pneumonia test is determined by a doctor based on your specific situation. You should talk to a doctor or nurse if:

  • You have a cough that is persistent or worsening
  • You have difficulty breathing or shortness of breath
  • You experience chest pain when breathing
  • You have recovered from a cold or flu and then quickly found that your symptoms worsened

It is especially important to see a doctor about these symptoms if you have risk factors for developing more complicated pneumonia. Make sure to reach out to a health care professional if you are over 65 years old, have a preexisting lung condition, and/or have a compromised immune system.

If you have already been diagnosed with pneumonia, you may have additional testing to learn more about the cause and severity of your condition. Follow-up testing can also be used to observe how well treatment is working.

Getting test results

The timeline for receiving pneumonia test results depends on the situation. In some cases, results from initial testing may be available within a few hours to a few days. However, getting the details about test results may take longer when a greater number of pneumonia tests are required.

In many situations, the doctor may be able to quickly determine whether you have pneumonia based on your symptoms and imaging tests that look at your lungs. Additional tests may be needed to assess the cause, severity, and optimal treatment.

Because there are many types of pneumonia that can affect people in different ways, it is important to always review your test results with a doctor who can most clearly explain what they mean in your situation.

Types of Pneumonia Tests

Various types of pneumonia tests may be performed based on a patient’s symptoms and overall health. In most cases, initial testing for pneumonia involves a physical examination, medical history review, and a chest x-ray. These steps often allow for an initial diagnosis to be made.

Recommendations for further testing are tailored to a patient’s situation. In general, patients who have more severe symptoms, may require hospitalization, or who are at higher risk of complications are more likely to undergo additional pneumonia testing.

The following sections provide details about the different types of tests that may be involved in the diagnosis and evaluation of pneumonia.

Medical history review and physical exam

Pneumonia testing usually begins with an initial examination by a doctor that includes both a review of your medical history and a physical exam. This process helps the doctor understand your situation, check for signs of pneumonia, and look for the possible complications of an infection.

A medical history review includes a discussion of your current symptoms as well as your overall health and medical history. The doctor will usually ask about how long you have had symptoms and may ask questions about your medications, vaccinations, if you have been around other people who are sick, if you smoke cigarettes, or if you have other health issues that may affect your risk for pneumonia.

A physical exam for pneumonia typically includes using a stethoscope to listen to your lungs. A health care provider may tap on your chest and ask you to take several breaths while they listen. During this exam, the doctor is checking to see if they hear certain sounds that are associated with pneumonia.

Most of the time, additional tests are needed after this clinical evaluation. In some situations, a medical history review and physical exam may be sufficient to diagnose mild cases of pneumonia.

Chest imaging tests

If your medical history review and physical exam suggest pneumonia, the doctor will normally suggest an imaging test to look more closely at your lungs.

A chest x-ray is the typical imaging test used to diagnose pneumonia. This testing can show the presence of a pneumonia infection in the lungs.

Although less often used in pneumonia testing, a computed tomography (CT) scan of the chest may be considered in select situations. A CT scan provides more detailed images and are usually used when the initial chest x-ray has unexpected results, if symptoms are abnormal, or if symptoms may be explained by another lung condition.

In some hospitals and medical offices, an ultrasound of the lung may be used to help diagnose pneumonia. This method of imaging is not as common, but it may be most useful when it is otherwise difficult to perform a chest x-ray or CT scan.

Tests to assess overall health

Because pneumonia can trigger a range of potential complications, it is common for tests that assess your overall health to be included as part of pneumonia testing. Examples of these tests include:

  • Complete blood count (CBC) with differential: This test measures the amount of each type of blood cell in a blood sample taken from a vein in your arm. In addition to providing insight about overall health, a CBC can show if there is an elevated level of white blood cells, which is associated with some infections.
  • Basic metabolic panel (BMP): This is another routine blood test that assesses kidney function, electrolytes, and blood sugar levels.

Tests to assess lung function

Pneumonia directly affects the lungs, so the doctor may recommend one or more pulmonary function tests to check how well your lungs are working to provide oxygen to your body.

One type of pulmonary function test is pulse oximetry, which checks whether there is enough oxygen in your blood. The test uses a sensor clipped to your ear or finger that estimates your blood oxygen levels.

Another way of evaluating your blood oxygen levels is with an arterial blood gases test. This test uses a sample of blood taken from an artery and measures the amount of oxygen, blood pH, and carbon dioxide.

Tests to find the cause of pneumonia

Pneumonia testing may include a range of tests to identify why pneumonia occurred. There are many potential causes of pneumonia including an infection with a bacteria, virus, or fungus. When the cause is known, the doctor can choose a tailored therapy that offers the most benefit and least risk.

This kind of testing is not routinely performed in patients with mild cases of pneumonia. Trying to identify the cause is of greater importance when a patient is hospitalized or at higher risk of severe complications from pneumonia.

Although many tests are available to look for the underlying cause, in the majority of cases, no single cause can be conclusively identified.

The following sections describe different types of tests that may be used to detect the cause of pneumonia. Each section is organized based on the type of sample that is used for testing.

Sputum tests

Sputum is a thick kind of mucus produced in the lungs that is also known as phlegm. It is distinct from saliva or spit because its thickness helps it trap and remove pathogens from the lungs. For this reason, sputum can be analyzed to check for signs of bacteria, viruses, or other pathogens.

There are three main ways that a sputum sample can be obtained. The least invasive way of collecting sputum is by coughing deeply so that sputum can be spit into a cup. Before this, you may inhale a vapor that makes it easier to produce a testable amount of sputum.

When this method fails to produce sufficient sputum, other procedures may be necessary:

  • Bronchoscopy: This is a procedure that inserts a flexible scope with a camera into the lungs. This allows the doctor to look more closely at the inside of the lungs. During the test, a small brush may collect a sputum sample, or a saline solution can be used to wash a sample of sputum out so that it can be analyzed. This procedure is known as bronchoalveolar lavage.
  • Lung biopsy: This is a surgery that involves removing a sample of tissue from the lung. A lung biopsy is rarely necessary for pneumonia and is generally reserved for special cases and less common types of pneumonia.

Once a sputum sample has been collected, there are a number of different ways that it may be analyzed:

  • Culture: In a sputum culture test, the lab places sputum in a special dish for a few days to see if bacteria or other infectious germs grow. If they do, the lab may be able to identify the specific bacteria or other pathogen that caused pneumonia.
  • Gram stain: A Gram stain involves applying a purple-colored substance, known as the Gram stain, to the sample. Depending on how the sample changes color, it can indicate the type of infection present. A sputum gram stain may be repeated multiple times over several days, and it can be combined with a sputum culture test.
  • Fungal smear: A fungal smear looks for presence of a fungal infection by examining a sputum sample under a microscope.
  • Polymerase chain reaction (PCR): PCR is a type of molecular test that uses special laboratory techniques to check for the presence of the genetic material of a pathogen in a sputum sample. These tests can look for one or more kinds of bacteria or viruses.
  • Direct fluorescent antibody (DFA): A sputum DFA test requires adding a fluorescent dye to a sputum sample that is then looked at under a special microscope. When certain infections are present, the sample will appear to glow.

Throat or nasal swab tests

Some tests use a swab of the throat, nostrils, or the area at the back of the nose to look for viruses that can cause respiratory symptoms and pneumonia.

Most people with pneumonia are tested for influenza and, during the global COVID-19 pandemic, the SARS-CoV-2 virus that causes COVID-19. Depending on a patient’s symptom severity and risk factors, swab tests may be used to look for other respiratory viruses.

Blood tests

Blood tests can be used to try to determine the cause of pneumonia.

Blood culture tests involve using a blood sample to try to grow bacteria in a lab. The test usually takes a few days to see if any bacteria grow, at which point they can be identified and targeted for treatment. Blood cultures can also detect possible complications such as an infection that has entered the bloodstream.

Another type of blood test that may be prescribed is a beta-D-glucan test. Beta-D-glucan is part of the cell walls of fungi, so this test can help detect a fungal infection that may have caused pneumonia.

Sometimes pneumonia testing may include blood tests that look for procalcitonin or C-reactive protein (CRP). These are substances in the blood that are associated with inflammation. These tests may be used to help distinguish between causes of inflammation and to assess a patient’s response to treatment.

Urine tests

A urine sample can be analyzed for the presence of two bacteria that can cause pneumonia, Streptococcus pneumoniae and Legionella pneumophila. These tests work by looking for antigens, which are substances found on the surface of the bacteria that trigger an immune response.

Pleural fluid tests

Sometimes pneumonia can be tied to the buildup of liquid in the pleura, which is the area between the wall of the chest and the lining on the outside of the lungs.

In a procedure called thoracentesis, a sample of this fluid can be removed by inserting a needle through the chest wall and into the pleural space. In a pleural fluid test, this sample can be analyzed under a microscope or used to try to culture bacteria in the laboratory in order to look for an underlying infection causing pneumonia.

Getting Tested for Pneumonia

Pneumonia tests are ordered by a doctor and normally performed in a medical setting like a hospital or doctor’s office. Depending on the type of test, other medical specialists, such as a pulmonologist who focuses on lung conditions, may be a part of your health care team.

If you have symptoms of pneumonia or have recently been diagnosed with pneumonia, you should talk with your doctor about the most appropriate testing and where it can be performed.

At-home testing

Pneumonia testing is generally not available at home. Some types of tests, such as imaging tests, require special equipment that is only available in a medical setting.

In addition, many types of pneumonia tests are performed when patients need to be in the hospital because of their symptoms or the risk of complications. Pneumonia tests also require careful interpretation to determine the optimal care for any specific patient.

Sources

A.D.A.M. Medical Encyclopedia. Breath sounds. Updated May 6, 2019. Accessed October 6, 2021. https://medlineplus.gov/ency/article/007535.htm

A.D.A.M. Medical Encyclopedia. Routine sputum culture. Updated September 29, 2019. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003723.htm

A.D.A.M. Medical Encyclopedia. Learning about ventilators. Updated October 14, 2019. Accessed October 7, 2021. https://medlineplus.gov/ency/patientinstructions/000458.htm

A.D.A.M. Medical Encyclopedia. Pleural fluid analysis. Updated October 14, 2019. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003624.htm

A.D.A.M. Medical Encyclopedia. Pleural fluid culture. Updated November 9, 2019. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003725.htm

A.D.A.M. Medical Encyclopedia. Sputum fungal smear. Updated November 9, 2019. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003736.htm

A.D.A.M. Medical Encyclopedia. Bronchoscopy. Updated January 1, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003857.htm

A.D.A.M. Medical Encyclopedia. Gram stain. Updated April 9, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/007621.htm

A.D.A.M. Medical Encyclopedia. Sputum direct fluorescent antibody (DFA) test. Updated May 27, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003553.htm

A.D.A.M. Medical Encyclopedia. Chest CT. Updated August 3, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003788.htm

A.D.A.M. Medical Encyclopedia. Chest x-ray. Updated August 3, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003804.htm

A.D.A.M. Medical Encyclopedia. Community-acquired pneumonia in adults. Updated August 3, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/000145.htm

A.D.A.M. Medical Encyclopedia. Thoracentesis. Updated August 3, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003420.htm

A.D.A.M. Medical Encyclopedia. Pneumonia in children – community acquired. Updated October 25, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/007690.htm

A.D.A.M. Medical Encyclopedia. Sputum gram stain. Updated December 24, 2020. Accessed October 6, 2021. https://medlineplus.gov/ency/article/003765.htm

Barson WJ. Community-acquired pneumonia in children: Clinical features and diagnosis. In: Kaplan SL, Mallory GB, eds. UpToDate. Updated July 2, 2021. Accessed October 6, 2021. https://www.uptodate.com/contents/community-acquired-pneumonia-in-children-clinical-features-and-diagnosis

Boruchoff SE, Weinstein MP. Sputum cultures for the evaluation of bacterial pneumonia. In: Ramirez JA, ed. UpToDate. Updated September 30, 2021. Accessed October 6, 2021. https://www.uptodate.com/contents/sputum-cultures-for-the-evaluation-of-bacterial-pneumonia

File Jr. TM. Patient education: Pneumonia in adults (beyond the basics). In: Ramirez JA, ed. UpToDate. Updated September 21, 2020. Accessed October 6, 2021. https://www.uptodate.com/contents/pneumonia-in-adults-beyond-the-basics

Fishman JA. Approach to the immunocompromised patient with fever and pulmonary infiltrates. In: Blumberg EA, ed. UpToDate. Updated August 29, 2021. Accessed October 6, 2021. https://www.uptodate.com/contents/approach-to-the-immunocompromised-patient-with-fever-and-pulmonary-infiltrates

Flaherty KR. Causes, clinical manifestations, evaluation, and diagnosis of nonspecific interstitial pneumonia. In: King Jr. TE, ed. UpToDate. Updated July 15, 2021. Accessed October 6, 2021. https://www.uptodate.com/contents/causes-clinical-manifestations-evaluation-and-diagnosis-of-nonspecific-interstitial-pneumonia

Klompas M. Clinical evaluation and diagnostic testing for community-acquired pneumonia in adults. Updated June 14, 2021. Accessed October 6, 2021. https://www.uptodate.com/contents/clinical-evaluation-and-diagnostic-testing-for-community-acquired-pneumonia-in-adults

Klompas M. Aspiration pneumonia in adults. In: Sexton DJ, ed. UpToDate. Updated July 26, 2021. Accessed October 6, 2021. https://www.uptodate.com/contents/aspiration-pneumonia-in-adults

Klompas M. Epidemiology, pathogenesis, microbiology, and diagnosis of hospital-acquired and ventilator-associated pneumonia in adults. In: File Jr. TM, ed. UpToDate. Updated September 10, 2021. Accessed October 6, 2021. https://www.uptodate.com/contents/epidemiology-pathogenesis-microbiology-and-diagnosis-of-hospital-acquired-and-ventilator-associated-pneumonia-in-adults

Kollef MH. Clinical presentation and diagnostic evaluation of ventilator-associated pneumonia. In: Manaker S, ed. UpToDate. Updated September 22, 2021. Accessed October 6, 2021.  https://www.uptodate.com/contents/clinical-presentation-and-diagnostic-evaluation-of-ventilator-associated-pneumonia

MedlinePlus: National Library of Medicine. Gram stain. Updated August 13, 2020. Accessed October 6, 2021. https://medlineplus.gov/lab-tests/gram-stain/

MedlinePlus: National Library of Medicine. Bronchoscopy and bronchoalveolar lavage (BAL). Updated September 29, 2020. Accessed October 6, 2021. https://medlineplus.gov/lab-tests/bronchoscopy-and-bronchoalveolar-lavage-bal/

MedlinePlus: National Library of Medicine. Pneumonia. Updated September 15, 2021. Accessed October 5, 2021. https://medlineplus.gov/pneumonia.html

MedlinePlus: National Library of Medicine. Sputum culture. Updated September 16, 2021. Accessed October 6, 2021. https://medlineplus.gov/lab-tests/sputum-culture/

National Heart, Lung, and Blood Institute. Pneumonia. Date unknown. Accessed October 6, 2021. https://www.nhlbi.nih.gov/health/pneumonia

Ramirez JA. Overview of community-acquired pneumonia in adults. In: File TM Jr., ed. UpToDate. Updated September 7, 2021. Accessed October 7, 2021. https://www.uptodate.com/contents/overview-of-community-acquired-pneumonia-in-adults

Rhee C, Mansour MK. Procalcitonin use in lower respiratory tract infections. In: Ramirez JA, File Jr, TM, eds. UpToDate. Updated April 19, 2021. Accessed October 6, 2021.

https://www.uptodate.com/contents/procalcitonin-use-in-lower-respiratory-tract-infections

Sethi S. Overview of pneumonia. Merck Manual Consumer Edition. Updated December 2020. Accessed October 6, 2021. https://www.msdmanuals.com/home/lung-and-airway-disorders/pneumonia/overview-of-pneumonia

Sethi S. Overview of pneumonia. Merck Manuals Professional Edition. Updated December 2020. Accessed October 6, 2021.  https://www.msdmanuals.com/professional/pulmonary-disorders/pneumonia/overview-of-pneumonia

Thomas Jr. CF, Limper AH. Epidemiology, clinical manifestations, and diagnosis of Pneumocystis pneumonia in HIV-uninfected patients. In: Marr KA, ed. UpToDate. Updated January 21, 2020. Accessed October 6, 2021. https://www.uptodate.com/contents/epidemiology-clinical-manifestations-and-diagnosis-of-pneumocystis-pneumonia-in-hiv-uninfected-patients

UpToDate. Patient education: Aspiration pneumonia (the basics). Date unknown. Accessed October 6, 2021. https://www.uptodate.com/contents/aspiration-pneumonia-the-basics

UpToDate. Patient education: Pneumocystis pneumonia (the basics). Date unknown. Accessed October 6, 2021. https://www.uptodate.com/contents/pneumocystis-pneumonia-the-basics

UpToDate. Patient education: Pneumonia in adults (the basics). Date unknown. Accessed October 6, 2021. https://www.uptodate.com/contents/pneumonia-in-adults-the-basics