You’ve had a cough for four or five days. Now every cough comes with a jab in the chest, and the worry starts. Is this still a cold, or has it gone to my lungs?
Usually it’s neither — it’s your ribs. But because chest pain is one of the symptoms that genuinely can be serious, the warning signs come first.
Managing a chesty, phlegmy cough · Why coughs get worse at night · Find Hedervy at a pharmacy
First: The Signs That Need Attention Today
Don’t wait these out. Get seen the same day, and go straight to A&E or call 995 for the first three.
Breathlessness that’s new or getting worse, especially if it’s there at rest rather than only when you move.
Sharp, stabbing pain when you breathe in that eases when you hold your breath. That pattern points at the lining around the lungs rather than the muscles outside them.
Coughing up blood in any amount, including streaks in the phlegm, or coughing up a large volume of phlegm, or phlegm that’s pink and frothy.
Pain spreading to your jaw, neck, shoulder or left arm, or arriving with sweating, nausea or light-headedness.
A fast heartbeat, dizziness or fainting alongside the chest pain.
Fever above 38.6°C with chest pain and breathlessness, which can point to pneumonia.
Singapore’s HealthHub lists difficulty breathing, wheezing and chest pains among the symptoms that warrant medical attention with a cough, along with blood-stained or pink frothy phlegm, fever over 38.6°C, night sweats and weight loss.1
Also treat it as urgent if the pain came on suddenly and severely rather than building over days, if you’ve had recent surgery or a long flight, or if you have a known heart or lung condition and this doesn’t feel like your usual pattern.
If none of that applies, and the pain only turns up when you cough, laugh, sneeze or twist, carry on reading.
Now Press On It
This takes ten seconds and it’s the most useful thing on this page.
Use two fingers. Moderate pressure. Press along the edge of your breastbone and between the ribs, on the spot that’s been hurting.
Then notice what happened, because the answer sends you down one of two paths.
If Pressing Reproduces the Pain
This is the common outcome, and it’s the reassuring one. Pain you can press on is almost always coming from the chest wall: muscle, or the cartilage joining your ribs to your breastbone.
Here’s why coughing does that. A cough is a violent thing. The muscles between your ribs contract hard and fast to force air out, and a serious cough does it hundreds of times a day for days on end. No muscle handles that without complaint. They fatigue and strain the way your legs would after an unplanned marathon, then ache with every cough and settle in between.
The cartilage takes a beating too. When it becomes inflamed it’s called costochondritis, and coughing is one of its recognised triggers, alongside vigorous use of the arms and strenuous activity.2 It typically shows up at the front of the chest around the second to fifth rib joints, and it worsens with movement, including deep breaths, coughing and stretching.2
Reproducible pain is one of its defining features. Costochondritis pain is characteristically reproducible with mild to moderate pressure over the upper rib joints, and it presents without shortness of breath, fever or a rash.2
None of this is dangerous. All of it is miserable.
If Pressing Changes Nothing
If the pain doesn’t respond to pressure, sits deeper, sharpens when you breathe in, or comes with any of the signs at the top of this page, that points away from the chest wall.
That doesn’t mean something is badly wrong. It means the self-test can’t tell you what’s going on, and a doctor’s assessment can. Book one rather than working through the rest of this article.
Pressing on it is the same first question a doctor asks — it just isn’t the last one.
Getting Through It
Assuming you’re in the first group, here’s what actually helps.
Cough less often, by treating the phlegm rather than silencing the cough. This is the part most people get backwards. If your cough is productive, suppressing it traps mucus and you end up coughing harder later. An expectorant thins the mucus so each cough clears more of it, which means fewer coughs overall, which is what genuinely rests a strained rib cage. The cough syrup guide covers which type does which, and if you’re not sure what kind of cough you have, the chesty cough guide walks through it.
Hold a pillow against your chest when you cough. It’s called splinting, and it’s what physiotherapists teach patients after chest surgery. Hugging a cushion firmly against the sore area just before a cough braces the chest wall and takes a surprising amount of the pain out of it.
Simple pain relief. Paracetamol, or an anti-inflammatory if it suits you. Treatment for chest wall pain of this kind is primarily supportive, with topical measures and oral pain relief.2 Check with a pharmacist first if you have stomach, kidney or asthma issues.
Warmth on the sore area. A warm compress or a hot shower relaxes the strained muscle.
Don’t push through exercise. Rest it the way you’d rest any other strained muscle. Heavy lifting and upper-body work will keep aggravating it.
Cut the night-time coughing. Fewer coughs overnight means less strain, and there’s a set of things that reduce night coughing specifically. They’re in the guide to coughing at night.
How Long This Takes
Chest wall soreness from coughing generally eases as the cough eases, over one to two weeks. Costochondritis takes longer, but the outlook is good: over 90% of people improve within three to four weeks.2
What shouldn’t happen is the pain climbing while the cough settles. If the cough is clearly improving and the chest pain isn’t, that reversal is worth a doctor’s opinion.
Book a non-urgent appointment if the pain runs past three weeks, if the cough hasn’t improved after two weeks of self-treatment,1 if the pain is wrecking your sleep despite pain relief, or if you’re simply not reassured. Polyclinic for the subsidised route, private GP or telehealth if you want it faster.
Common Questions
Why does my chest hurt when I cough but not otherwise?
Because the pain is mechanical. The muscles between your ribs and the cartilage joining them to your breastbone get strained by repeated forceful coughing, so they hurt when they’re used and settle when they’re not. Pain that shows up only on coughing, laughing, sneezing or twisting is the classic chest wall pattern.
How do I know if it’s my lungs or just muscle?
Press on the painful spot. If pressing reproduces the pain, it’s almost certainly chest wall. If it doesn’t, and the pain is deeper, sharper on breathing in, or comes with breathlessness, fever or blood in the phlegm, that needs a doctor the same day.
Can a cough crack a rib?
Rarely, but it happens, most often in older adults or people with thinning bones after a long forceful cough. The pain is usually sharper and pinned to one precise point. If it’s severe, focused on a single spot and not improving, get it assessed.
Is chest pain with a cough a sign of pneumonia?
It can be, but pneumonia usually brings company: a high fever, breathlessness, feeling genuinely unwell, and often sharp pain on breathing in rather than only on coughing. Chest pain that arrives only when you cough, with no fever and no breathlessness, is far more likely to be a strained chest wall.
How long does costochondritis last after a cough?
Most cases improve within three to four weeks, and over 90% of people are better inside that window.2 Rest, warmth and simple pain relief are the mainstays, and it’s usually the cough settling that lets it heal.
Should you take a cough syrup for this?
Not for the pain. No cough syrup treats a strained chest wall, and anyone who tells you otherwise is selling something.
What a syrup can do is reduce how often you have to cough, which is the thing that lets a strained rib cage recover. If your cough is chesty and productive, an expectorant thins the mucus so you clear it in fewer, more effective coughs. If it’s dry with nothing coming up, that’s a different product and worth a word with a pharmacist.

And if the pain is severe, sharp on breathing in, or comes with breathlessness or blood, none of this applies. That’s a visit to the doctor, not to a pharmacy.
If you do want to compare types, the cough syrup guide lays them out.
References
The numbered sources below correspond to the superscript numbers in the article.
- HealthHub Singapore (Ministry of Health). Cough. (Seek medical attention for cough with thick yellow or green phlegm, fever higher than 38.6°C, weight loss, coughing out a large amount of phlegm or bloody or pink frothy phlegm, night sweats, or difficulty breathing, wheezing or chest pains. “If your cough does not get better in 2 weeks with self-treatment, gets worse or lasts for more than 8 weeks, you should see a doctor.”) https://www.healthhub.sg/a-z/diseases-and-conditions/cough ↩
- Costochondritis. StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing. (The condition may be precipitated by vigorous activity of the upper extremities, coughing, or strenuous activity. It primarily affects the anterior chest wall, often involving the 2nd to 5th costochondral junctions; pain worsens with movement including deep breaths, coughing and stretching, and is usually reproducible by mild-to-moderate palpation at the upper costochondral junctions, without associated shortness of breath, fever or rash. Treatment is primarily supportive. Over 90% of patients experience symptomatic improvement within 3–4 weeks.) https://www.ncbi.nlm.nih.gov/books/NBK532931/ ↩
Last updated 25 August 2026. This article is for general information only and is not a substitute for medical advice. Chest pain has causes that require urgent assessment. If you have breathlessness, sharp pain on breathing in, coughing up blood, or pain spreading to the jaw, neck or arm, seek medical help immediately.