3D illustration of a gallbladder with gallstones under the liver, a common cause of pain under the right rib Photo: www.scientificanimations.com, CC BY-SA 4.0, via Wikimedia Commons

Pain under the right rib is most often caused by the gallbladder, followed by the liver, the right kidney, the muscles and ribs of the chest wall, or the bowel. The character of the pain is the best clue: a steady, severe ache that starts 30-90 minutes after a fatty meal and lasts more than half an hour points to the gallbladder; a dull, heavy pressure points to the liver; pain that gets worse when you move, cough or breathe deeply usually comes from a muscle or rib. Fever, yellow skin or very severe pain mean you should be seen the same day.

Key takeaways:

  • The most common serious cause is biliary colic from gallstones: constant (not wave-like) pain, often in the evening or at night, sometimes spreading to the right shoulder blade.
  • The liver rarely causes sharp pain; when it enlarges (fatty liver, hepatitis, congestion) it gives a dull ache or fullness.
  • Kidney pain sits lower and further back, in the flank, and moves towards the lower abdomen or groin.
  • The first useful test is an abdominal ultrasound, together with a full blood count, liver function tests, lipase and a urine test.
  • At home, gentle warmth, small low-fat meals and peppermint or chamomile tea can help; skip so-called gallbladder flushes with olive oil and lemon.
  • Fever with chills, jaundice, dark urine with pale stools, or pain lasting more than 5-6 hours need emergency care.

What sits under your right ribs

Doctors call this area the right upper quadrant, or right hypochondrium. It holds the liver, the gallbladder and bile ducts, the top of the right kidney, the bend of the colon (hepatic flexure) and part of the duodenum, with the base of the right lung just above the diaphragm. Over all of this lie the ribs, the intercostal muscles and their nerves.

Pain can also be felt here when the problem is elsewhere: an inferior heart attack, pneumonia at the base of the lung or a problem in the thoracic spine. That is why the context (age, known conditions, fever, breathing) matters as much as the location.

Symptom decoder: what the type of pain tells you

Gallbladder and bile ducts

Biliary colic happens when a stone temporarily blocks the gallbladder outlet. The pain builds over minutes, becomes steady and intense, sits under the right ribs or in the upper middle abdomen, and usually lasts from 30 minutes to a few hours. It typically follows fatty meals or comes on in the evening, can wake you at night and often radiates to the right shoulder blade or shoulder. Nausea and vomiting are common, and between attacks you feel well. More detail in our guide to biliary colic.

Acute cholecystitis starts like colic, but the pain does not settle after 6 hours, fever appears, and pressing under the ribs while breathing in becomes very painful (Murphy’s sign). Read more about cholecystitis.

A stone stuck in the common bile duct adds jaundice (yellow eyes and skin), urine the colour of strong tea, pale stools and sometimes itching. Add fever with chills and it may be cholangitis, a medical emergency.

Biliary dyskinesia and biliary sludge cause similar but milder, recurrent pain without stones visible on ultrasound.

Liver

The liver itself has few pain fibres; what hurts is its capsule when it stretches. The result is a dull ache, heaviness or fullness under the right ribs, not closely tied to meals. Common causes are fatty liver, viral or alcoholic hepatitis and liver congestion from heart failure; abscesses and tumours are rarer. Tiredness, poor appetite and nausea may come with it, and in advanced cases jaundice or a swollen abdomen. Abnormal blood results are explained in our article on elevated liver enzymes.

Right kidney

Kidney pain is lower and further back, in the flank between the last rib and the hip. Renal colic comes in waves, is extremely intense, makes it impossible to find a comfortable position and moves down towards the lower abdomen or groin. Blood in the urine, burning or frequent urination may follow. Fever with back pain suggests pyelonephritis. See also our guide to kidney pain.

Muscles, ribs and nerves

Pain you can point to with one finger, that worsens when pressed, when you twist, cough or take a deep breath, usually comes from the chest wall: a strained intercostal muscle after exercise or a long bout of coughing, inflamed rib cartilage (costochondritis), or a cracked rib after a fall. Shingles starts with burning or tingling in a band around one side of the trunk, and the blisters follow 2-4 days later.

Bowel and stomach

Trapped gas in the bend of the colon causes pain that moves around, with bloating, and eases after passing wind or a bowel movement. Irritable bowel syndrome and constipation follow the same pattern. A duodenal ulcer causes burning in the upper middle abdomen spreading to the right, especially on an empty stomach or at night. Pancreatitis causes severe upper abdominal pain that bores through to the back, with vomiting.

Causes you must not miss

  • Pneumonia or pleurisy at the base of the right lung: pain on breathing in, cough, fever, breathlessness.
  • Pulmonary embolism: sudden pain on breathing, shortness of breath, fast pulse, sometimes after immobility or a long flight.
  • Inferior heart attack: can feel like indigestion, especially in people with diabetes, women and older adults; cold sweat, nausea, weakness.
  • Third trimester of pregnancy: right upper quadrant pain with headache, visual disturbance and sudden swelling may signal pre-eclampsia or HELLP syndrome.
  • Appendicitis: in pregnancy or with a high-lying appendix, the pain can sit close to the right ribs.

Table: type of pain, likely cause and tests to ask for

What the pain is likeWhen it happensOther signsLikely causeWhat to ask for
Constant, intense, 30 min - a few hoursAfter fatty meals, evening, nightNausea, spreads to right shoulder bladeBiliary colicAbdominal ultrasound, liver function tests
Like colic but over 6 hoursDoes not ease with restFever, pain under ribs on breathing inAcute cholecystitisEmergency: ultrasound, blood count, CRP
Pain plus yellow skinAny timeDark urine, pale stools, itchingBile duct stone, cholangitisEmergency: bilirubin, ALP, GGT, MRCP
Dull ache, heavinessNot clearly linked to mealsTiredness, poor appetiteFatty liver, hepatitis, congestionALT, AST, GGT, hepatitis B and C tests, ultrasound
Waves, very severe, in the flankSudden, sometimes after dehydrationBlood in urine, pain towards groinKidney stoneUrinalysis, creatinine, kidney ultrasound
Localised, worse with movement or pressureAfter exercise, coughing, a knockNo fever, no digestive upsetMuscle, ribExamination, X-ray after injury
Burning in a bandBefore a rashBlisters after 2-4 daysShinglesSee a doctor within 72 hours
Worse on breathingSudden or with feverCough, breathlessnessPneumonia, pulmonary embolismEmergency: chest X-ray, D-dimer, ECG

Clinician performing an abdominal ultrasound to check the liver and gallbladder for right upper abdominal pain Photo: Goleisureintl, CC BY 4.0, via Wikimedia Commons

Which tests to ask your GP for

For recurrent pain without warning signs, a sensible work-up includes:

  1. Abdominal ultrasound: the first-line test. It shows gallstones, a thickened gallbladder wall, fatty liver, dilated bile ducts and the kidneys. Done after fasting for 6-8 hours.
  2. Full blood count and CRP: flag inflammation or infection.
  3. Liver function tests: ALT, AST, GGT, alkaline phosphatase (ALP), total and direct bilirubin. A rise mainly in GGT, ALP and bilirubin points towards the bile ducts.
  4. Lipase: rules out pancreatitis.
  5. Urinalysis and creatinine: for the kidneys.
  6. Hepatitis B and C tests if liver results are abnormal.
  7. Pregnancy test for women of childbearing age.

Depending on the results, your doctor may order an MRCP scan, CT, upper endoscopy, a HIDA scan (for biliary dyskinesia), or an ECG and chest X-ray.

Before the appointment, write down when the pain started, how long each episode lasts, what you ate beforehand, where it spreads and what eases it. These details shorten the road to a diagnosis considerably.

Safe things you can do at home

The measures below suit mild to moderate pain without fever, jaundice or red flags. They do not replace a diagnosis.

  • Gentle warmth: a hot water bottle filled with warm (not boiling) water and wrapped in a towel, 15-20 minutes, 2-3 times a day. It relaxes muscle spasm and colon cramps. Do not use it if you have a fever or suspect acute inflammation.
  • Small, low-fat meals: on a painful day, warm fluids and plain food (strained vegetable soup, boiled rice, baked potato, baked apple). Then 4-5 small meals a day without fried food, cream, fatty meat, processed meats or cream cakes. The full plan is in our gallbladder diet guide.
  • Fluids: 1.5-2 litres a day, unless a heart or kidney condition requires a fluid limit.
  • For muscle pain: relative rest, warmth, gentle stretching after 2-3 days, no heavy lifting.
  • For trapped gas: a slow 15-20 minute walk after meals.
  • Pain relief: paracetamol can be used occasionally as directed on the pack (for adults usually 500-1000 mg per dose, at least 4-6 hours apart, no more than 3 g a day without medical advice). If you drink alcohol regularly or have liver disease, ask your doctor first. Anti-inflammatories (ibuprofen, diclofenac) work well for biliary colic but can irritate the stomach and kidneys; ask your pharmacist.

Vintage brass hot water bottle, used at home for gentle warmth in mild abdominal pain Photo: Conrado Secassi, CC BY-SA 4.0, via Wikimedia Commons

Herbal teas: tradition versus evidence

HerbUsed forHow to prepareEvidenceCaution
Peppermint leafDigestive cramps, bloating1.5-3 g in 150 ml water at 90-95 °C, covered, 5-10 min, 3 times a dayTraditional use recognised by the EMA; peppermint oil has trials in IBSMay worsen reflux
Chamomile flowersMild spasms, digestion2-4 g in 150 ml boiling water, 5-10 min, 3 times a dayTraditional use recognised by the EMAAllergy to the daisy family
Fennel seeds (crushed)Gas, bloating1.5-2.5 g in 150 ml boiling water, 10-15 min, 2-3 times a dayTraditional useNot long term in pregnancy
Artichoke, milk thistle, turmericHeavy digestion, liverOnly after a diagnosisTraditional use, limited studiesStimulate bile flow: avoid with bile duct obstruction

No herb has been shown to dissolve existing gallstones. Teas ease digestive discomfort; they do not fix the cause.

Contraindications and precautions

  • Herbs that increase bile flow (artichoke, turmeric, dandelion, black radish) can trigger an attack if you have gallstones and must be avoided with jaundice or bile duct obstruction.
  • Avoid peppermint with acid reflux or hiatal hernia; never apply peppermint essential oil to a young child’s face.
  • Turmeric in supplement doses may interact with blood thinners.
  • In pregnancy, any right upper quadrant pain in the third trimester needs medical assessment, not tea.
  • Persistent abdominal pain in a child needs a paediatrician.
  • If you take anticoagulants or have diabetes, liver or kidney disease, check any supplement with your doctor or pharmacist.

When to go to A&E: red flags

Call emergency services or go to A&E if:

  • the pain is severe or has not eased after 5-6 hours;
  • you have a fever above 38 °C with chills;
  • you notice jaundice, tea-coloured urine or pale stools;
  • you keep vomiting and cannot keep fluids down;
  • your abdomen becomes rigid and very tender to touch;
  • you also have chest pain, shortness of breath, cold sweats or fainting;
  • you vomit blood or pass black stools;
  • you are pregnant and have a headache, visual changes or sudden swelling;
  • someone with known liver disease becomes confused or drowsy.

Book a GP appointment within days if the pain keeps returning after meals, you lose weight without trying, feel persistently exhausted or have abnormal liver tests.

Common mistakes

Doing a gallbladder flush with olive oil and lemon juice. The little green stones passed afterwards are lumps of soap-like oil, not gallstones. If you do have real stones, the strong gallbladder contraction can push one into the duct, risking jaundice or pancreatitis.

Treating repeated attacks only with painkillers. Recurrent colic with confirmed stones should be discussed with a surgeon, because the risk of complications rises.

Putting heat on pain that comes with fever. It can mask a worsening inflammation.

Blaming everything on the liver. Many people who say their liver hurts actually have a muscle strain or trapped gas.

Fasting all day, then eating one big fatty meal. The gallbladder empties forcefully and can set off an attack.

Mixing paracetamol with alcohol, or taking several products that contain it. The risk to the liver goes up.

Conclusion

Pain under the right rib can be decoded by its rhythm, duration and triggers: attacks after fatty meals suggest the gallbladder, a dull ache the liver, waves in the flank the kidney, and pain on movement the chest wall. An ultrasound plus a few blood and urine tests answer most questions. Warmth, small meals and gentle teas help at home, but fever, jaundice or severe, prolonged pain need a doctor.

Frequently asked questions

How can I tell if it is my gallbladder or my liver? Gallbladder pain comes in attacks: intense, steady pain, usually after fatty food, lasting from half an hour to a few hours and then fading. Liver pain is more of a dull, continuous pressure with no clear link to meals. An ultrasound and liver function tests make the distinction.

Why do I get pain under my right rib after eating? Most often because the gallbladder contracts after fatty meals, or because of trapped gas in the colon. If the pain lasts more than 30 minutes and keeps coming back, get an ultrasound.

Is pain under the right rib when breathing serious? It often comes from a muscle or rib, especially after coughing or exercise. With fever, cough or breathlessness, though, it may be pneumonia, pleurisy or a pulmonary embolism and needs prompt assessment.

Can stress cause pain under the right rib? Stress increases muscle tension, IBS symptoms and gas, all of which can hurt in this area. Stress should only be accepted as the explanation once other causes have been ruled out.

Can I have gallstones without pain? Yes, many gallstones are found by chance on ultrasound. If they cause no symptoms, they are usually monitored rather than removed.

What should I eat when the area under my right rib hurts? Small boiled or baked meals: vegetables, rice, potatoes, lean meat, low-fat yoghurt. Avoid fried food, processed meats, cream and alcohol until the cause is known.

Is a stitch under the right rib while running normal? Yes, exercise-related stitches are common and harmless and fade within minutes of stopping and breathing slowly. If the pain also appears at rest, get it checked.

Sources and further reading

  • NICE, Gallstone disease: diagnosis and management (guideline CG188).
  • European Association for the Study of the Liver (EASL), Clinical Practice Guidelines on the prevention, diagnosis and treatment of gallstones, 2016.
  • Kwo P.Y. et al., ACG Clinical Guideline: Evaluation of Abnormal Liver Chemistries, American Journal of Gastroenterology, 2017.
  • NHS patient information pages: Gallstones and Liver disease.
  • EMA/HMPC community herbal monographs on Menthae piperitae folium and Matricariae flos.

This content is for information only and does not replace a consultation with a doctor or pharmacist. Severe pain, fever or jaundice need immediate medical assessment.