What Can Cause Pain Under the Right Rib Cage?

Pain under the right rib cage has dozens of possible causes, ranging from a gallstone lodged in the bile duct to a pulled muscle between the ribs. The gallbladder is the single most common culprit doctors investigate first, but the liver, right kidney, lower lung, intestines, and even the chest wall itself can all generate pain in that same zone. Because so many organs sit beneath or near the right rib margin, the location alone rarely tells you what is wrong, and some causes that seem unlikely at first glance turn out to be surprisingly common.

Gallbladder Problems

The gallbladder sits tucked under the liver, right behind the lower ribs on your right side, so it is the organ most closely associated with pain in this area. The classic scenario is biliary colic: a gallstone gets stuck in the neck of the gallbladder or the duct leading away from it, blocking bile from flowing out. The gallbladder squeezes against the obstruction, pressure inside spikes, and the wall stretches, producing severe pain in the right upper abdomen that can radiate to the right shoulder or between the shoulder blades.1Europe PMC. ABC of the upper gastrointestinal tract. Upper abdominal pain: Gall bladder If the stone dislodges on its own, the pain fades within a few hours. If it stays put and inflammation sets in, the situation escalates to acute cholecystitis, which brings continuous pain, fever, and tenderness that worsens when you press under the right ribs and take a deep breath.

Not every gallbladder attack involves stones. Acalculous cholecystitis, inflammation without any visible stone, accounts for a meaningful fraction of gallbladder emergencies and tends to appear in people who are already critically ill or hospitalized. Gallbladder sludge, a thick mixture of bile crystals and mucus, can also irritate the gallbladder wall and produce milder but recurrent discomfort under the right ribs after meals, especially fatty ones.

Liver-Related Causes

The liver itself does not have many pain receptors inside its tissue, but it is wrapped in a thin capsule called Glisson’s capsule, and anything that stretches that capsule causes a deep, aching pain under the right ribs. Hepatitis, whether viral, alcoholic, or drug-induced, can swell the liver enough to produce this stretch. The same mechanism explains why a liver abscess, a pocket of infection inside the liver, generates right upper quadrant pain along with fever and general malaise. In one review of amebic liver abscesses, the typical patient presented with right upper quadrant pain and fever lasting about nine days, along with a tender, enlarged liver on examination.2JAMA Surgery. Amebic Liver Abscess

Liver abscesses can be caused by parasites like the ameba just mentioned, by bacteria that travel from the bile duct or intestines, or occasionally by a fungal infection in people with weakened immune systems. These infections are more common in tropical regions or in people who have recently traveled to areas where parasitic infections are endemic, but bacterial liver abscesses occur worldwide, particularly in people with biliary tract disease or diabetes.

Heart Failure and Liver Congestion

One cause of right-rib-cage pain that surprises people is heart failure. When the right side of the heart cannot pump blood forward efficiently, pressure backs up into the veins draining the liver. The liver swells with blood, its capsule stretches, and the result is a dull, constant ache under the right ribs. This hepatic congestion, driven by elevated right-sided cardiac filling pressures, leads to stretching of Glisson’s capsule and frequently causes right upper quadrant pain and tenderness.3PubMed Central. Liver complications in patients with congestive heart failure If you already know you have heart failure and notice a new ache under your right ribs that worsens with swollen legs and shortness of breath, the liver is a likely source.

Kidney and Urinary Tract Problems

The right kidney sits behind the abdominal cavity, just below the lower ribs toward the back. A kidney stone moving through the right ureter can produce intense, colicky pain that starts in the flank and wraps around toward the front of the abdomen, sometimes settling under the right ribs. Acute pyelonephritis, a bacterial kidney infection, tends to cause a steadier ache in the flank with high fever, chills, and painful urination. On ultrasound, kidney stones show up as bright spots that cast a shadow behind them, while an infected kidney may look swollen with blurred internal detail, though clinical and lab findings are essential to confirm either diagnosis.4PubMed Central. Ultrasonography of acute flank pain: a focus on renal stones and acute pyelonephritis

The distinguishing clue is often the character of the pain. Kidney stone pain comes in waves and tends to make you restless, unable to find a comfortable position. It frequently radiates into the groin or inner thigh. By contrast, gallbladder pain is more localized to the upper abdomen and is often triggered by eating. Both can be severe enough to send you to the emergency room, and imaging usually sorts them out quickly.

Gastrointestinal Causes Beyond the Gallbladder

The first part of the small intestine, the duodenum, curves around just behind the right rib margin, and ulcers there can produce pain that mimics gallbladder or even chest disease. In one documented case, a man with a duodenal ulcer presented with severe throbbing pain in his right lateral chest and underwent extensive imaging that found no lung or heart abnormality. It was only when he developed vomiting and an endoscopy was performed that a duodenal ulcer was discovered. Treating the ulcer with acid-suppressing medication resolved both the abdominal and chest pain.5PubMed Central. Duodenal ulcer accompanied by intractable right lateral chest pain (T6/T7 dermatomal segments) That case illustrates how visceral pain from the gut can be “referred” to surprising locations because the nerves serving the intestines share pathways with nerves serving the chest wall.

Other GI sources of right-sided rib-area pain include trapped gas in the hepatic flexure, the sharp bend where the colon turns beneath the liver. Colonic distension at this bend can create pressure and bloating that feels like something is wrong under the ribs but resolves once the gas passes. Irritable bowel syndrome can produce similar discomfort, often described as crampy or shifting.

Musculoskeletal Pain From the Rib Cage Itself

Sometimes the pain genuinely comes from the ribs and the tissue between them, not from any organ underneath. Costochondritis, inflammation where a rib attaches to its cartilage near the breastbone, can cause sharp, localized pain that worsens with twisting or pressing on the spot. A more elusive diagnosis is slipping rib syndrome, caused by abnormal mobility of the lower ribs, specifically ribs eight through twelve, which are not directly connected to the breastbone and instead attach to each other with ligaments.6PubMed Central. Slipping Rib Syndrome in a Female Adult with Longstanding Intractable Upper Abdominal Pain When one of these ribs slips over the one next to it during certain movements or abdominal muscle contractions, the result is a clicking sensation and sharp pain that can be reproduced by specific postures.7PubMed. Slipping rib syndrome: a place for sonography in the diagnosis of a frequently overlooked cause of abdominal or low thoracic pain

Slipping rib syndrome is often missed for years because imaging of the organs comes back normal and the pain gets chalked up to something unexplained. The key tip-off is that the pain is reproducible with certain physical movements and can be triggered by hooking a finger under the rib margin and pulling forward. If standard workups keep finding nothing, a targeted physical exam for rib hypermobility is worth requesting.

Lung and Pleural Problems

The base of the right lung extends down to roughly the level of the sixth rib, and the pleura, the membrane lining the lung and chest cavity, dips even lower. Pleurisy, inflammation of the pleura, causes sharp pain that worsens with each breath and can easily be mistaken for an abdominal problem when it affects the lower pleura. Pneumonia in the right lower lobe is a well-known mimic of abdominal disease. The pain from pleurisy or pneumonia is usually felt in the chest and on the affected side, but it can be referred to remote locations, including the abdomen.8JAMA. Abdominal Pain in Pleurisy and Pneumonia Children with right lower lobe pneumonia are especially prone to presenting with abdominal pain rather than cough, sometimes leading to unnecessary surgical consultations before a chest X-ray reveals the real problem.

A pulmonary embolism, a blood clot in the lung, can also cause pain under the right ribs when the clot lodges in a branch of the right pulmonary artery. This typically comes with sudden shortness of breath and a fast heart rate. It is a medical emergency and one reason that unexplained right-sided pain with breathing difficulty warrants prompt evaluation.

Pelvic Infections That Mimic Gallbladder Disease

One of the more surprising causes of right-upper-quadrant pain, particularly in younger women, is Fitz-Hugh-Curtis syndrome. This condition develops as a complication of pelvic inflammatory disease, usually from chlamydia or gonorrhea, when the infection ascends from the pelvis and causes inflammation around the liver capsule.9PubMed Central. A Diagnosis Not to Miss: A Case of Fitz-Hugh-Curtis Syndrome The pain can be acute, mimicking gallbladder disease convincingly enough that patients sometimes undergo gallbladder ultrasound or even surgery before the real diagnosis surfaces.

A complicating factor is that genital symptoms are not always present, so neither the patient nor the treating doctor may think to look for a pelvic source. In one reported case, a young woman presented with right upper quadrant pain lasting two months without any obvious genitourinary complaints. The diagnosis requires a high index of suspicion in the right clinical context: a young, sexually active woman with right upper quadrant pain and no gallstones on imaging.10PubMed Central. Fitz-Hugh-Curtis Syndrome: A Diagnosis to Consider in a Woman with Right Upper Quadrant Abdominal Pain without Gallstones Antibiotics for the underlying pelvic infection typically resolve the abdominal pain as well.

The Exercise Side Stitch

If your right-rib-cage pain only shows up during running or vigorous exercise and disappears soon after you stop, the most likely explanation is the common side stitch. Research suggests that drinking fluid before exercise makes this worse, and the prevailing theory is that the fluid-filled gut tugs on the ligaments connecting the abdominal organs to the diaphragm. Bending forward while tightening the abdominal muscles, tightening a belt around the waist, or breathing through pursed lips with increased lung volume relieved the stitch within seconds in one study, while trying to relax the abdominal muscles or changing foot-strike patterns did not help.11PubMed Central. Investigation of the side pain “stitch” induced by running after fluid ingestion The side stitch is annoying but harmless. If your pain during exercise is accompanied by shortness of breath, dizziness, or chest tightness, that warrants a different evaluation entirely.

Post-Procedural and Traumatic Pain

Blunt trauma to the right side of the torso, from a car accident, a fall, or a contact sport, can fracture the lower ribs or bruise or lacerate the liver. Even without obvious trauma, certain medical procedures can leave you with right-rib-cage pain. Percutaneous liver biopsy, where a needle is inserted through the skin into the liver to collect a tissue sample, causes abdominal pain severe enough to require pain medication in roughly one in five patients.12PubMed Central. Evaluation of Percutaneous Liver Biopsy Complications in Patients with Chronic Viral Hepatitis Rare but serious complications include subcapsular hematoma and delayed liver rupture, which in one case did not manifest until a full week after the biopsy, presenting as sudden-onset right upper quadrant pain.13PubMed Central. Delayed hepatic rupture post ultrasound-guided percutaneous liver biopsy: A case report Anyone who develops new or worsening right-sided pain in the days following a liver biopsy or abdominal procedure should contact their doctor promptly.

Less Common and Congenital Causes

Some causes are rare but worth knowing about, especially for parents. A choledochal cyst, a congenital dilation of the bile duct, can cause intermittent right upper quadrant pain in children and adolescents. In one case, a fourteen-year-old boy had experienced vague abdominal pain, predominantly under the right ribs, along with poor appetite for five years before the cyst was identified.14PubMed Central. Choledochal cyst: A challenging diagnostic and therapeutic entity in low-resource settings Choledochal cysts are uncommon but important to diagnose because they carry a risk of bile-duct cancer if left untreated into adulthood. In children with chronic right-sided abdominal pain that does not fit the usual diagnoses, this possibility may be worth imaging for.

Other uncommon causes include right adrenal gland tumors or hemorrhage, Budd-Chiari syndrome (blood clots in the hepatic veins causing liver congestion and pain), and intercostal neuralgia, where a nerve running between two ribs becomes irritated or trapped, producing a band-like burning or stabbing pain along the rib.

How Doctors Figure Out the Cause

With so many possible sources, the diagnostic process usually starts with the physical exam. A structured approach using inspection, percussion, and careful palpation with targeted maneuvers helps narrow down the organ involved.15Academic Press. Abdominal Pain Murphy’s sign, where pain sharpens when you press under the right ribs and the patient breathes in, is a classic indicator of gallbladder inflammation. Carnett’s sign, where tenderness increases when the patient tenses the abdominal wall, points to a chest-wall or musculoskeletal source rather than an organ underneath. In at least one case of Fitz-Hugh-Curtis syndrome, both Murphy’s and Carnett’s signs were positive, illustrating how overlapping findings can complicate the picture.16JOURNAL OF HOSPITAL GENERAL MEDICINE. Persistent Right Upper Quadrant Pain due to Fitz-Hugh Curtis Syndrome Successfully Treated with Supportive Use of Saireito

Imaging comes next, and the first-line study for right upper quadrant pain in most emergency departments is ultrasound, which is quick, radiation-free, and good at identifying gallstones and gallbladder inflammation. However, CT has a distinct advantage when the problem is not the gallbladder. In a retrospective review of more than 2,800 emergency cases with right upper quadrant pain, ultrasound and CT performed similarly for diagnosing cholecystitis, but CT detected acute non-gallbladder abnormalities that ultrasound missed in about a third of cases where both were performed.17PubMed. Role of Ultrasound and CT in the Workup of Right Upper Quadrant Pain in Adults in the Emergency Department: A Retrospective Review of More Than 2800 Cases That finding matters because it means an ultrasound that comes back “normal” does not necessarily rule out a serious non-gallbladder cause, and your doctor may reasonably follow up with a CT if the clinical picture does not add up.

When to Take It Seriously

Most episodes of right-rib-cage pain turn out to be benign, but certain features warrant urgent evaluation. Fever with right upper quadrant pain suggests infection, whether in the gallbladder, liver, kidney, or lung. Yellowing of the skin or eyes alongside the pain raises concern for a bile duct obstruction or liver disease. Sudden, severe pain after trauma needs imaging to rule out organ injury. Pain that worsens with every breath and comes with shortness of breath could indicate a pulmonary embolism or lower-lobe pneumonia. And steady, unrelenting pain that keeps getting worse over hours rather than coming and going is more characteristic of a surgical emergency than a self-limited problem.

On the other hand, pain that is sharp, fleeting, and reproducible by pressing on a specific spot along the rib margin is more likely musculoskeletal. Pain that only appears after large meals and settles within a few hours fits a gallbladder pattern but is not an emergency if it resolves. And transient pain with exercise that vanishes at rest is almost always the benign side stitch. Knowing these patterns will not replace a medical evaluation, but they can help you describe your symptoms accurately and give your doctor a faster route to the right diagnosis.