The right rib cage shelters several major organs, with the liver taking up most of the space. Directly beneath and behind the lower right ribs sit the liver, the gallbladder, the upper portion of the right kidney, and parts of the colon and small intestine. Discomfort in this area can stem from any of these structures, and sometimes from organs you would not expect, like the right lung.
The Liver Takes Up Most of the Space
The liver is the largest solid organ in the body, weighing roughly three pounds in an average adult. It fills much of the right upper abdomen, extending from just below the right nipple line down to the lower margin of the rib cage. The organ is tucked snugly against the underside of the diaphragm, which is why deep breathing can sometimes shift the sensation of liver-related discomfort. Because of its size, the liver is the structure most people are feeling when they press below their right ribs.
The liver handles hundreds of metabolic tasks: filtering blood arriving from the digestive tract, producing bile for fat digestion, storing glycogen for energy, and clearing toxins. Despite all this metabolic activity, the liver tissue itself has almost no pain-sensing nerve fibers. Pain signals come instead from its outer wrapping, a thin fibrous membrane called Glisson’s capsule. When the liver swells from inflammation, fatty buildup, or congestion, that capsule stretches, and stretching is what you feel as a dull ache or pressure under the right ribs.
The Gallbladder Sits Just Below the Liver
Nestled against the underside of the liver is the gallbladder, a small pear-shaped sac about seven to ten centimeters long. Its job is to store and concentrate bile produced by the liver, then release it into the small intestine after a meal to help digest fats. Most of the time you are completely unaware of it. Problems arise when gallstones form or when the gallbladder wall becomes inflamed.
Gallstones are hardened deposits of cholesterol or bilirubin that can block the duct leading out of the gallbladder. When a stone lodges in that duct, the result is a sudden, intense pain in the right upper abdomen that often radiates to the right shoulder blade. This is biliary colic, and it typically hits after a fatty meal. If the blockage persists, the gallbladder wall swells and becomes infected, a condition called acute cholecystitis. Acute cholecystitis is one of the most common reasons people show up to an emergency department with right upper quadrant pain.1ScienceDirect. Acute Cholecystitis Detected by Serial Emergency Department Focused Right Upper Quadrant Ultrasound The pain tends to be steady rather than crampy, worsens with movement or pressing on the area, and may come with fever and nausea.
The Right Kidney and Adrenal Gland
The right kidney sits toward the back of the abdominal cavity, partly protected by the lowest ribs. It is slightly lower than the left kidney because the liver pushes it down. Above the kidney perches the right adrenal gland, a small triangular structure responsible for producing hormones like cortisol and adrenaline.
Kidney-related pain usually shows up as a deep ache in the flank, the area between the lower ribs and the hip on your right side, rather than directly under the front of the rib cage. Kidney stones moving through the ureter can produce sharp, wave-like pain that starts in the back and radiates forward and down toward the groin. Kidney infections tend to cause a constant, tender ache in the flank accompanied by fever and painful urination. Because the kidney sits so far back, people sometimes mistake kidney pain for a back problem rather than an abdominal one.
Parts of the Colon and Small Intestine
The hepatic flexure of the colon, the sharp bend where the ascending colon turns into the transverse colon, lives right under the liver. Gas trapped at this bend can produce surprising discomfort that feels like something is wrong with the liver or gallbladder. This phenomenon is sometimes called hepatic flexure syndrome, and it can mimic the pain of more serious conditions. Passing gas or having a bowel movement usually brings relief.
The duodenum, the first section of the small intestine, also curves through the right upper abdomen. Peptic ulcers in the duodenum can cause a burning or gnawing pain just below the rib cage that worsens on an empty stomach and improves briefly after eating. Because the duodenum wraps around the head of the pancreas, inflammation in that area can occasionally refer discomfort to the right side as well, though pancreatic pain more commonly presents in the center or left of the upper abdomen.
How the Liver Produces Pain Through Its Capsule
Because liver tissue lacks its own pain receptors, the mechanism behind liver-related discomfort is almost entirely about capsule stretch. Glisson’s capsule is a thin collagen-rich membrane that envelops the entire liver. In healthy tissue, the capsule is roughly 70 micrometers thick. In people with advanced liver scarring (cirrhosis), the capsule can become more than three times thicker, reflecting substantial structural remodeling in the diseased organ.2Elsevier. Glisson’s capsule matrix structure and function is altered in patients with cirrhosis irrespective of aetiology That thickening matters because a structurally altered capsule may respond differently to pressure changes as the liver swells or shrinks with disease progression.
Conditions that enlarge the liver and stretch the capsule include hepatitis (viral or alcohol-related), fatty liver disease, congestive heart failure (where blood backs up into the liver), and liver tumors. The pain from capsule stretch is typically dull and constant rather than sharp, and it can be hard to pinpoint because the capsule does not localize sensation very precisely. Some people describe it as a sense of fullness or heaviness rather than outright pain. Rapidly worsening swelling, such as from acute hepatitis, tends to produce more noticeable discomfort than slow, gradual enlargement.
When the Pain Is Actually Coming from the Lungs
One of the more surprising sources of right upper abdominal pain has nothing to do with the abdomen at all. The lower lobes of the lungs rest directly on top of the diaphragm, and when infection or inflammation involves those lower lobes, the irritation can travel along nerve pathways that trick the brain into sensing pain in the upper belly. This happens because the phrenic nerve, which innervates the diaphragm, shares spinal cord connections with nerves that supply the upper abdomen. The result is referred pain that can closely mimic a gallbladder attack or liver problem.3Cureus. A Curious Case of Abdominal Pain: Coexisting Left Lower Lobe Pneumonia and Helicobacter pylori-Positive Erosive Gastritis
Right lower lobe pneumonia is a classic culprit. A person may arrive at a clinic complaining of pain below the right ribs, and imaging reveals not a gallbladder problem but a patch of infection at the base of the right lung. Pulmonary embolism, a blood clot in the lung’s arterial system, can also produce right-sided chest and upper abdominal pain, especially if the clot affects the lower lung. Pleurisy, inflammation of the membrane lining the lungs, is another possibility. In all these cases, the pain tends to worsen with deep breathing or coughing, which can help distinguish it from purely abdominal causes.
Rib Cage and Muscle Wall Pain
Not everything that hurts under the right rib cage comes from an internal organ. The rib cage itself is a complex structure of bone, cartilage, muscle, and connective tissue, and any of those components can become a pain source. Costochondritis, an inflammation of the cartilage that connects the ribs to the breastbone, can produce tenderness along the front of the chest wall that worsens with pressing, twisting, or deep breathing. While costochondritis more often affects the left side, it can occur on the right side as well, and people sometimes worry they have a liver or gallbladder problem when the cause is purely musculoskeletal.
Intercostal muscle strains, caused by heavy lifting, vigorous coughing, or sudden twisting movements, produce sharp pain that worsens with specific motions. A stress fracture or bruised rib can feel similar. The distinguishing feature of musculoskeletal pain is usually its relationship to movement and touch: pressing on the sore spot reproduces the pain, and changing position makes it better or worse. Internal organ pain generally does not change with pressing on the overlying ribs.
Shingles deserves a mention here because it often goes unrecognized in its early stages. Before the characteristic rash appears, the reactivated varicella-zoster virus can cause a burning or tingling pain along one side of the rib cage that can last days. In that early window, the pain can be mistaken for a gallbladder or kidney problem. Once the blistering rash shows up along a band-like strip of skin, the diagnosis becomes more obvious.
How Doctors Sort Through the Possibilities
The right upper quadrant of the abdomen contains enough overlapping anatomy that evaluating pain there follows a systematic approach.4Elsevier. Evaluating the Patient with Right Upper Quadrant Abdominal Pain Timing matters: did the pain start suddenly or build gradually over weeks? Sudden, severe pain points toward gallstone obstruction, kidney stones, or a vascular event. Slow-onset dull aching is more consistent with liver swelling, hepatitis, or a growing mass. The relationship to meals is a strong clue. Pain that flares after eating, particularly after fatty foods, suggests gallbladder disease. Pain that improves with eating may point to a duodenal ulcer.
Associated symptoms help narrow things down further. Jaundice (yellowing of the skin and eyes) combined with right-sided pain raises concern for bile duct obstruction or liver disease. Fever with localized tenderness suggests infection, whether in the gallbladder, kidney, or lung base. Blood in the urine points toward the kidney. Shoulder blade pain hints at gallbladder or diaphragm irritation. A cough or shortness of breath alongside the pain should prompt consideration of a lung process.
Ultrasound is usually the first imaging test ordered for right upper quadrant pain because it is quick, inexpensive, and excellent at visualizing the gallbladder and liver. CT scans provide a broader view when kidney stones, appendicitis (the appendix occasionally sits higher than expected), or lung-base pathology are suspected. Blood tests for liver enzymes, bilirubin, and inflammatory markers round out the initial workup.
When Right-Sided Rib Pain Needs Urgent Attention
Most right rib cage discomfort turns out to be something manageable: trapped gas, a muscle strain, or mild gastritis. But certain patterns warrant immediate evaluation. Patients presenting with fever, jaundice, or right upper quadrant pain should undergo prompt assessment because this combination can signal a biliary infection that may worsen rapidly without treatment.5NCBI Bookshelf. Acute Abdomen The triad of fever, jaundice, and right upper quadrant pain is known as Charcot’s triad, and it points toward an infected bile duct, a condition called ascending cholangitis that can become life-threatening without drainage and antibiotics.
Other red flags include sudden, tearing pain that radiates to the back (which can suggest a vascular emergency), pain accompanied by vomiting blood or passing very dark stools, severe pain that does not improve over several hours, and pain following abdominal trauma such as a fall or car accident, since the liver is vulnerable to blunt injury due to its size and position against the rib cage. Unexplained weight loss alongside persistent right-sided discomfort also merits medical evaluation, as it could indicate a hepatic or colonic growth.
Common Misattributions and Overlooked Causes
People tend to assume that pain under the right rib cage means something is wrong with the liver, but the liver is actually one of the less likely sources of acute pain in that area. Because the liver lacks internal pain receptors, it has to swell substantially before you notice anything. By the time a liver condition produces noticeable discomfort, disease is often advanced. In contrast, gallbladder problems, gas at the hepatic flexure, and musculoskeletal injuries can all produce dramatic pain while being relatively benign or straightforward to treat.
Another commonly overlooked source is the diaphragm itself. Hiccups, spasms, and irritation of the diaphragm can produce vague right-sided discomfort that does not fit neatly into any organ-based explanation. After abdominal surgery, trapped air beneath the diaphragm can cause surprisingly sharp referred pain to the right shoulder, a phenomenon that confuses patients who expect post-surgical pain only near the incision site. Anxiety and hyperventilation can also produce rib cage tightness and discomfort that patients localize to the right side, particularly if they unconsciously brace their abdominal muscles during stress. Recognizing that the rib cage is a neighborhood of overlapping structures, not a single organ, helps make sense of why the same area can hurt for so many different reasons.