Right Rib Pain: Causes and Treatment Options

7 Causes of Pain Under the Right Rib Cage and How to Treat It

7 Causes of Pain Under the Right Rib Cage and How to Treat It
g-stockstudio/iStock/GettyImages

Pain under your right rib cage isn't uncommon, but figuring out the culprit can take some trial and error. The area underneath your right rib is home to several major organs, including your pancreas, gallbladder, right kidney, liver, and small and large intestines.

Determining which body part might be affected and how serious the problem is involves paying close attention to your symptoms, and in many cases, seeking medical attention.

“There are many possible causes of pain under the right rib cage,” says Louis Morledge, MD, an internist with Lenox Hill Hospital in New York City. “It's a problem that primary care doctors encounter from time to time, but it can also present in the ER.”

Here's a list of some of the likeliest causes of discomfort on the right side under your ribs and when to consider seeing a doctor.

1. Injuries

Trauma or injury to your right rib, like a pulled muscle or a bruised or broken rib, can cause severe pain that's concentrated in that area. It might be sharp or hurt more when you move or touch the area, Dr. Morledge says.

Most often the cause of a bruised or broken rib is a car accident, fall, or injury from playing contact sports, according to Mayo Clinic.

See a doctor, who may want to run an X-ray to diagnose the extent of the injury. A broken rib can heal on its own in about six weeks, but you'll need to rest and ice the area regularly to help it heal properly without complications. Your doctor might also recommend doing breathing exercises. The pain of a rib injury might keep you from breathing deeply, which can increase your risk of pneumonia.

You can also ask your doctor about prescription or over-the-counter pain relievers, which can help ease your discomfort as your rib heals.

2. Gallbladder Conditions

Gallbladder problems are high on the list of possible causes of pain under the right rib. “It could be related to gallstones or inflammation of the gallbladder,” Morledge says.

Your gallbladder stores bile, a digestive fluid produced by your liver. Gallstones are hardened bits of bile that can form in the organ. Most people with gallstones don't realize they have them, but in some cases gallstones can block the flow of bile and cause inflammation and pain under the right rib cage that can radiate out toward the right arm or shoulder, according to Cleveland Clinic.

These blockages occur most commonly when a gallstone gets stuck at the exit of the gallbladder. Fatty foods are most likely to trigger pain due to gallstones.

The pain usually eases up after a few hours once the blockage clears, but if it doesn't clear, you may start to develop a fever, chills, or an increased heart rate. Those symptoms may be signs of a gallbladder infection. If you develop a fever, chills, or a fast heart rate along with pain under the right rib cage, you should be seen by a doctor right away.

Most gallstones don't require treatment, but when stones repeatedly cause blockages, the gallbladder should be surgically removed to reduce the risk of future complications. In some cases, certain medications can also help dissolve small gallstones. Medications to dissolve gallstones are usually used for people who are not healthy enough to have surgery.

Right-side upper abdominal pain can also signal a less common gallbladder condition, such as an infection or cancer of the gallbladder or inflammation of a nearby organ like the liver or pancreas.

Your doctor can perform the appropriate tests like ultrasound, CT scan, and blood work to diagnose the problem and discuss your treatment options.

3. Digestive Conditions

Because parts of your gastrointestinal (GI) tract sit under your right rib, it's possible that pain, discomfort, or cramping on the right side under your ribs could stem from a GI issue, Morledge says.

Indigestion

Indigestion is a term for upper abdominal discomfort, which can happen on your right or left side (or both). It's typically caused by overeating, anxiety, stomach infections, and a number of other possible conditions. According to Mayo Clinic, it's marked by feeling uncomfortably full after eating just a little bit, nausea, pain between your breast bone and belly button, bloating, and a burning sensation in the upper abdomen.

Eating smaller, more frequent meals; avoiding fatty foods; managing stress; and taking over-the-counter meds like antacids can help manage mild indigestion, which will typically clear up in a week or two. But if your symptoms linger beyond that, make an appointment with your doctor.

Constipation

Constipation can lead to abdominal pain, bloating, or cramps that result from difficulty passing stool. According to Mayo Clinic, common causes of constipation include eating a diet low in fiber, taking certain medications like opioid pain relievers, and not drinking enough fluids. Some medical conditions, including inflammatory bowel disease, diabetes, multiple sclerosis, hyperthyroidism, and Parkinson’s disease can also raise the risk of chronic constipation.

Constipation can be treated with lifestyle changes like adding fiber to your diet, drinking plenty of water, and getting regular exercise. Over-the-counter laxatives also work to get your bowels moving, and prescription medications are available if other treatments don’t help.

Gastroesophageal Reflux Disease

Gastroesophageal reflux disease (GERD) occurs when stomach contents splash up into the esophagus, often causing a burning feeling (think: heartburn) in your chest. Over time, GERD can lead to trouble swallowing, a sore throat, or persistent coughing, according to Johns Hopkins Medicine.

Certain foods or medications can trigger GERD, as can pressure on the abdomen, like during pregnancy.

To treat GERD, start by avoiding possible reflux triggers, such as fatty or spicy foods, and try not to eat meals close to bedtime, as lying down after eating can make GERD worse. If lifestyle changes like this don't help, talk to your doctor to see if an over-the-counter or prescription antacid is right for you.

Irritable Bowel Syndrome or Inflammatory Bowel Disease

While very different conditions, both irritable bowel syndrome (IBS) and inflammatory bowel disease (IBD) can cause abdominal pain and bloating that could extend up toward your right rib cage, along with gas, constipation, or diarrhea.

IBS is a chronic GI disorder that causes uncomfortable symptoms and is typically managed with lifestyle changes.

IBDs like Crohn's disease and ulcerative colitis are more serious and characterized by chronic inflammation of the intestines. IBD can lead to rectal bleeding, weight loss, and sometimes colon cancer if the condition is not well managed, according to Mayo Clinic.

If you suspect you could have IBS or IBD, see your doctor. IBS will likely require you to avoid certain foods to keep symptoms in check, while treating IBD typically involves medical treatment with prescription drugs and sometimes surgery in addition to dietary changes.

Gastritis

Gastritis is a general term for inflammation of the lining of the stomach, which can stem from a stomach infection, injury, taking non-steroidal anti-inflammatory drugs too often, drinking too much alcohol, or even extreme stress, according to Johns Hopkins Medicine.

It can cause pain in your upper abdomen (on the right or left side) as well as nausea, vomiting, burping or hiccupping, and a feeling of fullness after eating.

Sometimes gastritis will go away on its own. Your doctor might recommend taking an over-the-counter antacid to reduce your discomfort in the meantime. You'll need antibiotics if the gastritis is caused by a bacterial infection like Helicobacter pylori.

Appendicitis

The appendix is a small, finger-shaped pouch located in your lower right abdomen. Appendicitis, when the appendix becomes inflamed, typically causes sudden pain on the lower right side that gets worse with jarring movements (like coughing or jumping), according to Mayo Clinic. Pregnant women with appendicitis or people whose appendix is located behind the colon might notice pain higher up on their right side, closer to the rib cage.

Seek medical attention if you think you have appendicitis. In most cases, treatment requires surgery to remove the appendix, and waiting too long could increase the risk of life-threatening infection.

Pancreatitis

Your pancreas is a long, flat gland that sits behind your stomach in your upper abdomen, according to Mayo Clinic. Pancreatitis happens when the gland becomes inflamed. It can be acute or chronic and usually causes severe pain in the middle of the upper abdomen, but the pain can sometimes be felt on the right side instead.

Other symptoms include pain that radiates to your back, a tender abdomen, fever, a fast heartbeat, and nausea or vomiting.

Several things can cause pancreatitis, including alcohol abuse, gallstones, pancreatic cancer, obesity, and an infection or injury. Smoking, diabetes, and a family history of pancreatitis also put you at higher risk.

Acute pancreatitis can last for several days, while chronic pancreatitis can last for years. Either way, you should see your doctor for treatment, as pancreatitis can cause serious complications.

4. Lung Conditions

A muscle called the diaphragm separates your chest and abdominal cavities in your lower rib cage area. On the right side of your body, your right lung sits atop the diaphragm, and the liver is just below the muscle, according to MedlinePlus. As such, lung conditions affecting the right lower lung can sometimes cause irritation and pain under the right rib cage.

Pneumonia

Pneumonia is an infection that causes the air sacs in one or both lungs to become inflamed. It can develop from viral upper-respiratory infections such as the flu, a cold, or COVID-19.

Symptoms of pneumonia can range from mild to severe and may include fever or chills, a cough with greenish or blood-tinged mucus, shortness of breath, and sharp or stabbing chest pain that gets worse when you take a deep breath, according to the American Lung Association.

Bacterial pneumonia usually requires antibiotics, while viral pneumonia may go away on its own with rest and fluids (although your doctor might prescribe an antiviral medication in some cases).

Pulmonary Embolism (Blood Clot)

A pulmonary embolism is a blood clot in the lungs that usually occurs when a clot in another part of the body travels through the veins to the lungs. It is a medical emergency and without fast treatment can lead to heart or lung damage and quickly turn fatal, according to Cleveland Clinic.

Shortness of breath and sharp pain that can occur in the chest, back, arms, or shoulders that gets worse when you breathe deeply are usually the first symptoms of a pulmonary embolism. The condition is usually treated in the hospital with anticoagulant medications, or blood thinners. Surgery may be required if other treatments aren’t working.

Pleurisy

Pleurisy is characterized by inflammation of the lung lining caused by an infection — a viral infection like the flu or a bacterial infection such as pneumonia. It usually causes sharp, stabbing chest pain that comes from one specific place, and it gets worse when you breathe or cough. The pain can be so severe that you might breathe carefully to try to manage the discomfort, according to Cleveland Clinic.

Pleurisy is treated based on the underlying cause. Some bacterial infections will require antibiotics. On the other hand, your doctor may recommend pain relievers or corticosteroids to manage your symptoms if you have a viral infection. If fluid builds up in your lungs, you may need to have it drained.

5. Kidney Conditions

The upper part of each kidney sits at the level of your lowest ribs in the back of your body. Certain conditions involving your right kidney can therefore cause pain in your right flank — the area starting at the lower rib cage next to your spine and wrapping around your side, possibly extending to the front of your abdomen, according to the National Institute of Diabetes and Digestive and Kidney Diseases.

Possible culprits can include:

  • Pyelonephritis, an infection of the right kidney
  • A right-sided kidney stone
  • Tumors

Talk to your doctor about treatment options, which may include antibiotics, pain relievers, or surgery.

6. Liver Disease

Like the gallbladder, your liver resides in your right upper abdomen beneath your lower ribs and can cause pain in this area. According to Cleveland Clinic, inflammation of the liver (hepatitis) is a form of liver disease that can cause right rib cage pain. Hepatitis can be caused by alcohol misuse, viruses, and toxins like drugs, chemicals, or poison.

Treating hepatitis can involve antiviral medications, lifestyle changes like avoiding alcohol and eating a healthy diet, and a liver transplant, according to Cleveland Clinic.

7. Cardiovascular Problems

Heart-related pain is more likely to occur under your left rib cage than your right, Morledge says. But “it's a distant possibility” that pain in your right side under the ribs could be a sign of a cardiovascular problem, he says. Older people, people with diabetes and/or kidney failure, and women are more likely to experience what doctors call “atypical symptoms” with heart attacks.

Heart Attack

A heart attack happens when a clogged artery blocks the flow of blood to the heart. The symptoms of a heart attack usually include chest pressure or tightness; pain that spreads to the shoulder, jaw, or upper abdominal area; a cold sweat; dizziness; nausea; or shortness of breath, according to Mayo Clinic.

A heart attack is a life-threatening emergency. If you think you're having a heart attack, call 911 immediately.

Angina

A type of chest pain caused by temporarily reduced blood flow to the heart, angina symptoms often feel similar to a heart attack, and the condition can progress to a heart attack. Unlike a heart attack, though, the symptoms of angina can come and go, according to Cleveland Clinic.

Angina stems from heart disease, so you should treat it seriously. If you notice that the pain comes on more often or with less intense activity, you should see a doctor right away. It could be a sign of a blockage that puts you at high risk of a heart attack.

Rest or medications like nitroglycerin can often ease angina pain, but your doctor will likely recommend lifestyle changes or other medications to lower blood pressure or cholesterol, which will help treat the larger problem.

Heart Inflammation

Pericarditis is inflammation of the tissue sac around the heart called the pericardium. Most of the time (about 90 percent) doctors don’t find a clear cause for pericarditis, according to Cleveland Clinic.

It can be caused by viral, bacterial, fungal, or parasitic infections. It can also be caused by autoimmune diseases, certain cancers, traumatic injuries, or kidney failure. People who have recently had a heart procedure are at higher risk of pericarditis. Endocarditis is inflammation of the lining inside the heart. It is usually caused by infection.

You might feel a sharp or stabbing pain in the chest or upper abdomen that gets worse when you lie down, cough, or take a deep breath.

See a doctor if you are concerned that you may have inflammation in or around your heart. They might prescribe you an anti-inflammatory medication to reduce the inflammation around your heart or other drugs, such as antibiotics or antifungals, to help clear the infection, according to MedlinePlus. If you have endocarditis or fluid built up around your heart (called a pericardial effusion), you may need to be hospitalized or have a surgical procedure.

When Should You Worry About Pain on Your Right Side Under Your Ribs?

Pain under the right ribs isn't always cause for concern, and sometimes the underlying problem will go away on its own with time. But in other cases, the discomfort could signal a more serious problem.

According to Morledge, you should seek medical attention if:

  • The pain started after an injury
  • The pain is sudden, severe, or accompanied by other symptoms, such as a fever, a rash, vomiting, shortness of breath, or a mass you can feel with your fingers
  • The pain hasn't gotten better after a day or two
EDITORIAL SOURCES
Everyday Health follows strict sourcing guidelines to ensure the accuracy of its content, outlined in our editorial policy. We use only trustworthy sources, including peer-reviewed studies, board-certified medical experts, patients with lived experience, and information from top institutions.
Amy Walsh

Amy Walsh, MD, MDP

Medical Reviewer

Amy Walsh, MD, MDP, is a board-certified emergency physician at HealthPartners. She has 15 years of experience, fellowship training in global emergency medicine, and extensive experience in rural emergency medicine.

In addition to her emergency medicine practice, she is passionate about holistic health, natural movement, wild edible and medicinal plants, and healing through creative expression.

Tina M. St. John, MD

Author

Dr. St. John is a medical writer and editor with more than 15 years experience in the field. She is a former medical officer for the Centers for Disease Control and Prevention.

Marygrace Taylor

Marygrace Taylor

Author
Marygrace Taylor is a health writer and editor based in Philadelphia. Her work has appeared in publications including Parade, Glamour, Women's Health, Prevention, RedbookMen's Health, and O, The Oprah Magazine. She's also the coauthor of Eat Clean, Stay Lean: The Diet and Prevention Mediterranean Table.