Pain under the right rib cage most commonly comes from the gallbladder, liver, or the muscles and cartilage of the rib cage itself. Less often, it originates from the right kidney, colon, or even the lung. Because several organs sit in this area, the cause can range from a temporary muscle strain to a condition that needs prompt treatment.
What Sits Under Your Right Rib Cage
The right upper abdomen is one of the most organ-dense areas of your body. Your liver fills most of the space directly behind and below the right ribs. The gallbladder tucks underneath the liver. The right kidney sits toward the back, and the upper portion of the colon curves through this region. The lower edge of the right lung and the diaphragm sit just above. Pain in this area could involve any of these structures, and the specific location, timing, and quality of the pain help narrow down the source.
Gallbladder Problems: The Most Common Cause
Gallstones and gallbladder inflammation account for a large share of right-under-the-rib pain. The two main conditions, biliary colic and cholecystitis, feel similar but differ in important ways.
Biliary colic happens when a gallstone temporarily blocks the duct that carries bile out of the gallbladder. The pain tends to hit the mid-upper abdomen and radiate to the back or under the right shoulder blade. It often starts after a fatty meal, builds over 15 to 60 minutes, and then fades within a few hours.
Acute cholecystitis is more serious. It occurs when a stone blocks the duct and stays stuck, causing the gallbladder wall to swell. The pain is sharper, more severe, and lasts six hours or longer. Breathing deeply makes it worse. Nausea, vomiting, fever, and chills are common, and the abdominal muscles on the right side may feel stiff and rigid within a few hours. Chronic cholecystitis produces milder, recurring episodes of the same kind of pain, usually without fever.
One distinctive feature of gallbladder pain is referred shoulder pain. When the inflamed gallbladder irritates the diaphragm, pain signals travel along the same nerve pathway that serves the right shoulder, so you may feel an ache between the shoulder blades or at the top of the right shoulder even though the problem is in your abdomen.
Liver Conditions
The liver itself has no pain-sensing nerves inside it. Pain comes from the thin capsule that wraps around the organ. When the liver swells, whether from hepatitis, fatty liver disease, or a growing mass, it stretches that capsule and produces a dull, aching sensation in the right upper abdomen. The pain tends to be constant rather than sharp, and it often feels more like pressure or heaviness than the cramping you would get from a gallstone.
Fatty liver disease is worth noting because it is extremely common and often has no symptoms until the liver becomes significantly enlarged. Viral hepatitis, on the other hand, can cause more noticeable right-sided rib pain alongside fatigue, nausea, and sometimes yellowing of the skin or eyes.
Kidney Stones and Infections
The right kidney sits behind the liver, closer to your back. A kidney stone lodged on the right side produces sharp pain in the lower back or flank that can radiate down toward the lower abdomen and groin. This is the key difference from gallbladder pain: kidney stone pain starts lower and moves downward, while gallbladder pain starts higher and moves toward the shoulder or mid-back.
A kidney infection (pyelonephritis) causes a deep, steady ache in the back below the ribs, usually with fever, painful urination, and sometimes blood in the urine. Because the pain wraps around the side, it can overlap with what feels like pain “under the ribs.”
Musculoskeletal Causes
Not all right rib pain comes from an organ. Muscle strains from heavy lifting, twisting, or even a prolonged cough can produce sharp or aching pain along the rib cage. This type of pain worsens with specific movements, pressing on the sore spot, or taking a deep breath, and it usually improves with rest over days to weeks.
Costochondritis, an inflammation of the cartilage connecting the ribs to the breastbone, causes similar pain that sharpens with breathing, coughing, or chest wall movement. It most commonly affects the left side of the breastbone, but it can occur on the right side or affect multiple ribs at once. The hallmark is tenderness right at the point where rib meets cartilage. There is no fever, no nausea, and the pain reproduces when you press on the spot.
Less Common Causes
Pneumonia in the lower right lung can cause pain that feels like it is coming from under the ribs, especially when breathing deeply or coughing. A pulmonary embolism (a blood clot in the lung) can do the same, often accompanied by sudden shortness of breath. Colitis or diverticulitis in the upper portion of the colon occasionally produces right upper abdominal pain as well, though these more commonly affect the lower abdomen.
How to Tell the Difference
The timing, location, and quality of your pain offer the best initial clues:
- Sharp pain after eating that radiates to the back or shoulder blade points toward the gallbladder.
- Dull, constant aching or heaviness suggests the liver.
- Flank pain radiating downward toward the groin is more typical of a kidney stone.
- Pain that worsens with movement or pressing on the ribs and improves with rest is likely musculoskeletal.
- Pain with cough, fever, and shortness of breath raises the possibility of a lung issue.
An abdominal ultrasound is the standard first imaging test for undiagnosed right upper quadrant pain. It can detect gallstones, gallbladder wall thickening, fluid around the gallbladder, bile duct problems, and liver abnormalities in a single, noninvasive scan. The American College of Radiology rates it as the appropriate initial study both for suspected biliary disease and for right upper quadrant pain of unknown cause.
Signs That Need Urgent Attention
Most right-sided rib pain turns out to be something manageable, but certain warning signs change the equation. Seek immediate care if you experience severe pain that does not improve or is steadily worsening, pain that spreads upward toward your chest, neck, or shoulder, vomiting blood, shortness of breath, blood in your urine or stool, yellowing of the skin or whites of the eyes, high fever or chills, or unexplained weight loss. These can signal a perforated gallbladder, a blood clot in the lung, advanced liver disease, or another condition where timing matters.