Doctors Note Logo

Published on: 9/15/2026

Can lying on my right side cause pain under my ribs?

Yes, lying on your right side can trigger or worsen pain under the ribs, often by compressing the rib cage, irritating the muscles and cartilage between the ribs, or putting pressure on organs like the liver and gallbladder. Common culprits include muscle strain, costochondritis, acid reflux, gallstones, a liver condition, or even a nerve irritated by your sleeping posture or mattress. Warning signs such as fever, yellowing skin, shortness of breath, vomiting, or severe pain that radiates to your shoulder or back point to causes that need prompt attention. There are several factors that determine whether this is positional discomfort or something more serious, so see below to understand more about each possible cause and when to seek care.

Because rib pain that shows up in one sleeping position can come from anything as minor as a strained muscle to as urgent as a gallbladder attack, guessing is risky, and a free, instant, online symptom check can help you sort out the most likely explanations for your specific pattern of pain and show you the right next step to take.

Last reviewed for medical accuracy: 09/15/2026

answer background

Explanation

Can Lying on My Right Side Cause Pain Under My Ribs?

Experiencing a sharp or dull ache under your right ribs when you lie on your right side can be unsettling. “Right side pain under rib” is a common concern with many potential causes—most are harmless, but some warrant prompt medical attention. Below, we’ll explore why this discomfort happens, what might be behind it, and when to seek help.

Why You Feel Pain When Lying on Your Right Side

  1. Anatomy and Pressure
    • Your rib cage, intercostal muscles and nerves sit just above vital organs (liver, gallbladder, right lung, kidney).
    • Lying on your right side increases pressure on these structures, potentially irritating muscles, nerves or inflamed organs.

  2. Muscle Strain and Costochondritis
    • Overstretching or coughing can inflame the cartilage connecting ribs to the breastbone (costochondritis).
    • Sleeping or lying in an awkward position may pull on intercostal muscles, causing localized pain.

  3. Nerve Compression
    • Poor posture or a hard surface can pinch intercostal nerves, leading to sharp, shooting pains when you roll onto that side.

  4. Organ-Related Causes
    • Liver enlargement (from fatty liver, hepatitis) can press against the diaphragm under your ribs.
    • Gallbladder irritation (gallstones, cholecystitis) often causes upper right abdominal pain that radiates under the ribs.
    • Kidney issues (stones, infection) sometimes present as flank pain that you feel near the lower rib edge.

  5. Digestive Factors
    • Gas or bloating in the colon can collect under the right rib tip, increasing discomfort when you lie down.
    • Acid reflux or indigestion occasionally registers as upper abdominal pain that worsens in certain positions.

Common Non-Serious Causes

• Muscle strain: Overexertion, sudden twisting or heavy lifting can injure intercostal muscles.
• Poor mattress or pillow support: A too-firm mattress or missing lumbar support may force your ribs into an uncomfortable angle.
• Minor rib bruise: A past bump or fall might make your ribs tender when pressure is applied.
• Gas buildup: Swallowed air or certain foods (beans, carbonated drinks) can distend the colon under the right ribs.

When to Suspect Something More Serious

Most “right side pain under rib” resolves on its own or with simple measures. However, seek medical attention immediately if you have:
• Severe, unrelenting pain that wakes you at night
• Fever, chills or signs of infection
• Yellowing of skin or eyes (jaundice)
• Difficulty breathing or chest tightness
• Blood in your urine or a burning sensation when you urinate
• Pain that spreads into your back, shoulder or down your arm

Diagnostic Steps and Tools

A doctor may use one or more of the following to pinpoint the cause:
• Physical exam: Checking for tenderness, swelling or signs of inflammation.
• Blood tests: Liver function, white blood cell count, kidney markers.
• Imaging studies: Ultrasound or CT scan to look at the liver, gallbladder and other organs.
• ECG (electrocardiogram): If there’s any concern about heart-related chest pain.
• Urinalysis: To rule out kidney stones or infection.

Home Remedies and Self-Care Tips

If your pain is mild and you don’t have red-flag symptoms, try these measures:

  1. Improve Your Sleep Setup
    • Use a medium-firm mattress and place a pillow between your knees.
    • Consider a wedge pillow under your torso to reduce direct pressure on your ribs.

  2. Apply Heat or Cold
    • Warm compress or heating pad can relax tight muscles.
    • An ice pack wrapped in a cloth may reduce inflammation if used in 15-minute intervals.

  3. Over-the-Counter Pain Relief
    • Nonsteroidal anti-inflammatory drugs (NSAIDs) like ibuprofen can ease muscle pain.
    • Always follow dosing instructions and consult a pharmacist if you’re on other medications.

  4. Gentle Stretching
    • Shoulder rolls and side stretches can relieve tension in your upper body.
    • Breathe deeply and move slowly; stop if you feel a sharp twinge.

  5. Watch Your Diet
    • Avoid gas-producing foods (cruciferous vegetables, beans, sodas) before bedtime.
    • Eat smaller meals and stay upright for at least 30 minutes after eating.

When to Get Professional Help

If home remedies aren’t helping after a few days, or if your symptoms worsen, it’s time to consult a healthcare provider. You might also consider a free, online symptom check, using the doctor approved Ubie Symptom Checker to get personalized guidance on your “right side pain under rib.”

Key Takeaways

• Lying on your right side can aggravate muscle, nerve or organ-related issues under the ribs.
• Most cases improve with posture fixes, gentle stretching and heat/ice.
• Watch for warning signs—fever, jaundice, severe pain, breathing trouble—and seek immediate care if they occur.
• Use a symptom checker like the Ubie Symptom Checker for quick, doctor-approved advice before your visit.

Always remember: persistent or severe pain under your ribs can sometimes signal a more serious condition. If you’re at all concerned—or if red-flag symptoms appear—please speak to a doctor right away.

(References)

  • * Higenbottam T, Allen D, Loh L, Clark TJ. Abdominal wall movement in normals and patients with hemidiaphragmatic and bilateral diaphragmatic palsy. Thorax. 1977 Oct;32(5):589-95-09ENG. doi: 10.1136/thx.32.5.589. PMID: 145664; PMCID: PMC470795.

  • * Kadzombe EA, Robson WJ. Perichondritis. Lancet. 1988 Oct 29;2(8618):1010-1. doi: 10.1016/s0140-6736(88)90755-6. PMID: 2902441.

  • * Wright JT. Slipping-rib syndrome. Lancet. 1980 Sep 20;2(8195 pt 1):632-4. doi: 10.1016/s0140-6736(80)90294-9. PMID: 6107417.

  • * Shapiro MJ. Composite myocutaneous flaps. Otolaryngol Head Neck Surg. 1981 Nov-Dec;89(6):969-73. doi: 10.1177/019459988108900618. PMID: 6801600.

  • * Hodges PW, Gandevia SC. Changes in intra-abdominal pressure during postural and respiratory activation of the human diaphragm. J Appl Physiol (1985). 2000 Sep;89(3):967-76. doi: 10.1152/jappl.2000.89.3.967. PMID: 10956340.

  • * Sood A, Rogers C. Floating kidney. BMJ Case Rep. 2018 Apr 17;2018. doi: 10.1136/bcr-2018-224921. Epub 2018 Apr 17. PMID: 29666105; PMCID: PMC5905778.

  • * Matarazzo L, Mazzocco M, Gioachin A, Tagliati S, Malaventura C, Maggiore G. Wandering Liver, Wondering Doctors! J Pediatr. 2018 Nov;202:326. doi: 10.1016/j.jpeds.2018.05.039. Epub 2018 Jun 25. PMID: 29954607.

  • * Rocha M, Dias AM, Coimbra J. A Challenging Abdominal Pain. Gastroenterology. 2020 May;158(6):e11-e13. doi: 10.1053/j.gastro.2019.11.022. Epub 2019 Nov 16. PMID: 31743733.

  • * Li N, Wu Z, Jiang C, Sun L, Li B, Guo J, Liu F, Zhou Z, Qin H, Tan W, Tian L. An automatic fresh rib fracture detection and positioning system using deep learning. Br J Radiol. 2023 Jun 1;96(1146):20221006. doi: 10.1259/bjr.20221006. Epub 2023 Apr 17. PMID: 36972072; PMCID: PMC10230380.

  • * Milunsky A, Milunsky JM, Hsu R. Abdominal Compression Syndromes in the Hypermobile Ehlers-Danlos Syndrome. Am J Med Genet A. 2025 Dec;197(12):e64182. doi: 10.1002/ajmg.a.64182. Epub 2025 Jul 13. PMID: 40653826.

Thinking about asking ChatGPT?Ask me instead

Tell your friends about us.

We would love to help them too.

smily Shiba-inu looking

For First Time Users

What is Ubie’s Doctor’s Note?

We provide a database of explanations from real doctors on a range of medical topics. Get started by exploring our library of questions and topics you want to learn more about.

Was this page helpful?

Purpose and positioning of servicesUbie Doctor's Note is a service for informational purposes. The provision of information by physicians, medical professionals, etc. is not a medical treatment. If medical treatment is required, please consult your doctor or medical institution. We strive to provide reliable and accurate information, but we do not guarantee the completeness of the content. If you find any errors in the information, please contact us.