Overview
The upper right part of the belly holds the liver, the gallbladder, part of the bowel, and the right kidney behind them. The bottom of the right lung is just above. Pain here can be sharp, cramping, or a dull ache, and it may spread to the back or under the right shoulder blade.
Gallbladder pain (biliary colic) often starts after a meal, especially a fatty one, builds over 30 minutes to an hour, and can last for hours. When the gallbladder gets inflamed (cholecystitis), the pain is steady and severe and often comes with fever, nausea, and vomiting.
When to get medical care
Causes
Common causes include gallstones and biliary colic, acute cholecystitis (gallbladder inflammation), a strained muscle or bruised rib, gas and bloating, and indigestion. Other causes include hepatitis and other liver problems (including fatty liver and liver abscess), a kidney stone or kidney infection on the right side, pneumonia or a blood clot in the right lung, a stomach or duodenal ulcer, pancreatitis, appendicitis (early on, or in pregnancy when the appendix sits higher), shingles before the rash appears, and, in pregnancy, preeclampsia or HELLP syndrome.
OwieClear has pages on 12 conditions that can cause upper right belly pain (under the right ribs). Each shows how soon to get care.
Common causes
- Gallstones (gallbladder attack)See a doctor if it doesn't get better
Hard stones in the gallbladder can cause sudden pain in the upper right or upper middle belly, often after a fatty or large meal.
- Bile duct infection or inflammation (cholangitis)Often needs care today
Infection or inflammation of the bile ducts.
- Hepatitis or liver inflammationOften needs care today
Swelling of the liver from a virus, alcohol, or some medicines.
- Pain after gallbladder removal (sphincter of Oddi problems)See a doctor if it doesn't get better
Upper belly pain that continues or returns after gallbladder surgery.
- Liver abscessMay need emergency care
A pocket of pus in the liver from bacteria (often spreading from the gallbladder or bowel) or from amoebas after travel.
Less likely causes
- Fatty liver diseaseSee a doctor if it doesn't get better
Extra fat in the liver, often linked to weight, diabetes, high cholesterol, or alcohol.
- Gallbladder polypsSee a doctor if it doesn't get better
Small growths on the inside of the gallbladder, usually found by chance on an ultrasound.
- Amebiasis (Entamoeba infection)Often needs care today
An infection of the gut by the parasite Entamoeba histolytica, picked up from food or water contaminated with stool, mostly in places with poor sanitation.
- Bile duct cancer (cholangiocarcinoma)Often needs care today
A rare cancer of the tubes that carry bile from the liver to the gut.
- HELLP syndromeMay need emergency care
A severe form of preeclampsia that affects the liver and blood, in late pregnancy or soon after birth.
- Hydatid disease (echinococcosis)See a doctor if it doesn't get better
Cysts caused by a tiny tapeworm whose eggs come from dog stool, mostly in sheep-farming areas.
- Slipping rib syndromeSee a doctor if it doesn't get better
Pain in the lower chest or upper belly when the lower rib cartilage moves and irritates a nerve.
What you can do at home
- Don't eat for a few hours if the pain is mild. Then try clear liquids and bland, low-fat foods.
- Avoid fatty, greasy, or fried foods, which can set off gallbladder pain.
- Rest with a heating pad on the area for muscle or rib pain.
- Keep track of the pain: when it starts, what you ate, how long it lasts, and what makes it better or worse.
- Don't take aspirin or ibuprofen on an empty stomach, and avoid them if an ulcer is possible. Acetaminophen is a safer choice for mild pain, but don't exceed the package dose, since it affects the liver.
- Avoid alcohol until you know the cause.
Medicines
Acetaminophen (Tylenol) can help with mild pain, but stick to the label dose. Antacids may help if it's indigestion. Gallstones that cause repeated attacks are usually treated by removing the gallbladder, and an inflamed gallbladder needs hospital care with IV fluids and antibiotics.
At the doctor
The doctor will press on your belly and use blood tests and an ultrasound to check the gallbladder and liver.
Questions you may be asked
- Exactly where it hurts and whether it spreads to the back or shoulder
- Whether it comes after eating, especially fatty meals
- How long each episode lasts and how often it happens
- Any fever, nausea, vomiting, yellow skin, or dark urine
- Any recent injury to the ribs or back
- Your alcohol use and medicines
- Whether you could be pregnant
The exam
A physical exam of the belly, including pressing under the right ribs while you breathe in, plus a check for jaundice and fever.
Tests
- Blood tests for liver function, pancreas enzymes, and infection
- An ultrasound of the belly to look for gallstones and inflammation
- A CT scan if the ultrasound isn't clear
- A HIDA scan (a test of gallbladder function)
- A urine test
- A chest X-ray if lung problems are suspected
Prevention
You can lower your risk of gallstones and liver problems.
- Keep a healthy weight, and lose weight slowly if you need to; crash diets raise gallstone risk
- Eat a diet high in fiber and low in saturated fat
- Exercise regularly
- Limit alcohol
- Get vaccinated against hepatitis A and B
Check your symptoms
Most symptoms have more than one possible cause. The symptom checker looks at all of your symptoms together, plus your age, and shows how soon to get care.
Sources
Last updated 2026-11-13.