Pneumonia
Pneumonia is an infection of one or both lungs that inflames the tiny air sacs and fills them with fluid, causing cough, fever and trouble breathing.

Overview
Pneumonia is an infection in one or both lungs. Deep inside your lungs are millions of tiny air sacs called alveoli. When you breathe in, oxygen passes from these sacs into your blood. In pneumonia, the air sacs become inflamed (swollen and irritated) and fill with fluid or pus. This makes it harder for oxygen to reach your blood, so you may feel short of breath and very tired.
Pneumonia can be caused by bacteria, viruses or, less often, fungi. It ranges from mild illness that you can manage at home to a serious condition that needs hospital care. It is one of the most common reasons for hospital stays in adults and children, and it is most dangerous for babies, people over 65 and people with other health problems. With the right care, most healthy people recover fully.
Types of pneumonia
Doctors describe pneumonia by its cause and by where you caught it:
- Community-acquired pneumonia: caught in everyday life, outside a hospital. This is the most common type.
- Hospital-acquired pneumonia: starts 2 or more days after going into hospital, including in people on a breathing machine (ventilator). The germs involved can be harder to treat.
- Bacterial pneumonia: caused by bacteria, most often Streptococcus pneumoniae (pneumococcus). It usually needs antibiotics.
- Viral pneumonia: caused by viruses such as flu, COVID-19 or RSV (respiratory syncytial virus). Antibiotics do not work on viruses.
- Aspiration pneumonia: happens when food, drink, stomach contents or saliva are breathed into the lungs, often in people who have trouble swallowing.
- Pneumocystis pneumonia: a fungal infection that mainly affects people with a very weak immune system, such as those with advanced HIV.
You may also hear terms such as bronchopneumonia (patches of infection spread around the airways), pleuropneumonia (infection that also involves the lining around the lungs) and necrotizing pneumonia (a rare, severe form that damages lung tissue). "Walking pneumonia" is an informal name for a mild pneumonia that does not keep you in bed.
Symptoms
Symptoms can come on quickly over a day or two, or build slowly over several days. Common symptoms include:
- A cough, which may bring up yellow, green or rust-coloured mucus (phlegm)
- Fever, sweating and shaking chills
- Feeling short of breath, or breathing faster than usual
- Sharp chest pain that gets worse when you breathe deeply or cough
- Feeling very tired and weak
- Loss of appetite, nausea or vomiting
- Headache and muscle aches
Older adults may not have a fever or a strong cough. Instead, they may become confused, unsteady or less able to manage their usual activities. Babies and young children may breathe fast, grunt, look pale or blue, feed poorly or seem unusually sleepy.
Causes
Most pneumonia starts when germs that you breathe in, or that already live in your nose and throat, get past your body's defences and reach the lungs. Common causes include:
- Bacteria, especially pneumococcus. Others include Haemophilus influenzae, Mycoplasma pneumoniae, Legionella and Staphylococcus aureus.
- Viruses, such as influenza (flu), SARS-CoV-2 (the virus that causes COVID-19), RSV and the common cold viruses. A viral infection can also be followed by a bacterial pneumonia.
- Fungi, which mainly cause pneumonia in people with weakened immune systems or after certain environmental exposures.
- Breathing in foreign material, such as food or vomit, which causes aspiration pneumonia.
In many people, doctors never find the exact germ. Treatment is based on how ill you are and the most likely causes.
Risk factors
Anyone can get pneumonia, but your risk is higher if you:
- Are under 2 or over 65 years old
- Smoke, or drink a lot of alcohol
- Have a long-term lung condition such as COPD (chronic obstructive pulmonary disease), asthma or bronchiectasis
- Have heart disease, diabetes, kidney or liver disease
- Have a weakened immune system, for example from HIV, cancer treatment, an organ transplant or long-term steroid medicines
- Have trouble swallowing, for example after a stroke or with Parkinson disease or dementia
- Have recently had flu or another respiratory infection
- Are in hospital, especially if you need a breathing machine (ventilator)
Diagnosis
Your clinician will ask about your symptoms and listen to your chest with a stethoscope. Crackling or bubbling sounds, or quiet areas, can point to pneumonia. They will also check your temperature, breathing rate, pulse, blood pressure and oxygen level using a small clip on your finger (pulse oximeter).
Tests you may have include:
- Chest X-ray: the main test to confirm pneumonia and see how much of the lung is affected.
- Blood tests: to look for signs of infection and check how your kidneys and other organs are coping.
- Sputum test: a sample of mucus you cough up, checked for germs.
- Swab tests: from your nose or throat to look for flu, COVID-19 or RSV.
- Urine tests: can detect certain bacteria, such as pneumococcus and Legionella.
- CT scan or other tests: sometimes needed if the pneumonia is severe, unusual or not getting better.
Your clinician will use your results, age and other health conditions to decide whether you can be treated at home or need hospital care.
Treatment
Treatment depends on the cause, how ill you are and your general health.
Treatment at home
Many people with mild bacterial pneumonia can be treated at home with antibiotic tablets. Common choices include amoxicillin, doxycycline and macrolides such as azithromycin or clarithromycin. These medicines kill or stop the growth of bacteria. Take the full course exactly as prescribed, even if you start to feel better.
If flu is the cause, an antiviral medicine such as oseltamivir may help, especially if started early. Viral pneumonia often gets better with rest and fluids, but your clinician may still prescribe antibiotics if they cannot rule out bacteria.
Acetaminophen (paracetamol) or ibuprofen can ease fever and chest pain. Ibuprofen is not suitable for everyone, for example people with kidney problems, stomach ulcers or some heart conditions, so ask your pharmacist which is right for you. Cough medicines are usually not needed, because coughing helps clear mucus from your lungs.
Treatment in hospital
If you are more unwell, you may need hospital care. This can include:
- Oxygen through a mask or small tubes in the nose, to raise the oxygen level in your blood
- Antibiotics given into a vein (intravenously), such as ceftriaxone, or piperacillin combined with tazobactam for hospital-acquired infections
- Fluids through a drip if you are dehydrated
- Help with breathing in an intensive care unit, in severe cases
Your clinician will review you after 2 to 3 days to make sure the treatment is working. If not, they may change your medicine or do more tests.
Recovery and self-care
Recovery takes time. Fever usually settles within a few days of starting treatment, but cough and tiredness can last for several weeks. Many people feel back to normal after about a month, though some, especially older adults, take longer.
To help yourself recover:
- Rest as much as you need and return to activity slowly
- Drink plenty of fluids to stay hydrated and help loosen mucus
- Do not smoke, and avoid second-hand smoke
- Take your medicines as prescribed and do not stop them early
- Cover your mouth when you cough, wash your hands often, and stay away from others while you have a fever
- Go to any follow-up appointments, including a repeat X-ray if your clinician asks for one
Complications
Most people recover without lasting problems, but pneumonia can sometimes lead to:
- Sepsis: a life-threatening reaction in which the body's response to infection damages its own organs
- Respiratory failure: when the lungs cannot get enough oxygen into the blood
- Pleural effusion or empyema: fluid or pus collecting between the lung and the chest wall, which may need draining
- Lung abscess: a pocket of pus inside the lung
- Worsening of other conditions, such as heart disease, COPD or diabetes
Outlook
For most healthy adults and children, pneumonia clears up fully with treatment. The risk of serious illness is higher in older adults, very young children and people with other health problems. Pneumonia remains a leading cause of death from infection worldwide, which is why early treatment and prevention matter.
Prevention
You can lower your risk of pneumonia by:
- Getting vaccinated: pneumococcal vaccines protect against the most common bacterial cause. Yearly flu vaccines, COVID-19 vaccines and RSV vaccines (for older adults and to protect infants) also reduce the risk. Routine childhood vaccines, including those for whooping cough, measles and Haemophilus influenzae type b, help protect children.
- Not smoking: smoking damages the lungs' natural defences.
- Washing your hands often, especially before eating and after coughing or sneezing.
- Managing long-term conditions such as diabetes, COPD and heart disease.
- Taking care with swallowing: if you or someone you care for has trouble swallowing, ask about a swallowing assessment and safe eating positions.
- Keeping your mouth clean: good oral hygiene helps, especially for people in care homes or hospital.
In Canada
In Canada, the National Advisory Committee on Immunization (NACI) advises on pneumococcal, influenza, COVID-19 and RSV vaccines. Which vaccines are publicly funded, and for whom, varies by province and territory; ask your pharmacist, clinician or local public health unit.
When to get medical help
See a doctor or nurse practitioner soon if you:
- Have a cough with fever, chills or coloured mucus that is not getting better
- Feel short of breath or have chest pain when you breathe
- Are over 65, pregnant, or have a long-term health condition and develop a chest infection
- Have started treatment for pneumonia but do not feel better after 2 to 3 days, or start to feel worse
Go to the emergency department or call emergency services (911) if you or someone you care for:
- Has severe trouble breathing or cannot speak in full sentences
- Has blue or grey lips, face or fingernails
- Is newly confused, very drowsy or hard to wake
- Has a very fast heartbeat, feels faint, or has cold, clammy or mottled skin
- Is a baby or young child who is breathing very fast, grunting, or whose chest pulls in with each breath
- Coughs up blood
In an emergency, call 911.
References
- U.S. National Library of Medicine. MeSH: Pneumonia. meshb.nlm.nih.gov
- MedlinePlus: Pneumonia. medlineplus.gov/pneumonia.html
- NHLBI: Pneumonia. nhlbi.nih.gov/health/pneumonia
- ATS/IDSA: Diagnosis and treatment of adults with community-acquired pneumonia (2019). doi.org/10.1164/rccm.201908-1581ST
- IDSA/ATS: Management of adults with hospital-acquired and ventilator-associated pneumonia (2016). doi.org/10.1093/cid/ciw353
- NICE: Pneumonia (community-acquired): antimicrobial prescribing (NG138). nice.org.uk/guidance/ng138
- WHO: Pneumonia in children. who.int/news-room/fact-sheets/detail/pneumonia