Mar. 12, 2025
Why Are You Coughing Up Foamy Mucus or Phlegm?

Jump to
Book a visit
$25 typical copay
$100 without insurance
Worried about your phlegm or mucus? Talk to a doctor today.
A virtual primary care visit makes it easy to talk to a licensed doctor about your phlegm or mucus — including changes in color, texture, or frequency.
Key takeaways:
- Coughing up foamy mucus is common and not necessarily a sign of a serious medical condition.
- There are several causes of coughing up foamy mucus that can often be effectively treated with home remedies or over-the-counter medications.
- But sometimes coughing up foamy mucus is a sign of a lung infection or a serious heart problem; if symptoms linger, it's important to consult a medical professional.
Mucus is a slippery, gel-like substance that coats the moist surfaces of the body: the inside of the nose, stomach, lungs, mouth, and intestines. Its function is to keep tissues moist so they don’t dry out. Mucus on the inside of the nose (also known as “snot”) comes out when you blow your nose. A type of mucus that lines the lungs is known as phlegm. Its function is to filter out harmful particles that you breathe in to help protect against infection.
Coughing up mucus or phlegm is often a sign that your sinuses and lungs are functioning normally – but when it is foamy, it could signal a more serious medical condition. Air bubbles in the mucus cause a foamy appearance, creating what’s known as frothy sputum. The potential causes of this symptom can range from mild to severe. Fortunately, home remedies can often effectively treat the problem so you don’t need medical care. Sometimes, however, seeking the advice of a doctor is urgently needed.
Is coughing up foamy mucus or phlegm normal?
The answer to that question is … maybe. If you cough up foamy mucus or phlegm when you’re sick, it’s probably just your lungs trying to clear out irritants that cause infection. Similarly, if you suffer from allergies or asthma, coughing up foamy mucus or phlegm during certain times of the year may be normal for you. But if you’re coughing up a large amount of foamy mucus or phlegm and it isn’t clearing up, definitely consult with your doctor.
Causes of coughing up foamy mucus
People of all ages can have bouts of coughing up foamy mucus, and there are various reasons why. It could be a temporary issue, or a more serious, chronic medical condition. It’s important to describe the specific characteristics of the cough and mucus to your healthcare team, as this information can help them diagnose more accurately.
Infection
Coughing up foamy mucus or phlegm can occur with the common cold or flu, both of which are caused by viruses. Alternatively, this symptom may indicate bronchitis or pneumonia, which can be caused by viruses or bacteria (or in rare cases, fungi). Coughing up foamy mucus is often accompanied by rapid breathing, difficulty breathing, and an increased heart rate.
Allergies and asthma
Medical conditions like allergies and asthma can cause you to cough up foamy mucus or phlegm. You might have symptoms like postnasal drainage, nasal congestion, chest congestion, shortness of breath, or wheezing. Each of these conditions can lead to inflammation in your airways. Coughing is your body’s way of clearing phlegm from your airways and lungs. As previously mentioned, this phlegm may appear foamy.
Chronic obstructive pulmonary disease (COPD)
Although coughing is how the body keeps the lungs clear of irritants, a cough that’s associated with COPD is much more severe – and long-lasting. Along with a persistent cough, you might experience breathlessness, wheezing, or tightness in your chest. Your lungs produce excess phlegm when you have COPD, and you may cough up foamy sputum.
Gastroesophageal reflux disease (GERD)
Gastroesophageal reflux disease (GERD) occurs when gastric acid flows back into the esophagus and throat. This can lead to symptoms such as heartburn, difficulty swallowing or breathing, and coughing up foamy mucus or phlegm. You may also experience hoarseness and a sore throat.
Cardiogenic pulmonary edema
Cardiogenic (heart-related) pulmonary edema occurs when the heart does not pump blood efficiently, causing fluid to accumulate in the lungs. This condition can be life-threatening, but even less severe stages require medical attention. Symptoms (which often occur gradually) include breathlessness, anxiety, and a sensation of drowning. It is common for someone with cardiogenic pulmonary edema to cough up foamy mucus or phlegm.
Diagnosing the reason for coughing up foamy mucus
If treating your cough at home hasn’t helped, and you are still coughing up foamy mucus, it’s time to seek medical attention. Your doctor may need to order some diagnostic tests, such as:
- Complete blood
- Blood tests to determine serum electrolyte levels
- Tests to determine kidney function
- Tests to determine oxygen levels
- Sputum or blood cultures
- Chest X-ray or CT scan of the chest
- Electrocardiogram (EKG) to make sure your heart is functioning normally
Treatment options for coughing up foamy mucus
Because coughing up foamy mucus or phlegm can have so many different causes, treatment options differ as well. Shown here are some typical treatments that vary widely depending on the severity of your condition.
At-home remedies
If you just started noticing foamy mucus or phlegm when you cough, keep track of when it occurs. Consider avoiding certain foods and/or changing your diet to be healthier. You may also find that allergies play a role, so it’s best to limit your exposure to dust or pollen. Resting and staying hydrated can provide relief. Additionally, you might want to explore over-the-counter medications like expectorants, cough suppressants, or antihistamines.
If you’re experiencing nausea, vomiting, or heartburn, you could try antacids or over-the-counter medications for stomach acid relief. It’s also a good idea to adjust your diet to eliminate spicy or acidic foods. Keeping your head elevated at night while you sleep may be helpful as well.
Antibiotics, antiviral, or antifungal agents
Coughing up foamy mucus or phlegm could indicate some type of infection. Your doctor may prescribe antibiotics, antiviral medications, or antifungal agents to help you recover. Your treatment may also include steroids to reduce inflammation and decrease the production of mucus.
Allergy or asthma treatment
If you're having symptoms like wheezing and coughing up foamy mucus or phlegm, see your doctor as soon as possible. You may be referred to a specialist to identify potential allergens. In addition to reducing your exposure to dust and pollen, you may also need prescription medications. These could include antihistamines, inhalers, or allergy shots.
Treatment for cardiogenic pulmonary edema
If your foamy mucus or phlegm is severe, your doctor may order tests to enhance your heart and lung function. Treatment options may include oxygen therapy, various medications,, and depending on your condition, admission to the hospital.
When you should see a doctor about coughing up foamy mucus
Coughing up foamy mucus can be a temporary symptom. This is especially true if you’re also suffering from nasal congestion, a sore throat, and/or a fever. However, if coughing up foamy mucus is your only symptom, and it continues or worsens, it’s important to see your doctor. You could be dealing with a lung infection or another condition that requires evaluation and professional care. Additionally, gastrointestinal or heart problems may be present and need immediate attention.
You should see a doctor if you have:
- Difficulty breathing or swallowing
- Painful swallowing
- Nausea and vomiting
- Making wheezing or other unusual sounds while breathing
- Discoloration of the foamy mucus
- Fever over 101° F
- Breathlessness
- Anxiety
- Feelings of drowning
- Excessive sweating
- Foul odor to the foamy mucus or phlegm
You should go to the emergency room if you have:
- Chest or abdominal pain
- Difficulty swallowing your saliva
- Difficulty breathing that you feel airway obstruction
- Pink, frothy mucus
- Making unusual sounds while breathing that don’t improve with positioning
- High temperature (fever) or low temperature
- Loss of voice
- Confusion or disorientation
Questions to ask your doctor about coughing up foamy mucus
- How soon will this coughing up foamy mucus go away?
- Is my condition contagious?
- Will coughing up foamy mucus cause me to have a serious medical condition?
- What tests are needed to determine why I cough up foamy mucus or phlegm?
- Should I have a chest X-ray or CT scan of my chest done?
- What is causing my breathlessness?
- Why am I having night sweats?
Frequently asked questions: coughing up foamy mucus
Coughing up foamy mucus can be a normal occurrence, especially during the spring and fall if you have allergies. However, when accompanied by other signs or symptoms, there may be a more serious underlying condition.
Is coughing up white foamy mucus a sign or symptom of pneumonia?
Pneumonia can be a serious medical condition. One symptom may include coughing up foamy mucus or phlegm, which could also have green or yellow tinges. Other symptoms may include high fever, rapid breathing, a deep cough, a rapid or irregular heart rate, and feelings of confusion or disorientation.
What if I’m coughing up foamy mucus, but feel fine otherwise?
You may cough up foamy mucus for several reasons that do not necessarily indicate illness or the need for medication. For instance, nasal congestion or postnasal drainage caused by allergies can result in this symptom. Additionally, conditions like heartburn and stomach upset can also lead to coughing up foamy mucus.
What if I’ve been coughing up foamy mucus for a week or longer?
It may indicate an ongoing medical issue if you’ve been coughing up foamy mucus for more than a week. In some cases, over-the-counter medications, rest, and staying hydrated may be sufficient to resolve the cough. However, if the foamy mucus persists or you experience additional symptoms that affect your breathing or overall well-being, be sure to consult a medical professional.
A condition to monitor
In many cases, coughing up foamy mucus or phlegm is not serious and can be effectively treated with home remedies. However, if you experience additional symptoms or if the cough lasts for a week or longer, consult with your doctor as soon as possible.
General Medicine follows a strict editorial process, including using real experts to write our articles, vetted primary sources, fact-checking, a secondary medical review, and updates as necessary. This article was medically reviewed and fact checked by Dr. Jennifer Nadel, MD.
Sources
Guilleminault, L. et al., “Guidelines for the Management of Chronic Cough in Adults.” Endorsed by the French-speaking Society of Respiratory Diseases (Société de Pneumologie de Langue Française, SPLF), the Société Française d'Oto-Rhino-Laryngologie et de Chirurgie de la Face et du Cou (SFORL), the Société Française de Phoniatrie et de Laryngologie (SFPL), the Société Nationale Française de Gastro-entérologie (SNFGE). Respiratory Medicine and Research, June 2023. https://doi.org/10.1016/j.resmer.2023.101011.
Torres, Antoni et al., “Pneumonia,” Nature Reviews. Disease primers vol. 7,1 25. April 8, 2021, doi:10.1038/s41572-021-00259-0. www.nature.com/articles/s41572-021-00259-0.
Maclay, John D. et al., “Update in Chronic Obstructive Pulmonary Disease 2008.” American Journal of Respiratory and Critical Care Medicine, April 2009. www.atsjournals.org/doi/full/10.1164/rccm.200901-0134up.
Katz, Philip O., “Medical Therapy for Gastroesophageal Reflux Disease in 2007,” Reviews in Gastroenterological Disorders, Fall 2007. https://pubmed.ncbi.nlm.nih.gov/18192955.