You keep coughing up phlegm because your airways are producing mucus to trap and clear irritants, and something is keeping that response switched on. Mucus is not a sign your body is failing. It is one of the ways your lungs defend themselves. When you are healthy, you swallow most of this mucus without noticing it. When your airways are irritated or inflamed, production goes up, the mucus gets thicker, and you start coughing it out.
The color, thickness, and timing of that phlegm can point toward different causes. Most of the time the reason is ordinary and temporary. Sometimes it signals a condition that needs medical care.
What Is Phlegm and Why Does Your Body Make It?
Phlegm is the thick fluid your airways produce to protect themselves. It is mostly water mixed with proteins, antibodies, and immune cells. The lining of your respiratory tract is coated with a thin layer of this mucus at all times.
Tiny hair-like structures called cilia line your airways. They beat in a coordinated wave, moving mucus upward toward your throat. You then swallow it. This is called the mucociliary escalator, and it runs constantly in healthy people.
Phlegm becomes noticeable when something changes. The mucus may get thicker, your body may make more of it, or the cilia may slow down. Any of these can make you cough it up instead of quietly clearing it.
People often use “phlegm” and “sputum” interchangeably. Clinically, sputum refers to what you cough up from your lower airways. That distinction matters to doctors because sputum can be tested for infection.
Why Do You Keep Coughing Up Phlegm? Common Causes
An ongoing cough with phlegm usually has an identifiable trigger. The most common causes fall into a few groups.
Infections
Viral infections like the common cold and flu are the most frequent reason for a short-term productive cough. The airways swell, produce more mucus, and you cough to clear it. This typically improves over one to three weeks.
Bacterial infections such as bronchitis or pneumonia can also cause phlegm, often with fever, chest pain, or feeling very unwell. Pneumonia is more serious and needs medical evaluation.
Postnasal drip
When your nose produces excess mucus, it drips down the back of your throat. This is one of the most common causes of a persistent cough with phlegm. Allergies, sinus infections, and colds can all trigger it.
Acid reflux
Stomach acid that travels up into your throat can irritate your airways and increase mucus production. This is called laryngopharyngeal reflux. Some people with this have no heartburn at all, only a chronic cough.
Smoking and vaping
Smoke damages cilia and irritates the airway lining. This is why many smokers cough up phlegm, especially in the morning. The cough is a direct result of the airways trying to clear what smoke has disrupted.
Asthma and allergies
Asthma causes airway inflammation and excess mucus. Some people with asthma cough up phlegm regularly, particularly during flare-ups or after exposure to triggers.
Chronic lung conditions
Chronic obstructive pulmonary disease (COPD) and bronchiectasis both cause ongoing phlegm production. In bronchiectasis, the airways are widened and damaged, so mucus collects and is harder to clear.
What Does the Color of Your Phlegm Mean?
Phlegm color gives some clues, but it is not a reliable stand-alone diagnostic tool. Many people assume green phlegm means a bacterial infection that needs antibiotics. That assumption is often wrong.
- Clear or white: Normal or mild irritation. Common with viral infections, allergies, or early illness.
- Yellow or green: Often reflects immune cells and their byproducts in the mucus. This can happen with viral infections too, not only bacterial ones.
- Brown or gray: Can appear with smoking, pollution exposure, or old blood. Worth mentioning to a doctor if it persists.
- Red or bloody: May be from a minor irritation or something more serious. Blood in phlegm should always be evaluated by a doctor.
- Black: Rare. Can occur with certain fungal infections or heavy smoke inhalation. Needs prompt medical attention.
The color alone does not tell you whether you need antibiotics. A doctor considers color alongside fever, duration, breathing difficulty, and other symptoms.
When Should You See a Doctor?
Most short-term phlegm coughs resolve on their own. Certain signs mean you should get checked.
- Coughing up blood
- Shortness of breath or difficulty breathing
- Chest pain
- Fever above 100.4°F (38°C) that lasts more than a few days
- A cough lasting more than three weeks
- Phlegm that is worsening rather than improving
- Unintentional weight loss alongside the cough
- A weakened immune system from illness or medication
These signs do not automatically mean something serious. They mean a doctor should assess you. This is especially true if you smoke or have a chronic lung condition.
How Is a Persistent Productive Cough Evaluated?
A doctor starts with your history. How long have you had it? What does the phlegm look like? Does anything make it better or worse? Do you smoke? Do you have allergies or reflux?
They will listen to your lungs. Depending on what they find, they may order a chest X-ray, lung function tests, or a sputum sample. If reflux or postnasal drip is suspected, they may try treating that first and see if the cough improves.
This stepwise approach is common in clinical practice. It is not always possible to identify one single cause right away. Sometimes more than one factor is contributing at the same time.
What Can Help Clear Phlegm?
Staying well hydrated helps keep mucus thinner and easier to clear. This is widely recommended, though the evidence for how much it helps is not strong.
Humidified air may soothe irritated airways. Saline nasal rinses can help if postnasal drip is part of the problem. For people with certain chronic lung conditions, doctors may recommend airway clearance techniques or prescribe medications to help thin mucus.
Over-the-counter cough medicines vary widely. Some suppress the cough reflex, while others are expectorants meant to help you cough mucus up. Evidence for how well these work is mixed, and they are not appropriate for everyone. A pharmacist can advise on what fits your situation.
Antibiotics only help bacterial infections. They do nothing for viral infections, allergies, or reflux. Using them when they are not needed does not help and can cause harm.
Does the Duration of Your Cough Matter?
Duration is one of the most useful clues a doctor has.
- Under three weeks: Usually an acute infection or irritation.
- Three to eight weeks: Called subacute. Often follows an infection or reflects postnasal drip or reflux.
- Over eight weeks: Called chronic. Common causes include postnasal drip, asthma, reflux, and smoking-related conditions.
These time frames are standard clinical categories. They help guide what a doctor looks for next.
A cough that keeps producing phlegm for weeks or months is not something to simply live with. It is worth finding out why.
Frequently Asked Questions
Is coughing up phlegm a sign of infection?
It can be, but not always. Viral infections, allergies, reflux, asthma, and smoking can all cause a productive cough without any bacterial infection.
Does green phlegm mean I need antibiotics?
No. Green color often comes from immune cells in the mucus and can happen with viral infections too. Only a doctor can determine whether antibiotics are appropriate.
How long should a cough with phlegm last?
Most coughs from viral infections improve within one to three weeks. A cough lasting more than three weeks should be evaluated by a doctor.
When is coughing up phlegm an emergency?
Seek urgent care if you cough up blood, have trouble breathing, or have severe chest pain. These signs need prompt medical evaluation.

