The area under the rib cage, known anatomically as the thoracic cage and the upper abdominal cavity, contains the lower lungs, the diaphragm, the liver, the stomach, the spleen, the pancreas, and the kidneys. This region is a complex junction where the bony rib cage protects vital organs while allowing the diaphragm to drive breathing, and pain here often originates from structures far beyond the ribs themselves.
Bony Framework: Ribs, Sternum, and Vertebrae
The rib cage itself is a semi-rigid structure formed by 12 pairs of ribs, the sternum (breastbone) at the front, and the 12 thoracic vertebrae at the back. Each rib attaches to a vertebra in the back, but the front attachments vary:
- True ribs (1–7): These connect directly to the sternum via individual costal cartilages.
- False ribs (8–10): Their cartilages join together and attach to the cartilage of the 7th rib, not the sternum directly.
- Floating ribs (11–12): These have no anterior attachment, ending in the abdominal musculature.
The lowest two ribs are the ones most people feel when they press on their sides. The space between the ribs (intercostal space) contains muscles, nerves, and blood vessels that are common sources of localized pain.
Muscles and the Diaphragm
The diaphragm is the primary breathing muscle, a dome-shaped sheet that separates the chest cavity from the abdominal cavity. When it contracts, it flattens and moves downward, increasing chest volume and pulling air into the lungs. Its lower edge attaches to the inner surface of the lower ribs, so diaphragm irritation (from overuse, injury, or referred pain) frequently presents as pain under the rib margin.
Other muscles in this area include the intercostal muscles between the ribs, the transversus abdominis (deep abdominal wall), and the quadratus lumborum in the lower back. A pulled intercostal muscle is one of the most common causes of sharp, movement-related pain under the ribs.
Organs Under the Left Rib Cage
The left upper quadrant of the abdomen sits under the left ribs and contains several critical organs:
- Spleen: Filters blood and fights infection. It is fragile; trauma can cause rupture and internal bleeding.
- Stomach: The upper part (fundus) lies directly under the left diaphragm.
- Left kidney: Sits high in the retroperitoneal space, partially shielded by the 11th and 12th ribs.
- Tail of the pancreas: Extends toward the spleen.
- Left lung lower lobe: Fills the chest cavity above the diaphragm.
Left-sided pain under the ribs often points to the spleen (enlargement, rupture) or stomach issues (gastritis, ulcers), but it can also be referred from the heart (angina) or the left shoulder via the phrenic nerve.
Organs Under the Right Rib Cage
The right upper quadrant is dominated by the liver, the largest solid organ in the body. The liver spans most of the right side, tucked under the diaphragm. Other structures here include:
- Gallbladder: A small sac attached to the underside of the liver, storing bile. Gallstones cause sharp, colicky pain here.
- Right kidney: Slightly lower than the left due to the liver’s bulk.
- Duodenum (first part of the small intestine): Curves around the head of the pancreas.
- Right lung lower lobe and pleura.
Right-sided pain is classically associated with gallbladder attacks (cholecystitis), liver inflammation (hepatitis), or kidney stones. However, appendicitis can sometimes cause referred pain here in early stages.
Common Causes of Pain Under the Ribs
Pain in this region is extremely common and ranges from benign to life-threatening. The most frequent causes include:
- Costochondritis: Inflammation of the cartilage joining the ribs to the sternum. Pain is sharp, worse with deep breaths or pressing on the spot.
- Muscle strain: From coughing, lifting, or twisting. Tender to touch, worsens with movement.
- Gallbladder disease: Right upper quadrant pain, often after fatty meals, radiating to the right shoulder or back.
- Kidney stones: Severe flank pain that moves to the groin, often with urinary symptoms.
- Pancreatitis: Deep, boring pain in the upper abdomen radiating straight through to the back.
- Rib fracture: From trauma, with point tenderness and pain on deep breathing.
- Pleurisy: Inflammation of the lung lining, causing sharp pain with each breath.
Red flags include sudden severe pain, pain with fever, shortness of breath, coughing blood, or pain that radiates to the jaw or left arm (possible heart attack). These require immediate medical attention.
How the Diaphragm and Ribs Work Together in Breathing
Breathing is a coordinated effort. On inhalation, the diaphragm contracts and moves down, while the external intercostal muscles lift the ribs upward and outward. This expands the thoracic cavity, creating negative pressure that draws air into the lungs. On exhalation, the diaphragm relaxes and the ribs drop, pushing air out.
Because the diaphragm attaches to the lower ribs, any condition that inflames the diaphragm (like pleurisy or a subphrenic abscess) makes breathing painful. Similarly, a fractured rib can splint breathing, leading to shallow breaths and pneumonia risk if not managed.
Diagnostic Imaging and Tests
If a doctor evaluates pain under the ribs, they typically start with a physical exam, pressing on specific points to localize tenderness. Then they may order:
- Chest X-ray: For rib fractures, lung issues, or an enlarged heart.
- Ultrasound: Best for gallbladder, liver, spleen, and kidney evaluation.
- CT scan: Provides detailed cross-sectional images of both chest and abdomen.
- Blood tests: Liver enzymes, pancreatic enzymes (amylase/lipase), kidney function, and white blood cell count.
- ECG: To rule out heart-related causes, especially for left-sided pain.
The choice depends on the suspected organ. For example, ultrasound is the first-line for gallstones, while a CT is preferred for suspected spleen injury after trauma.
Frequently Asked Questions
Why does my left side hurt under my ribs after eating?
This is often due to gastric distension (gas or a large meal) pressing against the diaphragm or spleen. It can also be from gastritis, an ulcer, or pancreatitis. If it happens regularly, see a doctor to rule out these conditions.
Can gas cause pain under the rib cage?
Yes. Gas trapped in the splenic flexure of the colon (the bend near the spleen) can cause sharp left upper quadrant pain that mimics heart or spleen issues. It usually improves with burping, passing gas, or a change in position.
Is pain under the ribs a sign of a heart attack?
It can be, especially if the pain is on the left side, feels like pressure, and radiates to the jaw, neck, or left arm. However, most rib-cage pain is musculoskeletal. If you have risk factors (age, smoking, diabetes) or shortness of breath, seek emergency care.
What does a fractured rib feel like?
A sharp, localized pain that worsens with deep breathing, coughing, or twisting. The area is tender to touch, and you may hear a crack at the time of injury. Simple fractures heal in 6 weeks, but complications like a punctured lung require immediate treatment.
Why does my right side hurt under my ribs when I run?
This is often a “side stitch,” caused by diaphragm spasm or inadequate blood flow to the diaphragm during exercise. It is more common in beginners or after eating. Slowing down, breathing deeply, and pressing on the spot usually relieves it.
Can liver problems cause pain under the right ribs?
Yes. The liver enlarges in conditions like hepatitis, fatty liver disease, or heart failure, stretching its capsule and causing a dull ache under the right ribs. Gallbladder inflammation, which sits under the liver, is a more common cause of sharp pain.