The main types of pneumonia are:
Bacterial pneumonia
Viral pneumonia
Fungal pneumonia
Pneumonia is a type of lower respiratory tract infection. It isn’t the same as a regular cold because it affects your lungs much more. When you have pneumonia, your lungs can swell and fill with fluid or pus. This can lead to symptoms like coughing, pain, and fever. Sometimes, people with pneumonia need to stay in the hospital.
You can get pneumonia at any age, but it’s more common and dangerous in small children and older adults. It can also be more serious in people who have long-term health problems, like diabetes, heart disease, or lung disease.
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.
More than 30 different germs can cause pneumonia. These include:
Bacteria: This is a common cause of pneumonia, especially a type of bacteria called Streptococcus pneumoniae (pneumococcus). Other types of bacteria can cause pneumonia too.
Viruses: Many different viruses can cause pneumonia — including the viruses that cause the common cold, the flu, and COVID.
Fungi: Fungi are a less common cause of pneumonia, especially in healthy people. This is more likely in people with a weakened immune system or long-term health problems.
Whatever the cause, you have a higher risk of getting pneumonia if you:
Are over the age of 65
Are under the age of 2
Are not up-to-date with 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
Certain environments can also put you at higher risk for pneumonia:
Crowded places, like prisons and nursing homes
Places with a lot of air pollution or toxins
Hospitals
Many of these risk factors are out of your control. But there are still steps you can take to stay healthy and prevent pneumonia.
Pneumonia can show up in different ways, depending on your health, age, and the type of pneumonia you have. Symptoms can appear suddenly, or they can develop slowly over several days.
Pneumonia causes many symptoms that affect breathing and the airways, including:
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
Other common pneumonia symptoms include:
Fever
Sweating
Chills
Nausea and vomiting
Low appetite
Fatigue and 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 times, people can manage pneumonia at home. It all depends on your symptoms and your overall health.
If you think you might have pneumonia, talk to a healthcare professional as soon as possible. This is especially important if your symptoms are severe or are getting worse.
To get diagnosed, you’ll need to talk with a healthcare professional. To figure out if you have pneumonia, they’ll use these tools:
Your medical history
A physical examination
A chest X-ray
And to confirm the diagnosis or treatment plan, a healthcare professional 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.
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 like an X-ray, but with much more detail.
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 for pneumonia. The right medication for you depends on your symptoms, overall health, and what type of pneumonia you have.
Some medications fight germs and make the infection go away. These include:
Antibiotics
Antivirals
Antifungals
Over-the-counter medications (OTC) can also help with symptoms, including:
NSAIDS (nonsteroidal anti-inflammatory drugs) like ibuprofen (Advil, Motrin) and naproxen (Aleve) can help with pain, fever, and inflammation.
Acetaminophen (Tylenol) can help with pain and fever.
Guaifenesin (Mucinex) can help break up mucus and relieve chest congestion. It can also make your cough more effective.
Remember to first check with a healthcare professional before starting an OTC medication.
And if you’re taking a prescription antibiotic, be sure to take all of the antibiotic — even if you’re feeling better. Stopping your antibiotic too soon can make your infection come back. It can also make it harder for medication to work again in the future.
There are many things you can do at home to help recover from pneumonia. Here are some things to consider:
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 prevent a relapse. 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. Try to stay away from sources of smoke while you’re recovering, like 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. This 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: S. 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. Doing your best to manage long-term health conditions like asthma, chronic obstructive pulmonary disease (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.
Yes, pneumonia can be contagious. The germs that cause bacterial and viral pneumonia can spread from person to person. They usually spread through the air when an infected person coughs or talks. You can also get pneumonia by touching a contaminated surface, and then touching your nose or mouth.
If you have pneumonia, it’s a good idea to limit close contact with your family and friends — especially if you have active symptoms. If you need to be around other people, consider wearing a mask or meeting outdoors. And be sure to cover your mouth and nose when you cough.
If you have bacterial pneumonia, you’re probably no longer contagious once you’ve been taking antibiotics for at least 48 hours and your fever has gone away. If you have viral pneumonia, you’re contagious until your symptoms have been getting better for several days and you no longer have a fever.
Recovery time depends on the case and the person. Some people feel better in less than a week — while others might take a month to recover.
Many people with bacterial pneumonia get better in the first 3 to 5 days after starting an antibiotic. But some symptoms, like cough and fatigue, can hang around for much longer.
Yes, in some cases. This is more likely to happen with viral pneumonia. Many mild cases of viral pneumonia will go away without any treatment, just supportive care.
Viral and bacterial pneumonia often have the same symptoms, so you may not be able to tell based on that alone. However, certain imaging and lab tests can help a healthcare professional know what’s causing the pneumonia. Most healthcare professionals can use a chest X-ray, blood tests, or sputum culture to find out if the pneumonia is viral or bacterial.
When you have pneumonia, you may want to avoid foods that will worsen congestion and inflammation. These could include:
Processed sugar (sodas, desserts, candy)
Alcohol
Dairy foods (like milk, creams, butter)
High histamine foods (like sausage, processed meat, cheeses)
Good hydration and nutrition can help improve healing and support your immune system in fighting pneumonia.
American Lung Association. (2024). Pneumonia symptoms and diagnosis.
American Lung Association. (2024). Pneumonia treatment and recovery.
American Lung Association. (2024). What causes pneumonia?
Centers for Disease Control and Prevention. (2024). Clinical overview of pneumococcal disease.
MedlinePlus. (2022). Guaifenesin.
MedlinePlus. (2023). Pneumonia.
National Heart, Lung, and Blood Institute. (2022). Pneumonia: Causes and risk factors.
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.