Following a physical exam, doctors use specific tests to confirm pneumonia and identify its cause. A chest X-ray is the primary tool to visually confirm the presence and location of lung infection. Blood tests, such as a complete blood count (CBC) and blood cultures, help assess the severity of infection and check if bacteria have entered the bloodstream. To identify the specific organism, a sputum test (culture and Gram stain) analyzes mucus coughed up from the lungs to detect whether bacteria are present and which antibiotics might work. In severe or puzzling cases, advanced tests like a pulse oximetry to measure blood oxygen levels or a CT scan for a more detailed view may be used to guide appropriate treatment.