A sharp stab under the right ribs every time you cough can come from a surprisingly wide range of sources, because the right upper abdomen is a crowded neighborhood. The lower rib cage houses portions of the lung and its lining, the diaphragm, the liver, the gallbladder, and layers of muscle and cartilage, all of which get compressed or jerked around by the explosive force of a cough. Some causes are minor and self-limiting; others need urgent attention. Here are twelve, organized by the body system involved, along with what sets each apart.
Why Coughing Hurts So Much in the First Place
A cough is not a gentle event. During a forceful cough, intra-abdominal pressure can spike to peak values above 140 cm of water pressure, driven by a near-simultaneous contraction of the diaphragm, the abdominal wall muscles, and the intercostal muscles between the ribs.1PubMed Central. Intra-abdominal Pressures during Voluntary and Reflex Cough At the same time, the shoulder-girdle muscles pull the lower ribs upward and outward while the abdominal muscles pull them downward and inward, creating opposing forces along the middle third of ribs five through ten.2PubMed Central. Cough-induced rib fractures: A comprehensive analysis of 90 patients in a single center That mechanical tug-of-war explains why any structure in the lower rib cage that is already inflamed, weakened, or irritated can flare up violently with each cough.
Musculoskeletal Causes
Intercostal Muscle Strain
The intercostal muscles run between each pair of ribs and contract hard during a cough. When a cough is prolonged or especially forceful, those fibers can strain or partially tear. The result is a localized, tender area along the rib cage that hurts with movement, deep breathing, and especially repeated coughing. You can often reproduce the pain by pressing on the sore spot or twisting your torso. Most intercostal strains heal on their own within a few weeks with rest, over-the-counter pain relief, and gentle stretching, though a lingering cough keeps re-aggravating them.
Cough-Induced Rib Fractures
It sounds dramatic, but coughing hard enough and long enough can actually crack a rib. In a study of 90 patients with cough-induced rib fractures, roughly 58 percent of the fractures occurred on the right side, and single-rib fractures were the most common pattern.2PubMed Central. Cough-induced rib fractures: A comprehensive analysis of 90 patients in a single center A separate case series found that rib six was the most frequently fractured on both sides, with the break typically located at the lateral aspect of the rib cage.3PubMed. Cough-induced rib fractures Lower ribs are especially vulnerable because the diaphragm attaches to the bottom six ribs and their cartilages. When the glottis is still closed and intrathoracic pressure is skyrocketing, the ribs absorb enormous bending forces.4International Journal of Obstetric Anesthesia. Cough stress rib fractures in two obstetric patients: case report and pathophysiology
Cough-induced fractures tend to be missed at first because many people (and some clinicians) don’t expect a cough to break a bone. If your rib pain is pinpoint, gets worse over days of coughing rather than better, and hurts sharply when you press a specific spot, imaging is worth pursuing. A standard chest X-ray misses some rib fractures; a CT scan is more reliable.
Costochondritis
The cartilage that connects each rib to the breastbone can become inflamed, a condition called costochondritis. It causes a sharp or aching pain at the front of the chest or just under the ribs, and coughing makes it worse because the cartilage is compressed with every forced exhalation. The pain is usually reproducible by pressing on the junction between the rib and the sternum. Costochondritis is benign and self-limiting, but it can linger for weeks or months, which is frustrating when you’re also fighting off a respiratory infection.
Slipping Rib Syndrome
The lowest three pairs of ribs (eight through ten) are called “false ribs” because they attach to the rib above by cartilage rather than directly to the breastbone. In slipping rib syndrome, that cartilage becomes hypermobile, allowing one rib to slide over the adjacent rib during abdominal muscle contraction.5PubMed Central. Slipping rib syndrome: a place for sonography in the diagnosis of a frequently overlooked cause of abdominal or low thoracic pain The slipping irritates the intercostal nerve and produces a clicking or popping sensation along with intermittent sharp pain under the ribs. Coughing, sneezing, and twisting all aggravate it. Slipping rib syndrome is notoriously underdiagnosed; many people are told they have a “mystery pain” for months before the real cause is identified.
Lung and Pleural Causes
Pneumonia
A lower-lobe pneumonia on the right side can cause pain that feels like it’s coming from under the ribs rather than from the chest. This is especially true when the infection sits near the base of the right lung, close to the diaphragm. In some cases, the pain can mimic an abdominal problem so convincingly that patients are initially worked up for appendicitis or gallbladder disease. One reported case involved a patient admitted for worsening abdominal pain that radiated to the lower back; decreased breath sounds at the right lung base were not detected until 72 hours in, at which point imaging confirmed right lower-lobe pneumonia.6PubMed Central. Pneumonia presenting with lower right abdominal pain and migratory polyarthritis Fever, productive cough, and feeling generally unwell alongside rib pain should raise your suspicion for pneumonia, but the absence of a high fever doesn’t rule it out.
Pleurisy
The pleura is a thin, two-layered membrane that wraps around each lung and lines the inside of the chest wall. When it becomes inflamed, every breath and every cough drags the inflamed surfaces against each other, producing a distinctive, knife-like pain that worsens with inhalation and coughing. Pleurisy can be triggered by viral infections, pneumonia, autoimmune conditions, and pulmonary embolism, among other things. If the inflammation is on the right side and sits low, the pain localizes under the right ribs. A hallmark clue is that lying on the affected side sometimes reduces the pain because it limits how much the pleural surfaces move.
Pneumothorax
A pneumothorax occurs when air leaks into the space between the lung and the chest wall, causing the lung to partially or fully collapse. Patients typically experience a sudden, sharp pain in the chest or upper abdomen that is aggravated by coughing or deep breathing.7PubMed Central. Spontaneous Pneumothorax Spontaneous pneumothorax tends to strike tall, thin, young men without warning, though it can happen at any age and in either sex. If the pain came on abruptly, you feel short of breath, and the cough itself feels “different” or shallow, a pneumothorax is worth ruling out quickly because a large one needs urgent treatment.
Pulmonary Embolism
A blood clot that lodges in the pulmonary arteries on the right side can cause pleuritic chest pain under the right ribs, especially with coughing. Pulmonary embolism is a chameleon: it can mimic pneumonia, pleurisy, or even a musculoskeletal strain. One case report describes a 35-year-old man initially treated for lobar pneumonia who improved on antibiotics but then returned with persistent right-sided pleuritic pain, cough with streaks of blood, and breathlessness on exertion. CT pulmonary angiography ultimately confirmed a pulmonary embolism that had been masked by the pneumonia.8PubMed. Pneumonia and concealed pulmonary embolism: A case report and literature review Red flags for PE include sudden-onset breathlessness that seems out of proportion to any chest infection, coughing up blood, a rapid heart rate, and recent immobility or a history of blood clots.
Abdominal Organ Causes
Gallbladder Disease
The gallbladder sits directly under the liver, tucked beneath the right ribs. Gallstones or an inflamed gallbladder (cholecystitis) produce a deep, cramping or steady pain in the right upper quadrant that frequently radiates to the right shoulder blade. Coughing intensifies the pain because the abdominal wall muscles compress the inflamed organ. A classic bedside test for cholecystitis involves pressing under the right ribs and asking you to take a deep breath; if you wince and stop inhaling, that suggests the gallbladder is the culprit. The pain often follows a fatty meal and may come with nausea. Gallbladder attacks tend to last hours, not seconds, which distinguishes them from the brief stabs of a muscle strain.
Liver Inflammation or Abscess
The liver occupies most of the right upper abdomen, and its capsule is rich in pain-sensing nerve fibers. Hepatitis (viral, alcoholic, or autoimmune) swells the liver and stretches that capsule, producing a dull ache under the right ribs that coughing worsens. A liver abscess, whether from bacterial infection or, in tropical regions, amoebic infection, causes a more intense, sometimes throbbing pain. Fever, fatigue, and sometimes jaundice accompany these conditions. Liver pain is often deeper and less localized than musculoskeletal pain; people describe it as a heavy pressure rather than a sharp stab.
Subphrenic Abscess
A collection of pus just below the diaphragm, on the right side, is called a right subphrenic abscess. It can develop after abdominal surgery, a ruptured appendix, or a perforated ulcer. Because the abscess sits directly against the underside of the diaphragm, it irritates both the diaphragm and the lower lung, producing a nonproductive cough, chest pain, difficulty breathing, and sometimes referred pain to the right shoulder.9Pakistan Armed Forces Medical Journal. IDIOPATHIC RIGHT SUB-PHRENIC ABSCESS CONTAINING GAS Coughing with a subphrenic abscess is both a symptom (the diaphragmatic irritation triggers the cough) and an aggravator of the pain. High fever and feeling extremely unwell are typical.
Nerve-Related Causes
Intercostal Neuralgia
The intercostal nerves run along the underside of each rib. When one of these nerves is damaged or irritated, it can produce a burning, shooting, or electric-shock-like pain along the rib’s path that flares dramatically with coughing. Causes include shingles (herpes zoster), prior chest surgery, trauma, and even cough-induced rib fractures themselves. One case report details a 48-year-old woman who developed persistent intercostal neuralgia after sustaining bilateral multiple rib fractures from a violent coughing episode.10PubMed Central. Treatment of Intercostal Neuralgia Following Cough-induced Rib Fractures With Targeted Muscle Reinnervation The pain of intercostal neuralgia often wraps around from the back to the front of the rib cage and can be triggered by light touch on the skin, not just coughing or movement.
How to Start Sorting Out Which Cause Applies to You
Twelve causes is a lot to sift through, but a few simple observations narrow the list quickly. Think about onset, character, and context.
- Onset: Pain that appeared gradually during a long bout of coughing points toward muscle strain, costochondritis, or a developing stress fracture. Pain that struck suddenly, especially with breathlessness, raises concern for pneumothorax or pulmonary embolism.
- Character: A sharp, localized, reproducible-by-pressing pain is typically musculoskeletal. A deep, dull ache that’s hard to pinpoint suggests an organ underneath (liver, gallbladder). A burning or shooting sensation along a rib points toward nerve involvement.
- Context: A recent fatty meal before the pain started implicates the gallbladder. Fever and productive cough suggest pneumonia or abscess. A history of prolonged steroid use, osteoporosis, or postmenopausal status raises the risk of a cough-induced rib fracture.
None of these rules are airtight. Pneumonia can cause sharp localized pain, and a rib fracture can ache diffusely. The observations help you decide whether you can wait for a scheduled appointment or need to go to the emergency department today.
When to Get Help Urgently
Most cough-related rib pain is musculoskeletal and resolves when the cough does. But certain combinations of symptoms suggest something more serious:
- Sudden breathlessness or rapid heart rate: These are hallmarks of pneumothorax and pulmonary embolism.
- Coughing up blood: Even small streaks of blood in sputum warrant prompt evaluation, especially combined with pleuritic pain.
- High or persistent fever: Fever alongside right-sided rib pain and cough raises the possibility of pneumonia, liver abscess, or subphrenic abscess.
- Jaundice or dark urine: Yellowing of the skin suggests the liver or biliary system is involved.
- Pain that is getting worse, not better: A rib fracture worsens as the cough continues. An abscess grows. A PE doesn’t resolve on its own. Worsening pain after several days of a respiratory illness should not be written off as “just a pulled muscle.”
Who Is at Higher Risk for the More Serious Causes
Some populations face elevated risk for specific items on this list. Postmenopausal women and people with metabolic bone disease are significantly more likely to develop multiple cough-induced rib fractures.2PubMed Central. Cough-induced rib fractures: A comprehensive analysis of 90 patients in a single center Patients who had COVID-19 pneumonia also showed a higher rate of multiple fractures in the same study. People on long-term oral corticosteroids, which weaken bone, face similar risks. Pregnant women in the third trimester are another underappreciated group: the widened costal angle limits the ribs’ ability to flare outward during a cough, meaning the forces concentrate more on the bone itself.4International Journal of Obstetric Anesthesia. Cough stress rib fractures in two obstetric patients: case report and pathophysiology
For pulmonary embolism, the classic risk factors include recent surgery, prolonged immobility (long flights, bed rest), use of oral contraceptives or hormone replacement therapy, active cancer, and a personal or family history of clotting disorders. If any of these apply to you and you develop right-sided rib pain with breathlessness after a coughing illness, mention them to your doctor explicitly rather than assuming the pain is muscular.
Why Right-Sided Pain Specifically
Anatomy stacks the deck. The liver, the largest solid organ in the abdomen, sits entirely under the right rib cage. The gallbladder is nestled against the liver’s undersurface. The right lung’s lower lobe extends further down than most people realize, reaching close to the diaphragm. And as the rib-fracture data show, coughing produces fractures on the right side more often than the left, possibly because most people are right-hand dominant and the muscles on that side generate slightly asymmetric forces during a cough. All of this means the right subcostal area has more potential pain generators than the left, and coughing stresses nearly all of them simultaneously.
Diaphragm Irritation as a Crosscutting Theme
Several of the causes listed above share one mechanism worth understanding: diaphragmatic irritation. The diaphragm is a dome-shaped muscle that separates the chest from the abdomen, and it contracts and relaxes with every breath and every cough. Its nerve supply comes from the phrenic nerve, which originates in the neck. When the diaphragm’s underside is irritated by a subphrenic abscess, a swollen liver, or a basal pneumonia, the brain can misinterpret the signal. That’s why liver disease sometimes causes right shoulder pain, and why a lower-lobe pneumonia sometimes causes belly pain rather than chest pain. If you’re told your rib pain has an unexpected cause that seems anatomically distant, diaphragmatic referral is often the explanation.
The diaphragm also bears enormous mechanical load during coughing. As a primary respiratory muscle, it contracts against the abdominal contents to build the high pressures that make a cough effective. When the diaphragm itself is fatigued, weakened, or in spasm after days of repetitive coughing, it can produce an aching soreness under the lower ribs on either side. This kind of diaphragmatic overuse is common during prolonged respiratory infections, and it overlaps with intercostal strain as one of the more benign causes of cough-related rib pain.
Managing the Pain While Treating the Underlying Cause
Whatever the cause, a few practical steps help reduce the pain while you’re still coughing. Holding a pillow firmly against your right side when you feel a cough coming provides counter-pressure that limits rib-cage motion and softens the impact, a technique nurses routinely teach post-surgical patients. Over-the-counter anti-inflammatories reduce pain from muscle strains, costochondritis, and rib fractures, though you should avoid them if you have kidney disease, stomach ulcers, or a bleeding risk. Cough suppressants can break the cycle of cough-pain-more coughing, but should only be used when the cough is nonproductive and not clearing an active infection.
Topical lidocaine patches, applied over the most painful rib, offer localized relief for intercostal neuralgia and rib fractures without the systemic side effects of oral painkillers. For persistent neuralgia, nerve blocks and, in rare refractory cases, surgical approaches like targeted muscle reinnervation have been described.10PubMed Central. Treatment of Intercostal Neuralgia Following Cough-induced Rib Fractures With Targeted Muscle Reinnervation Adequate pain control matters beyond comfort: when rib pain makes you breathe shallowly to avoid triggering a cough, you raise the risk of mucus retention and secondary lung infections, which is the last thing you need when the cough is already the problem.