The most common cause is a bacterial infection
Bacterial pneumonia is the leading cause of pneumonia overall, and Streptococcus pneumoniae is the bacterium responsible for most cases. When you breathe in air carrying these bacteria, they can settle in your lungs' air sacs (called alveoli) and multiply. Your immune system responds by filling those air sacs with fluid or pus, which is why you cough and have trouble breathing.
Other bacteria that cause pneumonia include Haemophilus influenzae, Legionella pneumophila (which grows in warm water systems), and Mycoplasma pneumoniae (which causes a milder form sometimes called "walking pneumonia"). Bacterial pneumonia tends to come on suddenly and can be serious, which is why doctors often prescribe antibiotics as soon as they suspect it.
Key Takeaways
- Bacteria cause the majority of pneumonia cases, with Streptococcus pneumoniae being the most common culprit.
- Viruses account for a significant portion of pneumonia, especially in children, and antibiotics do not treat viral pneumonia.
- Fungi and other organisms cause pneumonia mainly in people with weakened immune systems.
- The cause matters because it determines whether your doctor prescribes antibiotics, antivirals, or other treatments.
- A chest X-ray and sometimes a sputum culture help doctors identify which organism is causing your pneumonia.
Viral pneumonia is the second most common cause
Viruses cause a substantial share of pneumonia cases, particularly in children under five. Common culprits include respiratory syncytial virus (RSV), influenza (the flu), parainfluenza, and rhinovirus. In recent years, the coronavirus that causes COVID-19 has also become a significant cause of viral pneumonia.
Viral pneumonia often develops after an upper respiratory infection — a cold or sore throat — that spreads down into the lungs. It typically comes on more gradually than bacterial pneumonia and causes a dry cough at first. The key difference for treatment is that antibiotics do not work against viruses, so doctors manage viral pneumonia by supporting your breathing and letting your immune system fight the infection.
Fungi and other organisms cause pneumonia in specific situations
Fungal pneumonia is less common but serious. It occurs mainly in people whose immune systems are weakened — those with HIV/AIDS, people taking immunosuppressant medications after an organ transplant, or those undergoing chemotherapy. Common fungal causes include Pneumocystis jirovecii, Histoplasma, and Coccidioides.
Parasites and other organisms can also cause pneumonia, though this is rare in developed countries. Tuberculosis, caused by the bacterium Mycobacterium tuberculosis, is a special case — it causes a chronic pneumonia that develops slowly over weeks or months rather than days.
How doctors figure out what is causing your pneumonia
When you see a doctor with symptoms of pneumonia, they will listen to your lungs with a stethoscope and often order a chest X-ray to confirm the diagnosis. To identify the specific cause, they may collect a sputum sample (mucus you cough up) and send it to a lab for culture — this grows the organism and shows which antibiotics will kill it.
Blood tests can also help. A complete blood count shows whether your white blood cells are elevated (suggesting bacterial infection), and blood cultures can identify bacteria in your bloodstream. For viral pneumonia, doctors may use a rapid test or PCR test to identify the specific virus. In many cases, especially mild pneumonia, doctors start treatment based on symptoms and chest X-ray findings before lab results come back.
Risk factors that make pneumonia more likely
Certain situations increase your risk of developing pneumonia or of it becoming severe. Smoking damages the lining of your airways and makes it easier for bacteria to take hold. Chronic lung diseases like COPD or asthma narrow your airways and trap secretions. Older age, diabetes, heart disease, and a weakened immune system all raise your risk.
Recent viral infections — especially flu or COVID-19 — can damage your lungs and make them vulnerable to bacterial pneumonia on top of the viral infection. Being bedridden or having difficulty swallowing increases the risk that bacteria from your mouth will enter your lungs. Alcohol use disorder and certain medications that suppress immunity also increase susceptibility.
Why the cause matters for your treatment
Identifying the cause of your pneumonia directly shapes how your doctor treats it. If it is bacterial, antibiotics are the main treatment — and the specific antibiotic depends on which bacterium is causing it. If it is viral, antibiotics will not help, and treatment focuses on rest, fluids, oxygen if needed, and managing fever and cough.
Fungal pneumonia requires antifungal medications, which are different drugs entirely. Tuberculosis requires a long course of multiple antibiotics taken together. This is why doctors do not always wait for lab results before starting treatment — they make an educated guess based on your symptoms, risk factors, and chest X-ray, then adjust the treatment once they know what organism they are fighting.
Frequently Asked Questions
Can you get pneumonia from someone else?
Yes, but it depends on the cause. Bacterial pneumonia is not usually contagious — you catch the bacteria from the environment, not from another person. Viral pneumonia spreads person-to-person through respiratory droplets, so it is contagious. Fungal pneumonia is not contagious between people.
Is pneumonia always caused by an infection?
Most pneumonia is caused by infection, but not all. Chemical pneumonia can result from inhaling toxic fumes or aspirating stomach contents into your lungs. Aspiration pneumonia occurs when food or liquid enters the lungs instead of the stomach, and it often involves bacteria from your mouth. Radiation pneumonia can develop as a side effect of cancer treatment.
Can you have pneumonia without a fever?
Yes. While fever is common with bacterial pneumonia, viral pneumonia often causes only a low fever or no fever at all. Older adults and people with weakened immune systems may have pneumonia without running a fever. Cough, shortness of breath, and fatigue can be present even without fever.
Does the type of pneumonia affect how long it lasts?
Yes. Bacterial pneumonia treated with the right antibiotic usually improves within a few days, though full recovery takes weeks. Viral pneumonia typically lasts one to three weeks. Fungal pneumonia requires longer treatment — sometimes months. Tuberculosis requires treatment for six months or longer.
What is walking pneumonia?
Walking pneumonia is a mild form of bacterial pneumonia caused by Mycoplasma pneumoniae. Symptoms are gradual and often feel like a cold or mild flu — you may feel well enough to go about your day, hence the name. It still requires treatment, and a doctor can confirm it with a chest X-ray and blood tests.