What Is Pneumonia?

Pneumonia is a lung infection that causes inflammation in one or both lungs. The infection can fill the tiny air sacs in the lungs, known as alveoli, with fluid or pus, making it difficult for oxygen to reach the bloodstream. As a result, people with pneumonia may experience coughing, fever, chest pain, and difficulty breathing.
Pneumonia can affect people of all ages, but it is especially serious in young children, older adults, pregnant women, and individuals with weakened immune systems or chronic health conditions. While many cases are mild and recover with proper treatment, severe pneumonia can become life-threatening if left untreated. Understanding its causes, symptoms, and treatment options is essential for protecting lung health.
How the Lungs Work
The lungs are responsible for supplying oxygen to the body and removing carbon dioxide. Inside the lungs are millions of tiny air sacs where oxygen enters the bloodstream.
When pneumonia develops, these air sacs become inflamed and may fill with fluid, reducing the lungs’ ability to exchange oxygen efficiently. This can make breathing difficult and place extra strain on the body.
What Causes Pneumonia?
Pneumonia can be caused by various microorganisms, including bacteria, viruses, and fungi.
Bacterial Pneumonia
Bacterial pneumonia is one of the most common types, particularly in adults. It may develop on its own or after a cold or influenza.
Viral Pneumonia
Viruses that cause colds, influenza, or other respiratory illnesses can also lead to pneumonia. Viral pneumonia is often milder than bacterial pneumonia but may become serious in some individuals.
Fungal Pneumonia
Fungal pneumonia is less common and usually affects people with weakened immune systems or those exposed to certain environmental fungi.
Aspiration Pneumonia
Aspiration pneumonia occurs when food, liquid, saliva or stomach contents are inhaled down the airway and into the lungs instead of being swallowed down the throat. It is not contagious in the usual sense. It is more likely in people who have difficulty swallowing, who are drowsy or sedated, or who vomit while lying flat, and it is one of the reasons healthcare providers take swallowing problems seriously after a stroke or surgery.
Types of pneumonia by where you catch it
Doctors also classify pneumonia by where the infection was acquired, because that affects which germs are likely involved and how serious the illness may be. Community-acquired pneumonia is pneumonia caught during daily life, outside any healthcare facility — the most common kind. Hospital-acquired pneumonia develops while a person is in hospital for another illness or procedure, and it is usually more serious because antibiotic-resistant bacteria, such as methicillin-resistant Staphylococcus aureus (MRSA), are more likely to cause it. Healthcare-associated pneumonia is caught in a long-term care facility or outpatient clinic. Ventilator-associated pneumonia affects people who need a breathing machine to help them breathe in hospital. The distinction matters because the germs, and therefore the treatment, differ — which is why doctors ask where and when the illness began.
There is also “walking pneumonia”, a non-medical term for a mild case of pneumonia with cold-like symptoms, often caused by Mycoplasma pneumoniae. People with walking pneumonia can usually carry on with daily activities, but they can still pass the infection to others, and the illness can worsen if it is ignored.
Bacterial vs viral vs fungal pneumonia: how they differ
The cause of pneumonia shapes almost everything about it: how severe it is likely to be, how it is treated, and how long recovery takes. The table below summarises the differences described by the Cleveland Clinic and Harvard Health.
| Feature | Bacterial pneumonia | Viral pneumonia | Fungal pneumonia |
|---|---|---|---|
| Most common germs | Streptococcus pneumoniae (pneumococcus), Haemophilus influenzae, Mycoplasma pneumoniae | Influenza, respiratory syncytial virus (RSV), coronaviruses including COVID-19 | Fungi such as Coccidioides (valley fever) and others found in soil or bird droppings |
| Typical severity | Usually the most severe; often needs antibiotics | Often milder and may clear on its own; can be serious in older adults and people with weak immunity | Uncommon; mainly affects people with weakened immune systems or chronic illness |
| Main treatment | Antibiotics, usually for 5 to 14 days | Supportive care; antiviral medicines in selected cases | Antifungal medicines, sometimes for several months |
| How it spreads | Respiratory droplets and contact | Respiratory droplets and contact | Usually inhaled from the environment, not person to person |
Regardless of the cause, the signs and symptoms are similar, which is why the cause cannot be judged from symptoms alone — it needs the tests described in the diagnosis section. A related respiratory condition worth knowing about is asthma, which also affects the airways: what asthma is and how it differs from other lung conditions.
Risk Factors
Several factors increase the risk of developing pneumonia, including:
- Age under 5 years or over 65 years
- Smoking
- Chronic lung diseases such as asthma or chronic obstructive pulmonary disease (COPD)
- Diabetes
- Heart disease
- Weakened immune system
- Recent respiratory infections
- Hospitalization, especially with mechanical ventilation
- Poor nutrition
People with these risk factors should take extra precautions to reduce their risk of infection.
Common Symptoms of Pneumonia
Symptoms can range from mild to severe depending on the cause, age, and overall health of the individual.
Common symptoms include:
- Persistent cough, sometimes producing mucus
- Fever
- Chills
- Shortness of breath
- Chest pain that worsens during coughing or deep breathing
- Fatigue
- Rapid breathing
- Sweating
- Loss of appetite
- Confusion, particularly in older adults
Young children may also show signs such as poor feeding, irritability, or unusual sleepiness.
How Is Pneumonia Diagnosed?
Healthcare providers diagnose pneumonia using a combination of:
- Medical history
- Physical examination
- Listening to the lungs with a stethoscope
- Chest X-ray
- Blood tests
- Pulse oximetry to measure oxygen levels
- Sputum testing in certain cases
Additional tests may be recommended for severe infections or people with underlying medical conditions.
Treatment for Pneumonia
Treatment depends on the cause and severity of the infection.
Possible treatments include:
- Antibiotics for bacterial pneumonia
- Antiviral medications in selected cases of viral pneumonia
- Antifungal medications for fungal pneumonia
- Fever-reducing and pain-relieving medications
- Adequate rest
- Drinking plenty of fluids
- Oxygen therapy for severe cases
- Hospital care when necessary
Most healthy individuals recover completely with timely treatment, although recovery may take several weeks.

How long does pneumonia last? Recovery timeline
Recovery from pneumonia is measured in weeks, not days, and the timeline depends on the cause, the person’s age and their overall health. Most people see improvement within two to three days of starting treatment for bacterial pneumonia, according to Harvard Health, but that does not mean the illness is over — the antibiotic course typically lasts 5 to 14 days and should be finished even after the fever settles.
Viral pneumonia most often clears within one to three weeks with supportive care. Fungal pneumonia is the slowest to resolve: antifungal treatment can last several months. In all types, tiredness and a lingering cough can persist for several weeks after the fever and chest pain have gone, and older adults or people with chronic lung disease may take longer still.
During recovery, rest and fluids matter more than trying to return to normal quickly. Staying hydrated helps thin thick mucus and phlegm, making it easier to cough up. Over-the-counter medicines can help with cough, fever and aches, but they do not treat the infection itself. A follow-up appointment is often arranged to check that the lungs have cleared, and a repeat chest X-ray may be done if symptoms linger. If the fever returns, breathing worsens, or the cough produces bloody mucus after initial improvement, that is a reason to contact a healthcare provider again rather than waiting it out.
Possible Complications
If left untreated or if the infection is severe, pneumonia can lead to complications such as:
- Difficulty breathing
- Fluid accumulation around the lungs
- Lung abscess
- Bloodstream infection (sepsis)
- Respiratory failure
Prompt medical care significantly reduces the risk of these complications.
Pneumonia in children and older adults
Pneumonia is especially serious at the two ends of life. In young children, the immune system usually protects against pneumonia, and when children do develop it, a virus is usually the cause. Symptoms in children can look different from adult symptoms: difficulty breathing or breathing loudly, not feeding as usual, coughing, fever, irritability and dehydration. Toddlers may complain of pain in the chest or stomach and vomit after coughing. Treatment for children centres on rest and regular fluid intake, with antibiotics only when a bacterial cause is found.
In older adults, pneumonia can be harder to spot because the classic symptoms may be muted. Confusion or unusual sleepiness can be the main sign, sometimes with only a low-grade fever or no fever at all, and a fall or a sudden decline in energy may be the first clue. Older adults are also more likely to need hospital care, oxygen therapy and intravenous antibiotics, and they recover more slowly. That is why the warning signs in this article — confusion, extreme drowsiness, blue lips or fingertips, and difficulty breathing — deserve urgent attention in older adults even when they seem mild at first.
Pregnant women are another higher-risk group, and anyone in a higher-risk group who develops a persistent cough with fever should seek medical care early rather than waiting to see if it passes. Keeping up with routine checkups helps catch risk factors before they become emergencies: why regular health checkups matter.
Pneumonia vs bronchitis and flu: how to tell them apart
Pneumonia, bronchitis and flu can all cause coughing, fever and tiredness, and they are often confused with each other — but they affect different parts of the respiratory system and they are treated differently. Flu is a viral infection of the nose, throat and airways that usually comes on suddenly, with a high fever, body aches, headache and exhaustion; it can lead to pneumonia as a complication, which is one reason flu vaccination is recommended for people at higher risk. Bronchitis is inflammation of the bronchial tubes, the large air passages that connect the windpipe to the lungs; it usually causes a persistent cough that produces mucus, often after a cold, but the air sacs themselves are not filled with fluid the way they are in pneumonia.
The practical differences are in the pattern of symptoms. Pneumonia more often causes a high fever that lasts for days, chest pain that worsens when coughing or breathing deeply, shortness of breath, rapid breathing, and confusion or extreme tiredness — especially in older adults. Bronchitis more often causes a cough that lingers for weeks after the other symptoms have settled, without the same degree of fever or breathing difficulty. Flu more often causes sudden, whole-body symptoms: high fever, muscle aches, headache and severe tiredness that arrive within hours.
The distinction matters because the treatment differs. Bacterial pneumonia needs antibiotics; flu may be treated with antiviral medicines if caught early; acute bronchitis is usually viral and is generally managed with rest, fluids and symptom relief rather than antibiotics. Only a healthcare provider — usually with a chest X-ray and an examination — can reliably tell them apart, so a cough with a high fever and breathing difficulty should always be checked rather than self-diagnosed. Note the warning signs in the “When to Seek Medical Attention” section above and seek care promptly if any of them appear.
How to Help Prevent Pneumonia
Several healthy habits can lower the risk of pneumonia:
- Wash your hands regularly.
- Avoid smoking and secondhand smoke.
- Eat a balanced diet to support the immune system. — see foods that may help strengthen your immune system.
- Exercise regularly.
- Get enough sleep.
- Stay hydrated.
- Manage chronic health conditions effectively.
- Follow recommended vaccinations for respiratory illnesses when advised by a healthcare provider.
Good hygiene and healthy lifestyle choices play an important role in preventing lung infections.
When to Seek Medical Attention
Seek medical care if you experience:
- High fever that does not improve
- Persistent cough with thick or bloody mucus
- Chest pain during breathing — see symptoms of heart disease everyone should know.
- Difficulty breathing
- Blue lips or fingertips
- Confusion or extreme drowsiness
- Symptoms that worsen or fail to improve after several days
Immediate medical attention is especially important for infants, older adults, and people with weakened immune systems.
Conclusion
Pneumonia is a common lung infection that causes inflammation and fluid buildup in the air sacs of the lungs, making breathing more difficult. It can result from bacterial, viral, or fungal infections and ranges from mild illness to a life-threatening condition.
Recognizing symptoms early, seeking prompt medical care, and following the recommended treatment plan are essential for a full recovery. Maintaining good hygiene, avoiding smoking, managing chronic conditions, and supporting overall health can help reduce the risk of pneumonia and protect long-term lung function.
Frequently Asked Questions
Is pneumonia contagious?
The germs that cause pneumonia — bacteria and viruses — can spread from person to person through respiratory droplets, but pneumonia itself is not always passed on as pneumonia. Someone who catches the germ may develop a cold or a mild illness rather than pneumonia. Fungal pneumonia and aspiration pneumonia are generally not contagious.
How do I know if I have pneumonia or just a cold?
A cold usually stays in the nose and throat, with a runny nose, sore throat and mild cough. Pneumonia reaches the lungs: the cough is deeper and often produces mucus, the fever is higher and lasts longer, breathing becomes difficult, and chest pain worsens with coughing or deep breathing. If those signs appear, especially with a high fever that does not improve, seek medical care — a chest X-ray is the test that settles it.
Can pneumonia go away on its own?
Mild viral pneumonia sometimes clears on its own with rest and fluids, usually within one to three weeks. Bacterial pneumonia generally needs antibiotics, and without treatment it can worsen and lead to serious complications. Because the cause cannot be judged from symptoms alone, a persistent cough with fever and breathing difficulty should always be checked rather than left to run its course.
What is walking pneumonia?
Walking pneumonia is a non-medical term for a mild case of pneumonia with cold-like symptoms, often caused by Mycoplasma pneumoniae. People with it can usually carry on with daily activities, but they can still pass the infection to others, and it can worsen if ignored — so rest and medical advice still apply.
Sources
Cleveland Clinic — Pneumonia (types, symptoms, causes, diagnosis and treatment); Harvard Health — Pneumonia: Symptoms, Causes, and Treatment (June 2024); Medical News Today — Pneumonia: Symptoms, causes, and treatments; CDC — Pneumonia.
This article is for general information only and is not medical advice. If you have symptoms of pneumonia or are worried about your lung health, please speak to a qualified healthcare professional.