Pneumonia is a type of lower respiratory tract infection. When you have pneumonia, your lungs can swell and fill with fluid or pus. Pneumonia can be serious and some people with pneumonia may need to stay in the hospital.

The main types of pneumonia are:
Bacterial pneumonia
Viral pneumonia
Fungal pneumonia
You can get pneumonia at any age. But some people are more likely to get pneumonia and get seriously sick. This includes:
Adults over 65 years old
Young children
People with a weakened immune system
People with long-term health conditions, like diabetes or heart disease
People with lung conditions, like chronic obstructive pulmonary disease (COPD) or asthma
Save over 40% on Qsymia with GoodRx
Discover the once daily Qsymia for weight management. Qsymia is for adults and children 12-17 in combination with a healthy diet and regular exercise.

Pneumonia is usually caused by an infection. More than 30 different germs can cause pneumonia. These include:
Bacteria: Several types of bacteria can cause pneumonia. But Streptococcus pneumoniae (pneumococcus) is the most common cause of bacterial pneumonia.
Viruses: Many different viruses can cause pneumonia — including the viruses that cause the common cold, the flu, and COVID-19.
Fungi: Fungi can cause pneumonia but this isn’t common. People with a weakened immune system are more likely to develop fungal pneumonia
Parasites: Some parasites can also cause pneumonia, but parasitic pneumonia is uncommon.
Pneumonia itself isn’t contagious. But the viruses and bacteria that cause pneumonia are contagious. They can pass from person to person through respiratory droplets. If you inhale these droplets, you can develop a respiratory infection.
Some people only develop a mild upper respiratory tract infection, like the common cold. But others may develop more serious infections, like pneumonia. You’re at higher risk of developing pneumonia if you:
Are over the age of 65
Are under the age of 2
Aren’t up to date on vaccinations against pneumococcus, influenza, or COVID
Have long-term health problems, like diabetes, heart disease, or lung disease
Smoke cigarettes
Are malnourished
Have a weakened immune system
Have a hard time coughing or swallowing
Live in a nursing home
Symptoms of pneumonia can appear suddenly, or they can develop slowly over several days.
Common pneumonia symptoms include:
Cough, especially with green, yellow, or rust-colored mucus (sputum)
Chest pain when you cough or breathe deeply
Shortness of breath
Blue lips or nails due to low oxygen
Fever
Sweating
Chills
Nausea and vomiting
Low appetite
Fatigue or low energy
Confusion, especially in older adults
Symptoms can range from mild to very serious, and even life-threatening. In some cases, people with pneumonia have to stay in the hospital for treatment. But many people are able to manage pneumonia at home. It all depends on your symptoms and your overall health.
Seek medical care if you think you have pneumonia. This is especially important if your symptoms are severe or are getting worse.
Your medical team can diagnose pneumonia using tools like:
Your medical history
A physical examination
A chest X-ray
Your healthcare team may also order additional tests, including:
Blood tests: These tests can look for signs of infection in your body.
Urine testing: Urine tests can help diagnose some types of pneumonia and rule out other types of infections.
Sputum testing: This test looks at the sputum (mucus) you’re coughing up to see what types of germs are in your lungs.
CT scan: This is an imaging study that offers a more detailed image of your lungs.
Pulse oximetry: This is a small device that clips on your finger or ear. It measures how much oxygen is in your bloodstream.
Bronchoscopy: This is a small, flexible tube that goes through your nose or mouth and down into your lung. It has a camera so a healthcare professional can see inside your lungs and take samples to help with diagnosis and treatment.
There are many different medications that help treat pneumonia. The right medication for you depends on your symptoms, your overall health, and the type of pneumonia you have.
Some medications fight germs and help the infection go away. These include:
Antibiotics
Antivirals
Antifungals
Make sure to finish any prescription treatments — even if you’re feeling better. Stopping your medication too soon can make your infection come back. It can also make it harder for medication to work again in the future.
Over-the-counter (OTC) medications can’t cure or treat pneumonia. But they can help you manage pneumonia symptoms. Some OTC medications that can help when you have pneumonia include:
OTC pain and fever relievers: Ibuprofen (Advil, Motrin) and naproxen (Aleve) can help ease pain, fever, and inflammation. Acetaminophen (Tylenol) is another option for those who can’t take nonsteroidal anti-inflammatory drugs (NSAIDs).
Expectorants: Guaifenesin (Mucinex) can help break up mucus and relieve chest congestion.
Check with your healthcare team before taking any OTC medications. They can make sure OTC medications are safe for you and won’t interact with any prescription treatments.
There are many things you can do at home to ease your symptoms. Here are some self-care tips that can help you recover from pneumonia:
Drink lots of fluids. This helps your body stay hydrated, which is especially important if you have a fever. Fluids can also loosen the mucus in your lungs and make it easier to cough out. Warm drinks, like herbal tea, can also help to soothe your airways.
Get plenty of rest. Rest can help your body fight off pneumonia and lower your risk of getting sick again. Try to take it easy while you’re recovering and get as much sleep as you can.
Breathe moist air. Moist air can help to open your airways and make it easier to breathe. Create moist, soothing air by using a humidifier in your room or taking a hot shower or bath.
Stay away from smoke. Smoke can irritate your lungs and make it harder for them to heal. Avoid cigarettes, secondhand smoke, and wood-burning fires.
It’s impossible to completely prevent pneumonia. But there are some things you can do to protect yourself and lower your risk:
Get vaccinated. Staying up to date with vaccinations is one of the best things you can do to protect yourself from pneumonia. Pneumococcal vaccines, flu shots, and COVID vaccines can all help. They target three of the possible causes of pneumonia: Streptococcus pneumoniae, influenza, and coronavirus.
Take basic precautions. Simple measures can protect you from infections. These include washing your hands, wearing a mask in crowded areas, and staying away from people who are sick.
Stop smoking. Smoking cigarettes puts you at risk for many health problems, including pneumonia.
Manage your other medical conditions. Controlling long-term health conditions like asthma, COPD, and diabetes can also help to prevent pneumonia.
Stay physically fit. Eating nutritious foods, exercising regularly, and getting enough good-quality sleep every night can help lower your risk of serious viral and bacterial infections like pneumonia.
Pneumonia isn’t contagious. But the viruses and bacteria that cause pneumonia can spread from person to person. They usually spread through the air when someone with an infection coughs or talks. You can also get pneumonia by touching a contaminated surface and then touching your nose or mouth.
Limit close contact with your family and friends until your fever goes away and your symptoms start to get better. If you need to be around other people, consider wearing a mask or meeting outdoors. Be sure to cover your mouth and nose when you cough and wash your hands often.
Pneumonia recovery times can be different from person to person. Some people feel better in less than a week, while others might take a month or longer to recover.
Many people with bacterial pneumonia get better within the first 3 to 5 days after starting an antibiotic. But some symptoms, like cough and fatigue, can hang around for much longer.
Many mild cases of viral pneumonia will go away without any prescription treatments. But you will need medication to treat other causes of pneumonia, like bacteria, fungi, or parasites.
You usually can’t tell if you have viral and bacterial pneumonia based on just your symptoms. Imaging tests and lab tests can help you and your healthcare team figure out what’s causing your pneumonia.
When you have pneumonia, you may want to avoid foods that will worsen congestion and inflammation. These could include:
Processed sugar (including sodas, desserts, and candy)
Alcohol
Dairy foods (like milk, cream, and butter)
High-histamine foods (like sausage, processed meats, cheeses)
Good hydration and nutrition can help improve healing and support your immune system in fighting pneumonia.
American Lung Association. (2025). Pneumonia symptoms and diagnosis.
American Lung Association. (2025). Pneumonia treatment and recovery.
American Lung Association. (2025). What causes pneumonia?
Centers for Disease Control and Prevention. (2024). Clinical overview of pneumococcal disease.
Kley, A.C., et al. (2025). Parasitic infections in pulmonary and ICU patients: Presentation, diagnosis, and treatment Chest..
MedlinePlus. (2022). Guaifenesin.
National Heart, Lung, and Blood Institute. (2022). Pneumonia: Causes and risk factors.
Torp, K.D., et al. (2023). Pulse Oximetry. StatPearls.
Yasuo, S., et al. (2022). Diagnostic accuracy of urinary antigen tests for pneumococcal pneumonia among patients with acute respiratory failure suspected pneumonia: A systematic review and meta-analysis. BMJ Open.