Rib pain when you breathe usually comes from the muscles, cartilage, or tissues surrounding your ribs rather than from the ribs themselves. The most common causes are inflammation of the cartilage connecting your ribs to your breastbone, strained muscles between your ribs, or irritation of the thin tissue lining your lungs. Most of these resolve on their own, but certain combinations of symptoms signal something more serious.
Costochondritis: The Most Common Cause
Costochondritis is inflammation of the cartilage where your ribs attach to your breastbone. It produces a sharp, stabbing pain in the front of your chest that gets worse when you take a deep breath, twist your torso, or cough. The hallmark feature is that pressing on the area reproduces the pain. If you can pinpoint the sore spot by pushing on it with your finger, costochondritis is one of the most likely explanations.
A clinical prediction tool used in primary care found that chest pain reproduced by pressing on it, combined with pain that’s well-localized and stabbing in nature, strongly points toward a chest wall cause rather than something involving the heart or lungs. When all those features are present, the probability of a chest wall problem exceeds 70%.
Costochondritis typically gets better on its own over a few weeks to several months. Anti-inflammatory pain relievers like ibuprofen can help manage the discomfort while it heals. There’s often no clear trigger, though it can follow a respiratory infection, heavy lifting, or repetitive upper-body movement.
Strained Muscles Between the Ribs
The intercostal muscles sit between each rib and expand and contract with every breath. When one of these muscles is strained, breathing itself becomes painful because you’re repeatedly using the injured tissue. The pain is usually sharp and localized to one side, with tender spots you can feel between the ribs.
Common causes include sudden twisting or stretching, heavy lifting with poor form, direct impact to the chest from a fall or contact sport, and repetitive upper-body activities like painting, gardening, or manual labor. One frequently overlooked cause is persistent coughing. A bad cold, bronchitis, or allergy season can forcefully contract the ribcage hundreds of times a day, overworking the intercostal muscles until they’re genuinely strained.
Intercostal strains heal with rest, but “rest” is relative when the injured muscles move every time you breathe. Shallow breathing and avoiding movements that aggravate the pain will help, along with over-the-counter anti-inflammatories and ice in the first couple of days.
Pleurisy: Inflammation of the Lung Lining
Your lungs are wrapped in two thin layers of tissue called the pleura. Normally these layers glide smoothly against each other as you breathe. When they become inflamed, a condition called pleurisy, they rub together like two pieces of sandpaper. This creates a distinctive sharp chest pain that worsens when you inhale, cough, or sneeze, and eases or stops entirely when you hold your breath.
Pleurisy pain can also worsen with upper-body movement and spread to your shoulders or back. It’s often triggered by a viral or bacterial infection, including pneumonia, but can also result from autoimmune conditions or a blood clot in the lung.
The “hold your breath” test is a useful clue. If the pain disappears the moment you stop breathing, the pleura is likely involved. Musculoskeletal pain, by contrast, often persists with certain positions or movements regardless of breathing.
Rib Stress Fractures
Ribs can develop small stress fractures without a single traumatic event. This is most common in athletes who perform repetitive upper-body motions, particularly rowers, but it also affects people with compromised bone health from poor nutrition, low energy availability, or hormonal changes. The pain typically shows up along ribs 5 through 9 on the front or side of the chest, though it can also appear in the back.
Stress fractures often feel vague at first, more like stiffness than a sharp injury. The key indicator is that a few days of rest doesn’t fully resolve the pain. The location where you feel discomfort doesn’t always match the actual fracture site on imaging, which can make self-diagnosis misleading. If your rib pain started during a period of increased physical activity and hasn’t improved with rest, imaging can confirm or rule out a stress injury.
Pericarditis: Inflammation Around the Heart
The sac surrounding the heart can become inflamed, producing sharp, stabbing chest pain that mimics rib or lung problems. Pericarditis pain worsens when you breathe deeply, cough, swallow, or lie flat. The distinguishing feature is positional: the pain often eases when you sit up and lean forward. If you notice that leaning forward provides noticeable relief, this is worth mentioning to a doctor, as it points away from a musculoskeletal cause and toward something involving the heart’s outer lining.
When Rib Pain Signals an Emergency
A pulmonary embolism, a blood clot that travels to the lungs, can cause sharp chest pain that worsens with deep breathing and closely resembles pleurisy or a muscle strain. The difference is in the accompanying symptoms. A pulmonary embolism typically comes with sudden, unexplained shortness of breath that occurs even at rest and worsens with activity. You may also experience a rapid or irregular heartbeat, lightheadedness, coughing up blood-streaked mucus, excessive sweating, or swelling and pain in one leg (usually the back of the lower calf).
Seek emergency care if your breathing pain is accompanied by any of those symptoms, or if you experience fainting. The combination of sharp chest pain on inhalation with sudden shortness of breath at rest is the most important red flag to watch for.
How Doctors Figure Out the Cause
A chest X-ray is usually the first test ordered. It can reveal pneumonia, fluid around the lungs, rib fractures, and some heart abnormalities. If the X-ray is normal and the pain is reproducible by pressing on the chest wall, a musculoskeletal cause like costochondritis or an intercostal strain is the most likely diagnosis, and no further imaging is typically needed.
When the picture is less clear, a CT scan provides more detail about the lungs, pleura, and blood vessels, and is particularly useful for detecting pulmonary embolisms. MRI is occasionally used when the pain involves structures right against the chest wall.
Fibromyalgia and Chronic Rib Pain
People with fibromyalgia frequently experience chest wall pain, including costochondritis. One theory is that fibromyalgia involves widespread inflammation of the fascia, a thin connective tissue layer throughout the body, which may make the rib cartilage more prone to inflammation. Fibromyalgia also amplifies pain signals, so costochondritis that might be mildly uncomfortable for most people can become significantly more painful. People with fibromyalgia are also more likely to have joint hypermobility, which can lead to a condition called slipping rib syndrome, where a lower rib shifts slightly out of position and irritates surrounding nerves and tissue.
If you have a chronic pain condition and develop new or worsening rib pain with breathing, it’s worth distinguishing between a flare of your existing condition and a new cause that needs separate attention.