Pneumonia can be either bacterial or viral, and both types are common. Several dozen different bacteria and viruses can infect the lungs and cause pneumonia, and the type you have determines how it’s treated: bacterial pneumonia requires antibiotics, while viral pneumonia typically does not. In some cases, a viral infection damages the airways enough that bacteria move in and cause a secondary infection on top of the original one.
Common Bacterial Causes
The two most frequent bacterial culprits behind community-acquired pneumonia are Mycoplasma pneumoniae and Streptococcus pneumoniae (pneumococcal disease). Mycoplasma tends to cause a milder form sometimes called “walking pneumonia,” while pneumococcal pneumonia can be severe, particularly in older adults and people with weakened immune systems.
Less common bacterial causes include Legionnaires’ disease (from Legionella bacteria, often linked to contaminated water systems), whooping cough, and infections from Haemophilus influenzae. Pneumonia picked up in a hospital setting is often caused by antibiotic-resistant bacteria like MRSA, which makes it harder to treat and generally more serious than pneumonia acquired at home.
Common Viral Causes
Viruses now account for a large share of pneumonia cases. The most common viral causes include influenza, RSV, COVID-19, human metapneumovirus (HMPV), parainfluenza viruses, and rhinoviruses (the same family behind many common colds). Less frequently, adenovirus, chickenpox, and measles can also lead to pneumonia.
Viral pneumonia is generally milder than bacterial pneumonia and often resolves on its own with rest and supportive care. However, in young children, older adults, and immunocompromised people, viral pneumonia can still become serious enough to require hospitalization.
How Bacterial and Viral Pneumonia Feel Different
There’s no guaranteed way to tell the two apart based on symptoms alone, but some patterns help doctors make an educated guess before test results come back.
Bacterial pneumonia tends to hit fast. You may feel fine one day and very sick the next, with a high fever and thick, discolored mucus (yellow, green, or even bloody). The rapid decline is one of the strongest clues pointing toward a bacterial cause. In one clinical study, acute onset of symptoms was the single most powerful predictor of bacterial pneumonia.
Viral pneumonia typically comes on more gradually. Symptoms build over several days, fevers tend to be lower, and coughs are more often dry. It can feel like a cold or flu that slowly settles deeper into the chest rather than a sudden, dramatic illness. Both types share core symptoms like cough, fatigue, shortness of breath, and chest discomfort, which is why lab work and imaging are often needed to confirm the cause.
What Happens Inside Your Lungs
In a healthy person, the lungs have defenses that trap and clear most germs before they reach the tiny air sacs (alveoli) where oxygen exchange happens. Pneumonia develops when those defenses are overwhelmed. The most common route is microaspiration, where tiny amounts of bacteria-laden saliva from your throat slip into the lungs during sleep. Most of the time your immune system handles this easily, but when it can’t, infection takes hold.
In bacterial pneumonia, the immune system floods the infected area with white blood cells. These cells attack the bacteria but also fill the air sacs with inflammatory fluid and debris. That fluid buildup is what makes breathing difficult and shows up as a white patch on a chest X-ray. In viral pneumonia, the virus damages the lining of the airways, triggering inflammation that can be more diffuse and spread across both lungs rather than concentrating in one area.
One important wrinkle: viral infections can set the stage for bacterial ones. A virus damages the airway lining and suppresses local immune defenses, creating an opening for bacteria to invade. This “secondary bacterial infection” is common enough that up to 44% of patients on ventilators with viral pneumonia develop one. It’s one reason viral pneumonia can become unexpectedly dangerous.
How Doctors Tell the Difference
A chest X-ray is typically the first step. Bacterial pneumonia often appears as a dense white area concentrated in one lobe of the lung, while viral pneumonia may show a more scattered, hazy pattern across both lungs. CT scans can reveal finer detail when the X-ray isn’t clear enough.
Blood tests also help. A very high white blood cell count (above 15,000 per microliter) points toward a bacterial infection. Doctors may also check a blood marker called procalcitonin, which rises in response to bacteria but stays low during most viral infections. A procalcitonin level above 0.25 is generally considered a signal to start antibiotics, while a level below that suggests bacteria are unlikely to be the cause. It’s not a perfect test, with sensitivity and specificity around 70%, but combined with symptoms and imaging, it helps guide treatment decisions.
Severity and Complications
Bacterial pneumonia is generally the more dangerous of the two. It’s more likely to require hospitalization and can lead to complications like lung abscesses (pockets of pus), fluid buildup around the lungs, and sepsis if bacteria enter the bloodstream. Viral pneumonia more often resolves on its own, though severe cases can cause widespread lung inflammation and respiratory failure, particularly in vulnerable populations.
Symptoms that signal a potentially serious case, regardless of type, include a fever above 102°F (38.9°C), difficulty breathing, chest pain, and coughing up yellow, green, or bloody mucus.
Recovery Timeline
Most people with pneumonia start feeling better within one to two weeks, though full recovery often takes a month or longer. Lingering fatigue is the most common complaint. People who were hospitalized or who had bacterial pneumonia tend to have a longer recovery arc. You remain contagious while you have symptoms, so covering coughs, washing hands frequently, and limiting close contact with others during that window helps protect the people around you.
Vaccines That Help Prevent Pneumonia
Vaccines can’t prevent all pneumonia, but they cover several of the most dangerous causes. The CDC recommends pneumococcal vaccines for children under 5 and adults 50 and older. For children, this is a four-dose series given at 2, 4, 6, and 12 to 15 months. Adults 50 and older who have never received a pneumococcal conjugate vaccine should get PCV20 or PCV21, either of which completes the series in a single dose.
Beyond pneumococcal vaccines, annual flu shots and staying current on COVID-19 vaccines reduce the risk of viral pneumonia from two of its most common causes. RSV vaccines are also now available for older adults and for protecting newborns through maternal vaccination. None of these eliminate the risk entirely, but they significantly reduce the chances of severe illness and hospitalization.

