How to Diagnose a Lung Infection: Tests and Methods

Lung infections are diagnosed through a combination of physical examination, imaging, and lab tests, with the specific workup depending on how sick you are and whether the infection appears bacterial, viral, or fungal. Most cases start with a chest X-ray and basic blood work, but the process can expand to include specialized cultures, molecular testing, and even a scope inserted into the airways when the cause remains unclear.

What Happens During the Physical Exam

The first step is usually a hands-on assessment. Your doctor will listen to your lungs with a stethoscope, checking for abnormal sounds that signal fluid, inflammation, or blocked airways. The two main categories are continuous sounds (wheezing and a lower-pitched rumbling called rhonchi) and discontinuous sounds (crackling or popping noises). Fine crackles often point to fluid in the tiny air sacs, which is a hallmark of pneumonia. Coarse crackles suggest thicker secretions in the larger airways, more common in bronchitis or bronchiectasis. A low-pitched, hollow breath sound can indicate a lung abscess or a large cavity in the lung tissue.

Your vital signs carry significant diagnostic weight. A combination of fever above 100°F, heart rate above 100 beats per minute, or breathing rate above 20 breaths per minute is 97% sensitive for detecting pneumonia. That means nearly all pneumonia cases will show at least one of these abnormalities. Oxygen saturation matters too. Readings below 92% are associated with significantly higher rates of complications and hospitalization, and levels below 90% roughly triple the risk of serious outcomes within 30 days compared to higher readings.

Chest X-Ray: The Standard First Image

A chest X-ray is the most common imaging test for a suspected lung infection. Doctors look for several key patterns. Consolidation appears as a dense white area where the lung tissue has filled with fluid or pus, obscuring the normal outlines of blood vessels and airway walls. Ground-glass opacity is a hazier increase in whiteness where you can still partially see the underlying vessels. Reticular alterations show up as a web of fine lines across the lung fields. Any of these patterns, combined with your symptoms and exam findings, can confirm a lung infection and help narrow down the type.

A single X-ray doesn’t always tell the full story. If you’re very early in the infection, the X-ray can look normal even when pneumonia is developing. In those cases, or when complications are suspected, a CT scan provides a far more detailed picture. CT is especially useful for spotting smaller areas of infection, abscesses, or fluid collections around the lungs that a standard X-ray might miss.

Blood Tests That Help Identify the Cause

Basic blood work, including a complete blood count, can show whether your white blood cell count is elevated, which signals your body is fighting an infection. But two more specific markers help distinguish bacterial infections from viral ones, which matters because the treatment is completely different.

Procalcitonin is a protein that rises sharply during bacterial infections but stays low during most viral illnesses. Levels below 0.25 ng/mL suggest a bacterial cause is unlikely, while levels above 0.5 ng/mL indicate a bacterial infection with about 94% sensitivity and 88% specificity. C-reactive protein (CRP) is another inflammation marker, though it’s less precise. At a cutoff of 8 mg/L, CRP identifies bacterial infections with roughly 85% sensitivity and 77% specificity. Procalcitonin is generally the more reliable of the two for guiding whether antibiotics are truly needed.

Sputum Cultures and Sample Quality

If you’re coughing up mucus, your doctor may ask you to produce a sputum sample for culture. This involves coughing deeply into a sterile container so the lab can try to grow and identify the specific bacteria causing your infection. The catch is that not every cough produces material from deep enough in the lungs. Sputum that mostly contains saliva and cells from the mouth is useless for diagnosis.

Labs evaluate sample quality under a microscope before they even attempt a culture. A good specimen has a high ratio of white blood cells (infection-fighting cells) to epithelial cells (skin-like cells from the mouth and throat). Samples with more than 25 epithelial cells per microscopic field are generally rejected because they’re contaminated with mouth bacteria that have nothing to do with the lung infection. Samples with more than 25 white blood cells per field are considered acceptable, as they represent material from the actual site of infection. This quality check prevents misleading results that could lead to the wrong treatment.

Molecular Testing for Faster Answers

Traditional cultures can take two to three days to grow results. Molecular panels using PCR technology offer a much faster alternative, often returning results within hours. These panels work by detecting genetic material from specific organisms rather than waiting for them to grow in a dish.

Modern respiratory PCR panels can simultaneously test for 18 bacterial species, 8 viruses, and even 7 markers of antibiotic resistance in a single run. The bacterial targets include common pneumonia causes like Streptococcus pneumoniae, Haemophilus influenzae, and Legionella, as well as harder-to-culture organisms like Mycoplasma and Chlamydia pneumoniae. On the viral side, the panels detect influenza A and B, respiratory syncytial virus (RSV), adenovirus, coronavirus, and several others. These panels don’t replace traditional cultures entirely, since cultures still provide information about which antibiotics will work best, but they give clinicians a critical head start.

Diagnosing Fungal Lung Infections

Fungal lung infections are less common but pose a serious threat to people with weakened immune systems, such as those undergoing chemotherapy, organ transplant recipients, or people living with HIV. Standard bacterial cultures won’t catch these, so specialized blood tests are needed.

Two key biomarkers target components of fungal cell walls. Beta-D-glucan is a broad screening test that detects a structural molecule found in most fungi, including Aspergillus, Candida, Histoplasma, and Pneumocystis. A blood level above 80 pg/mL is considered significant, since healthy people normally carry only 10 to 40 pg/mL. The limitation is that this test can’t tell you which fungus is responsible. For that, the galactomannan assay is more targeted. It detects a surface antigen specific to Aspergillus, making it highly useful when invasive aspergillosis is suspected. Using both tests together provides the best accuracy: beta-D-glucan catches more cases overall, while galactomannan confirms the specific culprit.

When a Bronchoscopy Is Needed

Most lung infections are diagnosed without invasive procedures. But when a cough won’t resolve, imaging shows something unusual, or initial tests fail to identify the pathogen, a bronchoscopy may be the next step. This is especially common in immunocompromised patients who are vulnerable to unusual infections that don’t show up on standard tests.

During a bronchoscopy, a thin, flexible tube with a camera is guided through your nose or mouth and down into the airways. The doctor can visually inspect the bronchial tubes and perform a bronchoalveolar lavage (BAL), which involves squirting a small amount of sterile fluid into a section of the lung and then suctioning it back out. That fluid carries cells and microorganisms from deep in the lung tissue, giving the lab a much cleaner and more representative sample than anything you could cough up on your own. The procedure is done under sedation and typically takes 30 to 60 minutes. It’s particularly valuable for diagnosing infections in people with HIV, organ transplants, or other conditions that make them susceptible to rare pathogens that are difficult to detect any other way.

Putting It All Together

No single test diagnoses a lung infection on its own. The process works in layers. Vital signs and a physical exam determine how urgently you need further testing. A chest X-ray confirms whether infection is present and roughly where it is. Blood markers like procalcitonin help sort bacterial from viral causes. Sputum cultures or PCR panels identify the specific organism. And in complex or non-resolving cases, bronchoscopy provides the deepest look. The goal at each step is to narrow down the cause quickly enough to start the right treatment, since the difference between a viral infection that resolves on its own and a bacterial pneumonia that needs antibiotics is one that testing can reliably make.