Why Does the Right Side of My Rib Cage Hurt?

Pain on the right side of your rib cage can come from a surprisingly wide range of sources, from something as simple as trapped gas to gallbladder problems, muscle strain, or lung irritation. The most common culprits are gallbladder issues, musculoskeletal injuries, and digestive problems. Where exactly you feel the pain, what makes it worse, and what other symptoms come with it are the best clues to narrowing down the cause.

Gallbladder and Bile Duct Problems

The gallbladder sits directly under your right rib cage, making it one of the first organs doctors consider when you report pain in this area. Gallstones are the leading cause. When a stone gets stuck in the opening of your gallbladder or lodged in a bile duct, it blocks the flow of bile and triggers what’s called biliary colic: sudden, intense pain that builds to a peak before gradually fading. Episodes can last anywhere from minutes to hours.

This type of pain tends to be sharp, cramping, or squeezing. It doesn’t come and go in quick waves during an episode. Instead, it stays steady at a high intensity before slowly easing off. You’ll typically feel it under your right rib cage, but it can radiate into your right shoulder or back. Many people first notice it after a fatty meal.

If your gallbladder becomes persistently inflamed (cholecystitis), the pain pattern shifts. Instead of coming in episodes, the pain stays and gets worse over time. Inflammation in the bile ducts themselves, called cholangitis, produces a recognizable trio of symptoms: upper right abdominal pain, fever, and jaundice (yellowing of the skin or eyes). That combination calls for prompt medical attention.

Liver Conditions

Your liver occupies much of the space behind your right rib cage. Upper right abdominal pain is frequently related to liver disease, including alcohol-induced hepatitis, fatty liver disease, viral hepatitis, autoimmune hepatitis, and liver toxicity from medications or supplements. Liver-related pain tends to feel like a deep, dull ache rather than the sharp episodes of gallbladder trouble. It may come with fatigue, nausea, or a general sense of feeling unwell. In more advanced cases, jaundice, dark urine, pale stools, or unexplained weight loss can develop.

Muscle Strain and Costochondritis

Not all right-sided rib pain comes from internal organs. The muscles between your ribs (intercostal muscles) can strain from heavy lifting, twisting, intense coughing, or even sleeping in an awkward position. The hallmark of musculoskeletal rib pain is that it’s directly tied to movement. It hurts more when you twist your torso, reach overhead, or press on the sore spot.

Costochondritis is a related condition where the cartilage connecting your ribs to your breastbone becomes inflamed. The pain is sharp or aching, worsens with deep breaths, coughing, or sneezing, and is usually worst right where the cartilage meets the bone. You can often reproduce the pain by pressing on the area, which helps distinguish it from organ-related causes. Costochondritis typically resolves on its own over several weeks with rest and over-the-counter anti-inflammatory medication.

Rib Fractures and Bruising

A direct blow to your right side, a fall, or even severe coughing can fracture or bruise a rib. The symptoms overlap heavily: pain that spikes when you breathe, cough, or move your upper body, along with tenderness and sometimes visible bruising. You may instinctively hold your side or take shallow breaths to avoid the pain. Most rib fractures heal on their own but need at least a month of recovery. Symptoms generally start improving after a few weeks. If you feel severe pain or have trouble breathing after chest trauma, that warrants immediate evaluation.

Trapped Gas

This is one of the most common and least worrying causes of right-sided rib pain, yet it can feel alarmingly intense. Gas that collects at the hepatic flexure (the sharp bend in your colon near the liver, right under your ribs) creates pressure, bloating, and pain that can convincingly mimic gallstones or even appendicitis. The pain often shifts or improves after passing gas or having a bowel movement. Carbonated drinks, high-fiber foods, swallowed air, and food intolerances are typical triggers.

Lung-Related Causes

Your right lung sits directly above your rib cage, and inflammation of the tissue lining the lungs and chest wall (pleurisy) can produce sharp, stabbing pain on the right side. The defining feature of pleurisy is that the pain worsens noticeably every time you breathe in and eases when you hold your breath. It gets worse with coughing or sneezing and can spread to your shoulder or back. Pleurisy usually develops from a viral infection, pneumonia, or other lung conditions.

Pneumonia affecting the right lung can also cause right-sided rib pain, typically accompanied by fever, cough (sometimes producing colored mucus), and shortness of breath. A pulmonary embolism, a blood clot in the lung, is a less common but serious possibility. It causes sudden chest pain, difficulty breathing, a rapid or irregular heartbeat, and sometimes coughing up blood. This is a medical emergency.

Kidney Problems

Your right kidney sits behind your stomach and under your rib cage toward your back, so kidney issues often register as right-sided rib pain, particularly in the flank area. Kidney stones cause severe, wave-like pain that can radiate from your back and side down toward your groin. A kidney infection produces a constant, dull ache. Both commonly come with additional symptoms: nausea, vomiting, painful urination, or fever. Kidney pain generally feels deeper than muscle or rib pain, and pressing on the area from the outside doesn’t change the intensity.

How to Tell What’s Causing Your Pain

A few patterns can help you get oriented before you see a doctor:

  • Pain that worsens after eating, especially fatty foods, points toward gallbladder problems.
  • Pain you can reproduce by pressing on the spot or twisting your body suggests a musculoskeletal cause like a strain or costochondritis.
  • Pain that spikes with every breath and eases when you hold still is more consistent with pleurisy or a rib fracture.
  • Deep flank pain with urinary symptoms suggests a kidney stone or infection.
  • Pain that shifts or resolves after passing gas is likely trapped gas.

Doctors typically start with blood work and an ultrasound to evaluate the gallbladder and liver. If those come back normal, a CT scan, specialized bile duct imaging, or an MRI may follow depending on your symptoms. For suspected musculoskeletal pain, imaging is often unnecessary unless a fracture is a concern.

Signs That Need Urgent Attention

Most right-sided rib pain resolves on its own or turns out to be something manageable. But certain combinations of symptoms signal something more serious. Seek emergency care if your pain comes with yellowing of the skin or eyes, a high fever, difficulty breathing, a rapid or irregular heartbeat, coughing up blood, or vomiting that won’t stop. Chest pain paired with extreme fatigue, jaw pain, or back pain can sometimes indicate a heart attack, particularly in women, where symptoms are more likely to be atypical. Unbearable pain on its own is also a valid reason to go to the emergency department.