What Causes Pain in the Upper Right Abdomen Under Ribs?

Pain in the upper right abdomen under your ribs most commonly comes from the gallbladder, though several other organs in that area can be responsible. The gallbladder, liver, part of the large intestine, the right kidney, and the head of the pancreas all sit in this region, and problems with any of them can produce pain that feels like it’s radiating from just beneath your rib cage.

The specific quality of the pain, how long it lasts, and what makes it better or worse are important clues to the underlying cause.

Gallbladder Problems Are the Most Common Cause

Gallstone disease affects roughly 6% of the global population and is the single most frequent reason for pain in this area. The risk is higher in women, people who are middle-aged or older, and those with metabolic conditions like high blood sugar or elevated triglycerides. Each unit increase in a combined blood sugar and triglyceride marker corresponds to a 41% higher risk of developing gallstones.

When a gallstone temporarily blocks one of the ducts leading out of the gallbladder, you get what’s called biliary colic. This produces sudden, rapidly intensifying pain in the upper right abdomen that can last anywhere from several minutes to a few hours. It often strikes after a fatty meal, and you may also feel pain between your shoulder blades, in your right shoulder, or in the center of your abdomen just below the breastbone. Nausea and vomiting are common.

If a stone stays lodged and the gallbladder becomes inflamed, the pain doesn’t resolve on its own. It persists, often worsens, and may come with fever. This is cholecystitis, and it typically requires medical treatment rather than waiting it out.

Liver Swelling and Inflammation

The liver itself doesn’t have many pain-sensing nerves, but it’s wrapped in a thin capsule that does. When the liver swells from hepatitis, fatty liver disease, or poor blood flow, that capsule stretches and produces a dull, diffuse ache under the right ribs. People often describe it as a sense of fullness or pressure rather than sharp pain.

Chronic liver conditions like cirrhosis frequently cause persistent bloating from gas buildup in the intestines, which adds to the discomfort. Liver-related pain is commonly underdiagnosed because it’s vague and hard to localize. It can also “refer” to other areas, meaning you feel it in your right shoulder or back even though the source is your liver.

Duodenal Ulcers

The duodenum, the first section of your small intestine, curves around the head of the pancreas in the upper right abdomen. Ulcers here cause a dull or burning pain in the upper abdomen, anywhere between the belly button and the breastbone. The pain tends to come and go over days or weeks. For some people it’s worst on an empty stomach or at night and temporarily improves after eating. For others, eating makes it worse. This unpredictable relationship with food is one reason ulcers can be confused with gallbladder pain.

Kidney Stones on the Right Side

Your right kidney sits partially underneath your ribs toward the back, so a stone moving through the urinary tract on that side can produce pain that wraps around from the flank to the front of your abdomen. It typically starts in the middle back between the pelvis and ribs, then migrates toward the groin area. The pain tends to come in intense waves rather than staying constant, and it’s often accompanied by blood in the urine, nausea, or a frequent urge to urinate. Because the pain can radiate forward, it sometimes feels like it’s coming from under the right ribs rather than from behind.

Musculoskeletal Causes

Not all pain under the right ribs comes from an internal organ. Inflammation of the cartilage connecting your ribs to the breastbone, called costochondritis, can produce pain intense enough to mimic a heart attack or gallbladder problem. It’s typically made worse by pressing on the rib cage, twisting your torso, or taking deep breaths. Pulled intercostal muscles between the ribs can feel similar. The key difference is that this pain is usually reproducible with movement or pressure, whereas organ pain isn’t affected by changing position or pressing on the area.

Less Common but Worth Knowing

In women, a complication of pelvic inflammatory disease can cause inflammation of the liver capsule without affecting the liver itself. This produces right upper quadrant pain from adhesions forming between the liver’s surface and the abdominal wall. The infection typically originates in the cervix or vagina and ascends through the reproductive tract into the abdominal cavity. It’s often missed because the pain seems unrelated to a pelvic infection.

Other less frequent causes include kidney infections on the right side, pancreatic disorders, lung problems affecting the base of the right lung, and inflammatory bowel disease. The differential diagnosis is broad, which is why the character of the pain and accompanying symptoms matter so much for narrowing it down.

How Doctors Figure Out the Cause

Ultrasound is the preferred first-line imaging test for right upper quadrant pain. It’s widely available, quick, doesn’t involve radiation, and can evaluate the gallbladder, bile ducts, and liver in a single exam. It’s particularly good at confirming or ruling out gallstones and cholecystitis. According to the American College of Radiology’s evidence-based guidelines, ultrasound is the recommended starting point in nearly every clinical scenario involving this type of pain.

If ultrasound results are unclear, a CT scan or MRI may follow to look for complications or alternative diagnoses. A specialized scan that tracks how bile flows through the system can sometimes catch gallbladder dysfunction that ultrasound misses. Standard abdominal X-rays have limited value for evaluating this area.

Warning Signs That Need Urgent Attention

Some accompanying symptoms signal that right upper quadrant pain needs prompt evaluation:

  • Jaundice (yellowing of the skin or whites of the eyes), which suggests a blocked bile duct or liver problem
  • High fever, which points toward infection or inflammation
  • Blood in vomit or stool
  • Visible abdominal swelling
  • Dizziness or confusion
  • Difficulty breathing
  • Pain that worsens with physical activity

Severe pain that escalates rather than fading, especially with fever or jaundice, warrants same-day medical evaluation rather than a wait-and-see approach.