Pain under your right rib cage usually comes from one of the organs sitting behind it: the gallbladder, liver, or the bend in your colon where it tucks under your ribs on the right side. Less commonly, it can stem from the muscles between your ribs, your right lung lining, or even a kidney. The cause matters because some of these are harmless and temporary while others need prompt treatment.
Gallbladder Problems Are the Most Common Cause
The gallbladder sits directly beneath your right rib cage, and gallstones are the single most frequent reason for sharp pain in that area. When a stone blocks one of the ducts leading out of the gallbladder, you’ll feel sudden, rapidly intensifying pain in the upper right abdomen that can radiate to your back between the shoulder blades or into your right shoulder. This pain typically hits after meals, especially fatty ones, and lasts anywhere from several minutes to a few hours before easing off.
If a stone gets stuck in the neck of the gallbladder itself, the organ becomes inflamed, a condition called cholecystitis. This is a step up in severity: the pain doesn’t go away on its own, and you’ll likely develop a fever. During a physical exam, a doctor will press under your right ribs while you take a deep breath. If the inflamed gallbladder contacts the examiner’s hand and causes a spike of pain, that’s a classic positive finding that points strongly toward cholecystitis. Ultrasound is the first imaging test doctors order for right upper quadrant pain, largely because it’s so effective at spotting gallstones and gallbladder inflammation.
Trapped Gas Can Mimic Organ Pain
Your large intestine makes a sharp turn just under your right ribs, a bend called the hepatic flexure. Gas that collects at this bend can create pressure and pain that feels remarkably similar to gallbladder disease or even appendicitis, according to Johns Hopkins Medicine. The key difference is that this pain tends to shift, improve after passing gas or having a bowel movement, and doesn’t come with fever or vomiting. It’s one of the most common benign explanations for occasional right-sided rib pain, and it’s worth considering before assuming the worst.
Liver Conditions
The liver fills most of the space behind your right rib cage, and when it’s inflamed or enlarged, it stretches the capsule surrounding it, producing a deep, dull ache. Chronic liver conditions cause upper abdominal pain in a surprisingly large number of people. In one study, 45% of people with hepatitis C reported upper abdominal pain within the past month, compared to 20% of people without liver disease. Both the hepatitis group and a broader liver disease group were far more likely to report pain that worsened after eating (roughly 23 to 27%) compared to just 1.6% of healthy controls.
Fatty liver disease, which is increasingly common and linked to excess weight and metabolic issues, can produce the same kind of discomfort. The pain is usually more of a persistent heaviness than a sharp stab, and it doesn’t change much with position or breathing.
Muscle Strain Between the Ribs
The muscles between your ribs, called intercostal muscles, can strain from sudden twisting, heavy lifting, a hard cough, or a direct blow to the chest. This type of pain is usually easy to distinguish from organ pain because you can pinpoint it with a finger, and it gets worse with coughing, sneezing, deep breathing, or twisting your torso. You may also feel tenderness when you press on the affected area, along with stiffness and muscle tension.
A hallmark of muscular rib pain is that it typically traces back to a specific event: a workout, a fall, a bout of forceful coughing. Organ-related pain, by contrast, tends to appear without an obvious physical trigger. Some people with intercostal strain unconsciously shift to short, shallow breaths to avoid aggravating the injury, which can feel alarming but isn’t dangerous. Imaging isn’t usually needed for a muscle strain, though an X-ray or MRI may be ordered to rule out a rib fracture or internal injury.
Lung and Pleura Issues
Your right lung extends down to the lower rib cage, and the membrane lining it (the pleura) has pain receptors that fire when inflamed or irritated. This is what happens with pleurisy, an inflammation of the pleural lining. The pain is sharp, well-localized, and distinctly worse when you breathe in. You or your doctor may hear a scratching or friction sound during breathing.
Pneumonia in the lower right lung can produce similar symptoms, along with fever, productive cough, and shortness of breath. The pain from pleurisy or pneumonia tends to feel more “chest wall” than “abdominal,” and the clear link to breathing helps separate it from gallbladder or liver causes.
Kidney Stones
A stone in the right kidney or ureter can sometimes radiate pain toward the front of the body, overlapping with the area under the right ribs. Kidney stone pain more commonly centers in the lower back, belly, or side and often extends toward the groin. It’s typically severe and comes in waves. If your pain started in your back or flank and seems to wrap around to the front, especially if you notice changes in urination or blood in your urine, a kidney stone is worth considering.
Right Rib Pain During Pregnancy
If you’re pregnant and experiencing pain under your right ribs, particularly in the second half of pregnancy, it deserves extra attention. HELLP syndrome is a rare but serious complication that affects the blood and liver, and right upper abdominal pain is one of its hallmark symptoms. Other signs include headache, blurred vision, nausea, swelling with rapid weight gain, pain when breathing deeply, and fatigue. In severe cases, imaging may reveal an enlarged or bleeding liver. HELLP syndrome is a medical emergency that requires immediate care.
Signs That Need Immediate Attention
Most right-sided rib pain turns out to be gas, a muscle strain, or a mild gallbladder episode that resolves. But certain combinations of symptoms point to something more urgent. Seek medical care if your pain is severe or steadily worsening, or if it comes with any of these:
- High fever, which can signal an active infection like cholecystitis, a liver abscess, or pneumonia
- Yellowing of your skin or eyes (jaundice), which suggests a bile duct blockage or liver problem
- Blood in your stool or vomit
- Dizziness or confusion
- Trouble breathing or a tight, squeezing sensation, which can occasionally indicate a cardiac issue even when the pain seems abdominal
- Visible swelling in your abdomen
Pain that wakes you from sleep, prevents you from finding a comfortable position, or lasts more than a few hours without improvement is also worth having evaluated. An ultrasound is typically the first step, and it can quickly clarify whether the gallbladder, liver, or kidneys are involved.

