Pain under the ribs can come from dozens of different structures, and the cause ranges from a strained muscle that heals on its own to an organ emergency that needs same-day treatment. The rib cage shelters the lungs, heart, liver, spleen, stomach, kidneys, and gallbladder, so discomfort in that zone is one of the least specific symptoms in medicine. Whether the pain sits on the right side, left side, or wraps around from the back changes the likely explanation considerably, and certain accompanying symptoms should move you from “wait and see” to “get checked now.”
Musculoskeletal Causes Are the Most Common and the Most Overlooked
Costochondritis, which is inflammation where a rib attaches to the breastbone or its cartilage, is one of the most frequent reasons people feel sharp pain along the front of the rib cage. The pain typically worsens when you press on the spot, twist your torso, or take a deep breath. It often follows a bout of heavy coughing, an upper-respiratory infection, or unaccustomed physical activity. These musculoskeletal chest-wall conditions are frequently mistaken for heart disease or other serious problems, yet a careful physical exam of the ribs, spine, and sternum usually sorts them out without extensive testing.1Elsevier / ScienceDirect. Approach to Musculoskeletal Chest Wall Pain
Athletes and physically active people face an additional set of rib-area problems. Stress fractures of the ribs from repetitive motion have been reported across many sports, and the intercostal muscles between the ribs can be strained or torn, producing localized tenderness that can linger for weeks.2PubMed. Musculoskeletal problems of the chest wall in athletes Rowing, golf, and overhead throwing sports are common culprits, but even a violent sneeze can injure the intercostal muscles if they are already fatigued. The hallmark of musculoskeletal rib pain is that it is reproducible: you can usually find a position, movement, or spot on the chest wall that reliably triggers it, which distinguishes it from organ-related pain.
Slipping Rib Syndrome
Slipping rib syndrome deserves special mention because it is underdiagnosed and can cause months or years of unexplained pain under the lower ribs. The lower ribs (usually ribs eight through ten) are “false ribs” that attach to the rib above them by cartilage rather than directly to the breastbone. When that cartilage loosens or tears, the affected rib can slip underneath the one above it, irritating the intercostal nerve running between them.3PubMed Central. A Comprehensive Review of Slipping Rib Syndrome: Treatment and Management The result is a clicking or popping sensation along with sharp, sometimes debilitating pain in the upper abdomen or lower chest. Because the pain is felt in the belly rather than the chest wall, many people go through rounds of gastrointestinal workups before anyone examines the ribs carefully. A “hooking maneuver,” where a clinician curls their fingers under the rib margin and gently pulls outward, can reproduce the click and the pain, pointing to the diagnosis.
Gallbladder, Stomach, and Other Digestive Causes
Right-sided pain under the ribs is the textbook presentation of gallbladder trouble. Gallstones can block the bile duct, triggering waves of intense, cramping pain in the right upper abdomen that sometimes radiates to the right shoulder blade or between the shoulder blades. When the gallbladder becomes inflamed (acute cholecystitis), it is the single most common diagnosable cause of right upper quadrant pain in emergency departments. Yet more than a third of patients initially suspected of having acute cholecystitis turn out to have a different cause for their right-sided rib pain, including liver, kidney, pancreatic, or even lung conditions.4Radiographics. US of Right Upper Quadrant Pain in the Emergency Department: Diagnosing beyond Gallbladder and Biliary Disease
Peptic ulcers also cause pain in this zone. Gastric ulcers tend to produce pain on the left side under the ribs, while duodenal ulcers typically hurt in the center or right side. Both can radiate to the back. A study comparing where different upper-abdominal conditions produce pain found that gastric ulcer pain was left-sided in about 17 percent of cases, compared with only around 4 percent for duodenal ulcer, and pain radiating to the back occurred in roughly a third of peptic ulcer and biliary disease cases.5BMJ Journals. Chronic upper abdominal pain: site and radiation in various structural and functional disorders and the effect of various foods These patterns are useful clues but far from diagnostic on their own, because so many conditions overlap in where they hurt.
Acid reflux and gastritis can also create a burning or gnawing discomfort under the left ribs or in the upper-middle abdomen, often worse after meals or when lying down. The spleen sits under the left ribs as well, and while splenic problems are less common, an enlarged spleen from infection (such as mononucleosis) or blood disorders can cause a dull ache or feeling of fullness on the left side. The pancreas sits behind the stomach, so pancreatitis typically produces severe upper abdominal pain that bores straight through to the back and worsens after eating fatty food.
Kidney Stones and Pain That Wraps Around From the Back
Kidney stones are a classic cause of severe pain that starts in the back or flank, just below the ribs, and radiates forward or downward. The pain often comes in intense waves (renal colic) as the stone moves through the ureter. Alongside the pain, you may notice pink, red, or brown urine, and urination itself can be painful.6Asian Journal of Pharmaceutical Research and Development. A Brief Review On: Kidney Stone Because the kidneys sit against the back of the body, partially tucked under the lower ribs, kidney-stone pain is often felt “under the ribs” even though the problem is behind the rib cage rather than inside it.
One diagnostic trap with kidney stones is that they sometimes present as what feels like plain mechanical back pain, without the dramatic waves of colic or bloody urine that make the diagnosis obvious. A clinician may initially treat it as a back strain, and the patient may even feel temporary improvement with manual therapy or anti-inflammatories before the pain returns.7Journal of Chiropractic Clinical & Investigative Education (or Journal of Chiropractic Medicine / JCC). Atypical Presentation of Nephrolithiasis Giving Perception of Mechanical Back Pain: A Case Report If you have flank or posterior rib pain that does not improve as expected with rest, or if you notice any change in your urine, a urinalysis and imaging can quickly rule kidney stones in or out.
When the Heart Is the Real Source
Heart-related pain does not always announce itself with the dramatic left-arm-and-chest-crushing scenario people picture from movies. Angina and even heart attacks can produce discomfort that feels like it is under the ribs, in the upper abdomen, or in the pit of the stomach, particularly in women, older adults, and people with diabetes. Because of this overlap, doctors sometimes investigate the heart even when the pain seems clearly abdominal.
A Danish cohort study followed patients who had unexplained chest or upper abdominal pain after a normal endoscopy (meaning no stomach or esophageal explanation was found). Over ten years, those patients had about 60 percent higher risk of later being hospitalized for ischemic heart disease compared with controls. In the first year after the endoscopy, their mortality rate was more than double that of the comparison group.8PubMed Central. Unexplained chest/epigastric pain in patients with normal endoscopy as a predictor for ischemic heart disease and mortality: A Danish 10-year cohort study The takeaway is not that unexplained rib-area pain means you have heart disease, but that if your doctor cannot find a digestive or musculoskeletal explanation, a cardiac evaluation is a reasonable next step, especially if you have risk factors like high blood pressure, high cholesterol, smoking history, or a family history of early heart disease.
Lung and Diaphragm Problems
The lungs extend higher up behind the ribs than most people realize, and conditions such as pneumonia, a pulmonary embolism (blood clot in the lung), or pleurisy (inflammation of the lining around the lung) can all produce pain that feels like it is under or between the ribs. Pleuritic pain is characteristically sharp and worsens with breathing, which helps distinguish it from dull visceral pain. A collapsed lung (pneumothorax) can cause sudden sharp pain on the affected side along with shortness of breath, and while it is less common overall, it is more frequent in tall, thin young adults and in smokers.
The diaphragm is an often-forgotten pain generator. It sits like a dome between the chest and abdomen, and when it is irritated by infection, fluid, or a subdiaphragmatic abscess, the pain is referred elsewhere in the body rather than felt in the diaphragm itself.9JAMA. Importance of Phrenic Shoulder Pain in Disease Involving the Diaphragm The referred pain typically lands in the shoulder on the same side, which can be deeply confusing: a liver abscess irritating the right side of the diaphragm can make you think you have a shoulder injury. If you have rib-area pain accompanied by unexplained shoulder pain on the same side, the diaphragm may be the link.
Nerve-Related Causes
Shingles (herpes zoster) is a reactivation of the chickenpox virus in a nerve root, and the torso is the most common site. Before the trademark blistering rash appears, shingles can cause days of burning or stabbing pain in a band-like pattern along one side of the rib cage. During this pre-rash phase, the pain can mimic gallbladder disease, a heart attack, or a pulled muscle, depending on which nerve is involved. A case report documented a patient whose shingles presented as isolated left upper quadrant abdominal pain before the vesicles erupted, making initial diagnosis difficult.10PubMed Central. Shingles in Pregnancy: An Elusive Case of Left Upper Quadrant Abdominal Pain If you are over 50 or immunocompromised and develop new unilateral rib pain without an obvious cause, shingles should be on the radar even before a rash appears.
Intercostal neuralgia, or irritation of the nerves running between the ribs, can happen after chest surgery, trauma, or sometimes for no identifiable reason. Laparoscopic surgeries that require port sites through the abdominal wall occasionally damage an intercostal nerve, leading to chronic localized pain around the scar. In a small surgical series, patients who developed intercostal neuromas after laparoscopic gallbladder removal reported severe pre-operative pain scores that dropped significantly after targeted nerve treatment.11PubMed Central. Intercostal neuroma pain after laparoscopic cholecystectomy: diagnosis and treatment The pain from intercostal neuralgia is often burning or electric and may follow the path of the rib around one side of the body.
Functional Pain and Visceral Hypersensitivity
Sometimes all the tests come back normal and the pain persists. This does not mean the pain is imaginary. Visceral hypersensitivity is a recognized mechanism in which the nerves supplying the upper digestive tract become abnormally sensitive, so that normal events like stomach distension after a meal produce real pain signals. This has been identified as a major factor in functional dyspepsia and non-cardiac chest pain, conditions where the pain is genuine but no structural damage or disease explains it.12PubMed. Visceral hypersensitivity in functional disorders of the upper gastrointestinal tract
Functional pain syndromes under the ribs are frustrating for patients because the lack of a visible abnormality on scans or blood work can feel dismissive. But recognizing visceral hypersensitivity as the cause matters practically, because treatments aimed at calming nerve signaling (low-dose tricyclic antidepressants, for example) often help, while repeated imaging and invasive procedures do not. If you have been through multiple normal workups for persistent upper abdominal or lower chest pain, it is worth discussing functional pain with your doctor as a real diagnosis rather than a dead end.
Left Side Versus Right Side
The location of your pain narrows the list of likely causes, though no location is perfectly specific.
- Right side: Gallbladder disease, liver conditions (hepatitis, abscess, congestion from heart failure), right kidney stones, right-lower-lobe pneumonia, and sometimes appendicitis (though appendicitis typically presents lower in the abdomen).
- Left side: Splenic enlargement or rupture, gastric ulcers, pancreatitis (often felt on both sides or centrally), left kidney stones, and left-lower-lobe pneumonia.
- Both sides or centrally: Costochondritis, acid reflux, peptic ulcer disease, cardiac causes, and musculoskeletal strain.
Rare anatomical variants can throw these patterns off. In congenital intestinal malrotation, the appendix sits on the left side of the abdomen rather than the right, meaning acute appendicitis can present as left upper quadrant pain instead of the classic right lower quadrant location.13Europe PMC. Acute appendicitis presenting as unusual left upper quadrant pain Situs inversus, where the internal organs are mirror-reversed, is another rarity that can make right-sided organ problems show up on the left. These are uncommon enough that they should not keep you up at night, but they are worth knowing about if your pain does not match any typical pattern.
How Doctors Sort It Out
When you arrive at a clinic or emergency department with rib-area pain, the first step is nearly always a history and physical exam. Where exactly the pain is, what makes it better or worse, how it started, and what other symptoms accompany it guide the initial workup. A pain that is reproducible by pressing on the chest wall points toward a musculoskeletal cause and may not need imaging at all. Pain with fever, vomiting, or abnormal vital signs pushes the evaluation toward blood work and imaging.
Ultrasound is often the first imaging study for right-sided pain because it is fast, radiation-free, and good at visualizing the gallbladder, liver, and kidneys. CT scans offer a broader and more detailed view. In a head-to-head comparison, CT was substantially more sensitive than ultrasound for detecting appendicitis (94 percent versus 76 percent) and diverticulitis (81 percent versus 61 percent), while both were similarly accurate for cholecystitis at about 73 percent.14PubMed Central. A comparison of the Accuracy of Ultrasound and Computed Tomography in common diagnoses causing acute abdominal pain Your doctor may start with ultrasound and escalate to CT if the picture is unclear, or go straight to CT if the clinical suspicion is high for something ultrasound handles poorly.
Blood tests add another layer. Liver enzymes and bilirubin point toward hepatobiliary disease. Lipase flags pancreatitis. A complete blood count can reveal infection or anemia. Troponin levels check for heart damage. A urinalysis catches kidney stones and urinary infections. None of these tests alone is definitive, but together with imaging and the clinical picture, they usually point to a diagnosis.
When to Seek Urgent Care
Most under-rib pain is not an emergency, but certain features should prompt you to get evaluated quickly rather than waiting it out. Seek same-day or emergency medical attention if your pain comes with any of these:
- Sudden, severe onset: Pain that hits like a switch was flipped, especially with lightheadedness, could signal a ruptured organ, aortic dissection, or pulmonary embolism.
- Shortness of breath: Pain plus difficulty breathing raises concern for a lung or cardiac problem.
- Fever and chills: Pain with systemic signs of infection suggests something like cholecystitis, appendicitis, pneumonia, or an abscess.
- Vomiting blood or black stools: These point to bleeding in the upper digestive tract, possibly from an ulcer.
- Jaundice: Yellowing of the skin or eyes alongside rib pain suggests a bile duct obstruction or liver problem.
- Pain radiating to the jaw, left arm, or both shoulders: This pattern raises concern for a cardiac event, especially with sweating or nausea.
- Known trauma: A blow to the chest or abdomen followed by worsening pain could mean a rib fracture or, less commonly, a lacerated spleen or liver.
Pain that is mild, reproducible by pressing on the chest wall, and not accompanied by any of the above features is far more likely to be musculoskeletal. It still warrants a medical visit if it persists beyond a couple of weeks, wakes you from sleep, or is progressively worsening, but it is reasonable to try over-the-counter anti-inflammatories and rest as a first step in the absence of red flags.
Pain That Lingers After Everything Tests Normal
A surprisingly common scenario is chronic or recurring pain under the ribs after a full workup shows nothing alarming. People in this situation sometimes cycle through multiple specialists, each ordering their own imaging, and emerge without a clear label for the problem. Several overlooked diagnoses are worth considering at this stage. Slipping rib syndrome, as described earlier, is frequently missed because it requires a specific physical exam maneuver that not all clinicians perform routinely. Chronic costochondritis can persist for months. Thoracic spine dysfunction, where stiffness or misalignment in the mid-back affects the nerves that supply the rib area, is another underappreciated contributor. And visceral hypersensitivity may be the explanation when the pain is centered in the upper abdomen and linked to eating.
Post-surgical nerve pain is worth flagging for anyone whose rib-area discomfort started after a procedure. Laparoscopic surgeries use small incisions, but those incisions still pass through the abdominal wall near intercostal nerves. If pain appears near a port site weeks or months after surgery and has a burning or shooting quality, an intercostal neuroma is a possibility that a pain specialist can evaluate. The prognosis with targeted treatment can be quite good once the problem is identified.