Testing for a lung infection typically starts with a physical exam and chest X-ray, then moves to blood tests, sputum samples, or more advanced imaging depending on what your doctor finds. The specific tests you’ll need depend on how sick you are, how long your symptoms have lasted, and whether your doctor suspects a bacterial, viral, or fungal cause.
The Physical Exam: What Your Doctor Listens For
Before ordering any tests, your doctor will listen to your lungs with a stethoscope. They’re listening for abnormal sounds that healthy lungs don’t make. The two most telling sounds in a lung infection are crackles and rhonchi. Crackles are short, popping sounds that happen when airways clogged with fluid or inflammation snap open during a breath. Rhonchi are low-pitched, snoring-like sounds caused by mucus or secretions partially blocking larger airways.
The type of crackles can even hint at how far along an infection is. In acute pneumonia, crackles tend to be coarse and occur in the middle of a breath in, caused by airways reopening through swelling and inflammatory buildup. As the infection resolves, the lungs dry out and stiffen, and crackles shift to the very end of a breath in and become finer. Your doctor may also check your oxygen levels with a pulse oximeter, a painless clip placed on your fingertip. Normal oxygen saturation runs between 97% and 100%. A reading at or below 94% is a strong signal of a serious lung problem, and a reading below 90% typically means you need supplemental oxygen.
Chest X-Ray: The First-Line Imaging Test
A chest X-ray is almost always the first imaging test ordered when a lung infection is suspected. It’s fast, inexpensive, and widely available. The radiologist looks for white spots in the lungs called infiltrates, which indicate areas of infection, fluid, or inflammation that shouldn’t be there.
That said, chest X-rays aren’t perfect. When compared against CT scans as a benchmark, X-rays detected lung opacities with only about 44% sensitivity, meaning they miss more than half of smaller or early-stage infections. They’re particularly weak at visualizing the lung bases and certain areas behind the heart. Their strength is ruling infections out: a negative X-ray correctly identified patients without opacities about 97% of the time.
A CT scan produces detailed, three-dimensional images and catches infections that X-rays miss, especially small or early ones tucked into hard-to-see areas. But it costs more, involves higher radiation exposure, and takes longer. Doctors typically reserve CT scans for critically ill patients, cases where the X-ray doesn’t match the symptoms, or situations where they need to distinguish a lung infection from something else entirely.
Blood Tests That Help Narrow the Cause
Blood work alone can’t diagnose a lung infection, but it helps your doctor figure out whether you’re dealing with a bacterial or viral cause, which directly affects treatment. Two markers are especially useful.
Procalcitonin is a protein your body produces in much higher amounts during bacterial infections. In studies of hospitalized pneumonia patients, those with common bacterial infections had a median procalcitonin level of 2.5 ng/mL, while those with viral infections had a median of just 0.09 ng/mL. Doctors use specific cutoffs to guide decisions: a level below 0.1 ng/mL strongly suggests antibiotics aren’t needed, while higher levels point toward a bacterial cause. A threshold of 0.1 ng/mL catches roughly 81% of bacterial infections, though it also flags some non-bacterial cases.
C-reactive protein (CRP) is a general inflammation marker. Normal levels are well under 10 mg/L. In lung infections, CRP rises significantly. Research has found that a CRP above about 30 mg/L is a strong indicator of actual lung infiltrates (fluid or infection visible on imaging), with roughly 92% sensitivity. Higher CRP levels, above 50 to 65 mg/L, have been linked to greater risk of the infection worsening.
Sputum Samples and Throat Swabs
If your doctor suspects a bacterial lung infection, you may be asked to cough up a sputum sample. This isn’t just any cough. A useful sample needs to come from deep in the lungs, not from saliva in your mouth. Lab technicians check the quality by looking under a microscope: a good sample has plenty of white blood cells (a sign it came from an infected area) and very few skin cells from the mouth. A sample contaminated with saliva gets rejected because it won’t give reliable results.
The sputum goes through two processes. A Gram stain gives a preliminary look at what type of bacteria might be present within hours. A full culture, where the bacteria are grown, identified, and tested against antibiotics, takes two to three days before results come back. This delay is why doctors often start treatment based on their best clinical judgment before culture results are available.
For viral infections, a nasopharyngeal swab (the long swab inserted deep into the nose) is more common. Rapid antigen tests for flu and COVID-19 give results in about 15 minutes, though they’re less accurate than molecular tests. These rapid tests need to be read at exactly the right time window, between 15 and 20 minutes, to avoid false results.
Molecular Panels for Identifying the Pathogen
When doctors need a more precise answer about which virus or bacterium is causing your infection, they may order a molecular respiratory panel. These tests use PCR technology (the same approach behind lab-grade COVID tests) to scan a single swab for genetic material from multiple pathogens at once. Some panels test for three targets: influenza, SARS-CoV-2, and RSV. Broader panels can screen for 20 or more pathogens, including both viruses and bacteria, in a single run.
These panels are powerful but not always necessary. Most of the time, doctors are really looking for influenza or COVID-19 because those have specific antiviral treatments. A positive result for something like rhinovirus (the common cold) confirms what’s making you sick but doesn’t change treatment, since there’s no targeted therapy for it. Broader panels tend to be reserved for hospitalized patients, people with weakened immune systems, or situations where the infection isn’t responding to initial treatment.
Urine Tests for Specific Bacteria
One of the faster ways to identify certain bacterial lung infections is, surprisingly, a urine test. Urinary antigen tests can detect two of the most important pneumonia-causing bacteria: Streptococcus pneumoniae (the most common cause of bacterial pneumonia) and Legionella pneumophila (the cause of Legionnaires’ disease). Some newer tests can detect both from a single urine sample.
These tests work by picking up proteins shed by the bacteria that end up in your urine. They’re especially valuable because they return results quickly and don’t require you to produce a good sputum sample, which many patients struggle with. The main limitation is that they only detect these specific organisms, so a negative result doesn’t rule out other bacterial causes.
When More Invasive Testing Is Needed
Most lung infections are diagnosed with the tools above. But in certain situations, doctors need to look deeper. Bronchoscopy, a procedure where a thin, flexible camera is guided through the nose or mouth into the airways, is used when standard tests haven’t provided an answer, when the infection isn’t improving with treatment, or in patients with severely weakened immune systems who may have unusual infections.
During a bronchoscopy, the doctor can collect fluid by washing a section of the lung and suctioning it back out. This fluid goes to the lab for the same types of culture and molecular testing described above, but because it comes directly from the infection site, it’s far more likely to identify the responsible pathogen. You’ll typically be sedated for this procedure, and it’s done in a hospital or outpatient surgical setting.
If a lung infection has caused fluid to build up between the lung and chest wall, a procedure called thoracentesis may be needed. A needle is inserted through the back to drain a sample of this fluid. The lab checks the fluid’s pH, protein levels, sugar content, and whether bacteria are present. Fluid with a low pH (below 7.2), low sugar, and high enzyme levels suggests the infection has complicated into something that needs drainage, not just antibiotics. If pus is found in the fluid or bacteria grow from the sample, that’s an empyema, a pocket of infection that requires more aggressive drainage.