A sharp pain in the chest or ribs when breathing in may be due to a muscle strain or anxiety. It can also sometimes indicate an injury, pneumonia, pleurisy, or pericarditis, which may need urgent medical attention.

Depending on the cause, pain around the chest and ribs may resolve on its own or with minimal treatment. However, it can occasionally be an emergency, requiring urgent medical intervention. It is best to visit a doctor for an accurate diagnosis if a person experiences a sharp pain when breathing in.

This article discusses the possible causes of sharp pain when breathing in, as well as when to seek medical attention.

Person lies on back with pain when breathing in.Share on Pinterest
Image credit: SimonSkafar/Getty Images

Pneumonia is an infection of the lungs that causes inflammation of the air sacs, which fill up with fluid or pus. Pneumonia occurs as a result of bacterial, viral, or fungal infection. The severity of the condition can depend on a person’s age and overall health.

People with pneumonia often experience chest pain when breathing in. The other symptoms, which may range from mild to severe, include:

Both the type of pneumonia and the severity of the condition will determine the treatment options. These can include:

A doctor may also recommend over-the-counter (OTC) medications to reduce the symptoms of pneumonia.

Learn more about what pneumonia feels like.

Pneumothorax, also known as a collapsed lung, occurs when air enters the pleural cavity, which is a space between the lungs and chest wall. The air accumulation can increase pressure in the pleural cavity, making part of a lung or even an entire lung collapse.

Pneumothorax can occur as a result of a chest injury or an underlying lung disease, such as tuberculosis.

People with pneumothorax may experience sharp pain in the chest that can worsen when breathing in. The degree of collapse determines other signs and symptoms of pneumothorax.

These may include:

Treatment for pneumothorax involves inserting a chest tube or needle to remove excess air from the pleural cavity. For mild cases, the condition may heal without this procedure being necessary.

Pleurisy is an inflammation of the pleura, a tissue that lines the chest cavity and covers the outside surface of the lungs.

Pleurisy often results from viral or bacterial infection. Symptoms of pleurisy can include:

  • sharp pain in the chest that worsens when deeply breathing
  • pain that radiates to the shoulders and back
  • shortness of breath
  • coughing

The treatment for pleurisy will depend on the cause of the underlying condition. For instance, if the condition is due to a bacterial infection, a doctor will prescribe antibiotics to manage the symptoms.

For the pain and inflammation that pleurisy causes, a doctor may recommend nonsteroidal anti-inflammatory drugs (NSAIDs), such as ibuprofen.

Costochondritis is an inflammation of the cartilage, a tissue that connects the breastbone and ribs. The chest pain that costochondritis causes can range from mild to severe.

People with costochondritis often experience chest pain, which may radiate to the back.

The exact cause of costochondritis is unclear. However, the condition may result from:

  • a chest injury
  • strenuous exercise
  • severe coughing
  • infection

Costochondritis typically heals on its own within a few weeks or months. A doctor may recommend NSAIDs to relieve pain.

Physical therapy, including stretching exercises and nerve stimulation, may also be helpful, as well as applying heat packs.

If other measures do not work, a doctor might recommend injecting corticosteroids or numbing medication directly into the affected area.

A traumatic injury to the chest may result from a sports-related incident, a surgical procedure, or an accident, such as a fall from a height.

Approximately two-thirds of people who experience physical trauma have chest trauma, with the severity ranging from a rib fracture to injury of the heart.

Chest trauma can lead to sharp pain when breathing in. Other symptoms of chest trauma may include:

  • shortness of breath
  • pain that radiates to the neck or back
  • coughing up blood
  • bruising of the chest wall

People with chest trauma should seek immediate medical attention. Doctors will determine the best treatment for chest trauma based on the cause and severity.

Pericarditis is an inflammation of the pericardium, the sac-like tissue surrounding the heart.

People with pericarditis may experience sharp pain when breathing in or a dull ache that may feel better when sitting upright or leaning forward. The pain may also radiate to the left shoulder and neck.

Other symptoms of pericarditis can include:

  • fever
  • shortness of breath
  • lightheadedness
  • heart palpitations
  • swelling of the abdomen and legs
  • a cough

The cause of pericarditis remains unclear, but viral infections are a common cause. Other factors may also cause pericarditis, including:

  • bacterial, fungal, or other infections
  • injury to the heart or surgery
  • inflammatory conditions, such as rheumatoid arthritis or lupus
  • other health conditions, including tuberculosis or kidney failure

The best treatment for pericarditis depends on the cause and severity of the condition. If the condition is mild, it usually gets better on its own. For more severe cases, a doctor may prescribe OTC pain relievers and corticosteroids to reduce inflammation.

A heart attack can cause a sharp pain in the chest. It can also feel like:

  • squeezing
  • heaviness
  • tightness
  • pressure

Other symptoms of a heart attack can include:

  • lightheadedness
  • dizziness
  • shortness of breath
  • nausea
  • vomiting
  • coughing
  • wheezing
  • sweating
  • anxiety

A heart attack happens when something stops the supply of blood to the heart. This is a medical emergency, and a person should seek immediate medical help if they suspect they are experiencing a heart attack.

Treatment for a heart attack can depend on the severity of the condition. A person may require medication to dissolve any blood clots that have stopped the supply of blood to the heart. In some cases, surgery may also be necessary.

Learn more about recognizing the signs of a heart attack.

Severe stress and anxiety may cause anxiety attacks. An anxiety attack can produce a stabbing, needle-like sensation in the middle of the chest.

Other symptoms can include:

Treatment options for anxiety-related disorders include:

Anyone considering seeking professional help should ensure that they select a well-trained and qualified professional.

Learn more about anxiety and chest pain.

Sharp pain when breathing in can sometimes be a sign of a serious condition. A person should speak with a doctor about any unexplained sharp pain when breathing in, particularly if it occurs alongside the following symptoms:

  • difficulty breathing
  • chest tightness or pain
  • severe shortness of breath
  • rapid breathing
  • air hunger, which refers to the inability to breathe in sufficient air
  • sudden dizziness
  • fever
  • excessive sweating

Here are some frequently asked questions about pain when breathing in.

What does it mean when a person takes a deep breath and they get a sharp pain in their back?

A sharp pain in the back when breathing in may be due to pleurisy. Pain from costochondritis may also radiate to the back. Back pain may also be due to trauma. It is important to contact a doctor for an accurate diagnosis if a person experiences back pain when breathing in.

Why do I get sharp needle-like pain in my chest when I breathe?

A sharp needle-like chest pain when breathing may be due to an anxiety attack. However, there are many possible causes of sharp chest pain. As treatment will depend on the underlying cause, it is important to contact a doctor for a diagnosis.

What does a stabbing pain in the lungs mean?

Pneumonia, a condition affecting the lungs, can cause a sharp or stabbing pain. Other respiratory conditions may also cause this type of pain.

Experiencing sharp pain when breathing may arise due to various conditions, such as pleurisy, pneumothorax, costochondritis, pericarditis, and heart attack. Anxiety and chest trauma can also cause this pain.

Anyone experiencing sharp pain when breathing in should contact a doctor, who will likely want to carry out an evaluation to diagnose the cause. Once they have confirmed this, the doctor will be able to put a treatment plan in place.