
Coughing up blood (hemoptysis) can have many possible causes, some of which are serious, and some which may be of little concern. It is important to see a doctor for a proper diagnosis to rule out serious conditions that can cause coughing up blood.
Causes of coughing up blood include:
- Infection: the most common cause
- Bronchitis
- Bronchiectasis
- Pneumonia
- Lower respiratory tract infection
- Chronic obstructive pulmonary disease (COPD)
- Smoking
- Foreign object that has been inhaled (aspirated) (usually seen in children)
- Cystic fibrosis
- Lung cancer
- Esophageal cancer
- Fungal infection with Aspergillus (aspergillosis)
- Tuberculosis
- Pulmonary edema
- Wegener's granulomatosis
- Inflammation of blood vessels (vasculitis) in the lung
- Goodpasture syndrome
- Granulomatosis with polyangiitis
- Use of certain drugs
- Certain or procedures
- Bronchoscopy
- Laryngoscopy
- Spirometry
- Tonsillectomy
- Upper airway biopsy
Uncommon causes of coughing up blood that can be serious or life-threatening include:
- Other lung infections such as bacterial lung abscess and/or necrotizing pneumonia
- Acute bronchitis
- Immunologic lung diseases, such as anti-glomerular basement membrane (anti-GBM; Goodpasture) disease, granulomatosis with polyangiitis, systemic lupus erythematosus (SLE), idiopathic pulmonary hemosiderosis, primary antiphospholipid antibody syndrome, Behçet syndrome, and microscopic polyangiitis
- Penetrating, rather than blunt, trauma
- Chemotherapy and bone marrow transplantation
- Pulmonary vascular diseases
- Pulmonary arteriovenous malformations (PAVMs)
- Mitral stenosis
- Blood clot in the lung (pulmonary embolism)
- Congenital heart disease or severe pulmonary hypertension
- Acquired and iatrogenic trauma
- Posterior arterial nosebleeds
- Right heart catheterization (i.e., pulmonary artery catheterization)
- Heart failure and heart valve disorders
- Medical interventions, including percutaneous or transbronchial lung biopsy, cryobiopsy, central vein venipuncture during pacemaker insertion, and ablative procedures for endobronchial masses
- Fistulas, such as fistulas between the aorta and the airway
What Are Symptoms of Coughing Up Blood?
Coughing up blood is a symptom in itself. Blood that is coughed up often appears bright red and the sputum may look bubbly.
Emergency Signs
See a doctor right away or go to a hospital’s emergency department if coughing up blood is due to trauma or injury to the chest or is accompanied by any of the following:
- Unexplained coughing up blood
- Large amounts of blood coughed up (more than a one teaspoon)
- Shortness of breath
- Signs of significant blood loss (weakness, dizziness when standing up, lightheadedness, thirst, sweating, and a rapid heart rate)
- Fatigue
- Blood is also in the urine or stool
- Having a tracheostomy
- If you take blood thinning medications (anticoagulants)
How Is Coughing Up Blood Diagnosed?
In addition to a patient history and physical examination, tests used to diagnose the cause of coughing up blood may include:
- Chest X-ray
- Chest computerized tomography (CT) scan
- Blood tests
- Complete blood count (CBC)
- Blood chemistry
- Arterial blood gas
- Urinalysis
- Coagulation studies such as prothrombin time (PT) or partial thromboplastin time (PTT)
- Bronchoscopy
- Lung biopsy
- Lung scan
- Pulmonary arteriography
- Sputum culture and smear
- Pulse oximetry
What Is the Treatment for Coughing Up Blood?
In mild cases, coughing up blood may go away on its own or when the underlying cause is treated.
Smokers should stop smoking. Other treatments for coughing up blood may include:
- Antibiotics for pneumonia, tuberculosis, or other bacterial infections
- Chemotherapy or radiation for lung cancer
- Steroids for inflammatory conditions
Treatment for serious cases of coughing up large amounts of blood may require hospitalization which may include a stay in the hospital’s intensive care unit (ICU).
From 
Lung Disease/COPD Resources
https://www.merckmanuals.com/home/lung-and-airway-disorders/symptoms-of-lung-disorders/coughing-up-blood
https://www.uptodate.com/contents/etiology-of-hemoptysis-in-adults?search=Coughing%20Up%20Blood%20&source=search_result&selectedTitle=2~150&usage_type=default&display_rank=2
https://www.uclahealth.org/lungcancer/coughing-up-blood-hemoptysis