That sharp pain in your chest every time you cough can be alarming. Chest pain while coughing is a common symptom with various potential causes, ranging from mild to more serious. Often, it's due to strained muscles from forceful coughing, especially during a cold or flu. The intercostal muscles between your ribs can become sore and inflamed.
However, chest pain accompanied by coughing can also indicate a respiratory infection like bronchitis or pneumonia. These infections inflame the airways and lungs, leading to discomfort. Less commonly, it could be a sign of pleurisy (inflammation of the lining around the lungs) or even, in rare cases, a more serious condition.
If your chest pain is severe, persistent, accompanied by fever, shortness of breath, or bloody cough, seek immediate medical attention. Otherwise, rest, over-the-counter pain relievers, and staying hydrated may help. If the pain lingers for more than a week, it's always best to consult your doctor to rule out any underlying medical issues and get proper diagnosis and treatment.