Pain that hits both your stomach area and ribs usually traces back to one of several organs packed tightly beneath your rib cage. The upper abdomen is crowded: your liver, gallbladder, stomach, spleen, pancreas, and parts of your intestines all sit directly behind or just below your lower ribs. Because these organs are so close together, and because the rib cage itself has cartilage and muscles that can become inflamed, pinpointing the cause depends on exactly where the pain is, what makes it worse, and what other symptoms come with it.
Why the Stomach and Ribs Share Pain
Your upper abdomen is technically an “abdominothoracic” region, meaning it sits right where the chest cavity meets the belly. The diaphragm, the muscle you use to breathe, forms the ceiling of this space. Below it, organs are stacked close together and share overlapping nerve pathways. That’s why a gallbladder problem can feel like rib pain, or why inflamed rib cartilage can feel like a stomach issue. Several organs also span both sides of the abdomen: your liver stretches from the right upper quadrant into the left, and your pancreas runs horizontally behind the stomach.
Acid-Related Causes
Gastritis (inflammation of the stomach lining), acid reflux, and peptic ulcers are among the most common reasons for overlapping stomach and rib pain. The discomfort typically sits between your belly button and breastbone, right where the lower ribs meet in front. It often burns, gnaws, or aches, and it may get worse after eating or on an empty stomach.
Peptic ulcers develop when the protective lining of the stomach or the first part of the small intestine breaks down. Two main culprits drive this: a bacterial infection called H. pylori and regular use of anti-inflammatory painkillers like ibuprofen, aspirin, or naproxen. These medications relieve pain elsewhere in the body but make the stomach lining more vulnerable to acid damage. If the pain wakes you at night, comes and goes over weeks, or improves briefly after eating before returning, an ulcer is worth investigating.
Gallbladder Problems
If the pain is concentrated on your right side, just below the rib cage, your gallbladder is a likely suspect. Gallstones can block the duct that drains bile, causing intense, cramping pain that builds quickly. When the gallbladder itself becomes inflamed (a condition called acute cholecystitis), the pain is sudden, sharp, and often spreads toward your right shoulder. Breathing deeply tends to make it worse because the expanding diaphragm pushes the inflamed gallbladder downward.
Your abdomen may feel extremely tender to the touch in that area. Doctors test for this with a simple maneuver: they press just below your right rib cage and ask you to take a deep breath. If you flinch or gasp when the gallbladder drops into their hand, that’s a strong indicator. Ultrasound is the standard next step for confirming gallstones or gallbladder inflammation.
Left-Sided Pain: Spleen and Pancreas
When the pain sits under your left ribs, two organs deserve attention. Your spleen is tucked right next to your stomach on the left side, shielded by the lower rib cage. An enlarged spleen can cause pain or a feeling of fullness in the left upper belly that sometimes radiates to the left shoulder. You might also feel full after eating very little, because the swollen spleen presses against the stomach and limits how much it can expand. Infections, liver disease, and certain blood disorders can all cause the spleen to enlarge.
The pancreas sits behind the stomach and stretches across the upper abdomen. Pancreatitis, or inflammation of the pancreas, typically causes severe pain in the upper middle or left side of the abdomen that often bores straight through to the back. It tends to come on quickly and may worsen after eating, especially fatty meals. Heavy alcohol use and gallstones are the two most common triggers.
Costochondritis: When the Problem Is the Ribs Themselves
Not all stomach-and-rib pain comes from an organ. Costochondritis is inflammation of the cartilage that connects your ribs to your breastbone. It typically affects ribs two through five and produces a low, aching pain in the chest that can easily be mistaken for something deeper. The pain often turns sharp or stabbing when you twist your torso, take a deep breath, cough, sneeze, or reach overhead. Lying on the affected side makes it worse, and pressing on the sore spot reproduces the pain precisely.
Costochondritis doesn’t cause visible swelling (that’s a related but separate condition called Tietze syndrome). It’s diagnosed through a physical exam rather than imaging. If your doctor can reproduce your exact pain by pressing on specific spots along your rib cage, and there are no other concerning symptoms, costochondritis is the most likely explanation. It usually resolves on its own over several weeks.
Pregnancy-Related Rib and Stomach Pain
If you’re pregnant and experiencing right-sided upper abdominal pain, especially with pain when breathing deeply, this warrants prompt attention. HELLP syndrome is a rare but serious pregnancy complication that affects the blood and liver. It causes right upper quadrant abdominal pain that can feel like it radiates into the ribs. Other signs include headaches, nausea, and swelling. HELLP syndrome can develop quickly and requires immediate medical evaluation, sometimes involving ultrasound or CT imaging to check for liver swelling or bleeding.
How Doctors Figure Out the Cause
Because so many conditions overlap in this part of the body, doctors use the location, timing, and quality of pain to narrow down the possibilities. Right-sided pain prompts an ultrasound to check the gallbladder and liver. Central upper abdominal pain may lead to blood tests for pancreatic enzymes (if both are elevated together, pancreatitis becomes more likely). Reproducible tenderness when pressing on the rib cartilage points toward costochondritis. Burning pain that responds to antacids suggests an acid-related problem.
Your other symptoms matter as much as the pain itself. Fever, nausea, vomiting, changes in stool color, or yellowing of the skin and eyes all help narrow the diagnosis. The pattern of pain is revealing too: constant pain that doesn’t shift with position suggests organ inflammation, while pain that changes when you move, breathe, or press on a spot is more likely musculoskeletal.
Signs That Need Immediate Attention
Most causes of stomach and rib pain are manageable, but certain combinations of symptoms signal something urgent. Sudden, excruciating abdominal pain can indicate a perforated organ, a blocked bile duct, or internal bleeding. Fever with a racing heart and severe tenderness, especially if your abdomen feels rigid or board-like, suggests peritonitis, an infection of the abdominal lining that often requires surgery. Pain that gets dramatically worse when you cough, tap your heel on the ground, or release pressure from the abdomen (rebound tenderness) points in the same direction.
Abdominal pain that feels wildly out of proportion to what the doctor finds on a physical exam is itself a red flag, because it can indicate reduced blood flow to the intestines. If you’re experiencing any of these patterns, getting to an emergency department quickly matters more than trying to sort out the cause on your own.

