Why Do I Have Pain Under My Right Rib Cage?

Pain under your right rib cage usually comes from one of several organs packed into that area: the gallbladder, liver, right kidney, or the bend in your colon where it tucks under the ribs. Less commonly, it can stem from the lungs, chest wall, or nerves. The cause ranges from something as harmless as trapped gas to conditions that need prompt treatment, so the pattern of your pain, what triggers it, and any accompanying symptoms are the key clues.

Gallbladder Problems

The gallbladder sits directly under your right rib cage, and it’s one of the most common sources of pain in that spot. Gallstones affect more than 1 in 10 adults and often cause no symptoms at all. But when a stone blocks the duct that drains the gallbladder, you get a sudden, sharp pain in the upper right abdomen that can spread toward your right shoulder. Unlike stomach pain that comes and goes in waves, gallbladder inflammation (cholecystitis) produces pain that is persistent and doesn’t fade within a few hours.

Breathing deeply tends to make it worse, and the area will feel very tender to the touch. Eating a fatty meal is a classic trigger because fat stimulates the gallbladder to contract. If the inflammation progresses, you may also develop a fever, nausea, vomiting, sweating, loss of appetite, or yellowing of the skin and eyes.

Trapped Gas in the Colon

Your large intestine makes a sharp turn just under your right ribs, at a spot called the hepatic flexure. Gas can pool there, and when it does, the pain can be surprisingly intense. Johns Hopkins Medicine notes that gas collecting on the right side of the colon can feel like gallstone pain or even appendicitis. The difference is that gas pain tends to shift, improve after passing gas or having a bowel movement, and doesn’t come with fever or tenderness when you press on the area. If your pain is intermittent, bloating is involved, and it resolves on its own, trapped gas is a likely explanation.

Liver-Related Pain

The liver fills most of the space under your right ribs. The organ itself doesn’t have many pain receptors, but the capsule surrounding it does. When the liver swells from inflammation, fatty liver disease, hepatitis, or other conditions, that capsule stretches and produces a dull, aching discomfort in the right upper abdomen. The pain is usually constant rather than sharp, and it may be accompanied by fatigue, loss of appetite, or nausea. Yellowing skin or eyes (jaundice) is a more advanced warning sign that something is affecting liver function or bile flow.

Kidney Stones or Infection

Your right kidney sits behind your stomach, tucked under the back of your rib cage. Kidney pain typically starts as a deep ache in your back or side (flank), under your ribs, and can radiate forward into the abdomen or down toward the groin. Kidney stones often cause severe, wave-like pain that shifts in intensity, while a kidney infection tends to produce a more constant ache along with fever, chills, and pain during urination. If your pain is more toward the back and side than the front, and especially if you notice blood in your urine, the kidney is worth considering.

Chest Wall and Rib Pain

Sometimes the pain isn’t coming from an organ at all. Costochondritis, an inflammation of the cartilage connecting your ribs to your breastbone, causes sharp or aching pain that worsens with deep breathing, coughing, sneezing, or any movement of the chest wall. It can also radiate to the arms and shoulders. Intercostal muscle strains from heavy lifting, twisting, or even intense coughing can produce similar symptoms. The hallmark of musculoskeletal rib pain is that it’s reproducible: pressing on the sore spot or moving in a specific way reliably triggers it.

Lung Conditions

Pleurisy occurs when the thin lining around your lungs becomes inflamed, causing the two layers to rub against each other instead of gliding smoothly. This produces a sharp, stabbing pain in one specific spot that gets noticeably worse when you breathe in deeply or cough. The pain sometimes spreads to your shoulder or back. Pneumonia affecting the right lower lobe of the lung can cause similar symptoms, often alongside a cough, fever, and feeling generally unwell. If your pain is clearly tied to breathing, lung involvement is a real possibility.

Shingles (Before the Rash Appears)

This one catches people off guard. Shingles can cause pain, itching, or tingling along the rib cage for several days before any visible rash appears. The rash most commonly shows up as a single stripe around one side of the body, following the path of a nerve. During that early phase, you may have unexplained burning or stabbing pain under your ribs with no other obvious cause. If a blistering rash eventually appears in the same area, that confirms the diagnosis.

Pain During Pregnancy

For pregnant women, right-sided rib pain deserves extra attention. HELLP syndrome, a serious complication related to preeclampsia, specifically causes pain in the right upper abdomen. It involves liver swelling and, in severe cases, liver bleeding. Other symptoms include high blood pressure, swelling, headaches, and vision changes. Any pregnant person experiencing persistent right upper abdominal pain should treat it as urgent.

How Doctors Identify the Cause

Ultrasound is the go-to first test for right upper quadrant pain. The American College of Radiology gives it the highest appropriateness rating (9 out of 9) for this symptom because it can quickly visualize the gallbladder, liver, bile ducts, and right kidney without radiation. If ultrasound results are inconclusive, a CT scan or MRI may follow. Your doctor will also consider your symptoms, physical exam findings, and blood work to narrow things down.

When the Pain Needs Urgent Attention

Most right-sided rib pain resolves on its own or turns out to be something manageable. But certain patterns signal a problem that can’t wait:

  • Severe pain that makes it hard to function or keeps getting worse
  • Persistent pain that doesn’t go away or keeps returning
  • Fever or chills alongside the pain
  • Jaundice (yellowing of skin or eyes)
  • Vomiting blood or blood in your urine or stool
  • Pain spreading upward toward your chest, neck, or shoulder
  • Shortness of breath with the pain
  • Unexplained weight loss

Any of these combinations warrants a visit to your doctor or, in the case of severe or worsening symptoms, an emergency room.