Why Does It Hurt on My Right Side Under My Ribs?

Pain under your right ribs usually comes from one of several organs packed into that area of your abdomen, though it can also be muscular, skeletal, or even related to trapped gas. The right upper quadrant houses your liver, gallbladder, part of your stomach, the first section of your small intestine, the head of your pancreas, your right kidney, and a bend in your large intestine. Figuring out the cause depends on how the pain feels, how long it lasts, and what makes it better or worse.

Gallbladder Problems Are the Most Common Cause

The gallbladder sits right beneath your liver, tucked under your ribs on the right side. It stores bile, a fluid that helps digest fat. When gallstones form and temporarily block the duct, the result is a steady, gripping pain in the upper right abdomen near the rib cage that can radiate to the upper back or behind the breastbone. This is called biliary colic, and it’s the most common symptom of gallbladder disease. It tends to hit after meals, especially fatty ones, because eating fat triggers the gallbladder to squeeze out bile.

Roughly 6% of the global population has gallstones, and the rate in Western countries runs between 5% and 25% of adults. Most people with gallstones never know they have them. Only about 20% develop symptoms within 10 years, and 2 to 4% of gallstone carriers become symptomatic each year.

If gallstones cause ongoing blockage, the gallbladder itself can become inflamed, a condition called acute cholecystitis. The pain is similar but more severe, constant, and can last for days. It often gets worse when you breathe in deeply. About a third of people with this inflammation develop fever and chills. This is a situation that typically requires medical treatment, often surgery.

Trapped Gas Can Mimic Organ Pain

Before assuming the worst, it’s worth knowing that gas collecting in the right side of your colon can feel remarkably similar to gallstone pain or even appendicitis. Your large intestine makes a sharp turn near your liver (called the hepatic flexure), and gas can get trapped at that bend, creating pressure and a cramping or sharp sensation under the right ribs. This type of pain usually shifts, comes and goes, and improves after passing gas or having a bowel movement. If the pain resolves relatively quickly and you don’t have fever or other symptoms, trapped gas is a likely explanation.

Liver Swelling and the Capsule Around It

The liver itself can’t feel pain. Its internal tissue has no pain receptors. But the thin capsule wrapped around it is loaded with nerve endings, and when the liver swells, that capsule stretches. How the pain feels depends on how fast the swelling happens. Rapid swelling causes sudden, sharp pain that can be mistaken for gallstones. Gradual enlargement produces a dull, persistent ache. Conditions that can swell the liver include hepatitis (viral or from alcohol use), fatty liver disease, and heart failure that causes fluid to back up into the liver.

Kidney Stones on the Right Side

Your right kidney sits toward the back of your abdomen, partially tucked under the lower ribs. When a kidney stone moves, it typically causes pain that starts in the mid-back and side (the flank area), then radiates forward below the rib cage and sometimes down into the groin. The pain is often intense, comes in waves, and may be accompanied by blood in the urine, nausea, or a frequent urge to urinate. The location can overlap with right-side rib pain, but the radiating pattern and urinary symptoms usually help distinguish it.

Rib and Cartilage Inflammation

Not all pain under the right ribs comes from internal organs. Costochondritis, an inflammation of the cartilage connecting your ribs to your breastbone, causes sharp or aching pain that can feel like it’s coming from deep inside. The key difference is that this pain worsens with specific movements: taking a deep breath, coughing, sneezing, or twisting your torso. It’s also reproducible, meaning pressing on the affected area will trigger or increase the pain. Internal organ pain generally doesn’t respond to touch or chest wall movement in the same way.

Lung Lining Inflammation

The lower lobes of your right lung sit just above the diaphragm, close to where you’d feel rib pain. The lungs are surrounded by two smooth layers of tissue that normally glide past each other as you breathe. When those layers become inflamed (a condition called pleurisy), they rub together like sandpaper, causing sharp pain that gets worse with every breath in. Pleurisy pain intensifies with breathing, coughing, and sneezing, which can make it tricky to distinguish from costochondritis. However, pleurisy often comes with other respiratory symptoms like cough, shortness of breath, or a recent chest infection.

How Doctors Figure Out the Cause

When you see a doctor for right-sided rib pain, the first imaging test is almost always an ultrasound. It’s the best tool for evaluating gallbladder problems, with about 96% accuracy for detecting gallstones. An ultrasound also provides a good look at the liver, bile ducts, and kidneys, and it’s fast with no radiation exposure.

If the ultrasound doesn’t reveal a cause, a CT scan is usually next. CT is better at visualizing the intestines, spotting inflammation or infections, and evaluating problems with bones and surrounding structures that ultrasound can miss. It’s less accurate than ultrasound for gallstones specifically (about 75% sensitivity), but it gives a much broader picture. For liver-specific concerns like abscesses or tumors, CT with contrast dye is particularly useful.

Signs That Need Urgent Attention

Most right-sided rib pain turns out to be something manageable, but certain combinations of symptoms signal something more serious. Seek care promptly if your pain is severe and constant, keeps coming back, or started mild and is steadily getting worse. Vomiting blood, shortness of breath alongside the pain, yellowing of your skin or the whites of your eyes, blood in your urine or stool, fever with chills, or unexplained weight loss all warrant immediate evaluation. Pain that spreads upward toward your chest, neck, or shoulder also needs urgent attention, as this pattern can indicate gallbladder complications, cardiac issues, or other emergencies.

Pain in the lower right abdomen, below the level of the ribs, raises a different concern: the appendix. That location and pattern requires prompt medical evaluation regardless of severity.