|Cocci-shaped Enterococcus sp. bacteria taken from a pneumonia patient|
Sputum is mucus that is coughed up from the lower airways (the trachea and bronchi). In medicine, sputum samples are usually used for naked eye exam, microbiological investigation of respiratory infections and cytological investigations of respiratory systems. It is crucial that the specimen not include any mucoid material from the nose.
Naked eye exam of sputum can be done at home by a patient in order to note the various colors (see below). Any hint of yellow or green color (pus) suggests an airway infection (but does not indicate the type of organism causing it). Such color hints are best detected when the sputum is viewed on a very white background such as white paper, a white pot or a white sink surface. The more intense the yellow color, the more likely it is a bacterial infection (bronchitis, bronchopneumonia or pneumonia).
Having green, yellow, or thickened phlegm(sputum) does not always indicate the presence of an infection. Also, if an infection is present, the color of the phlegm(sputum) does not determine whether a virus, a bacterium, or another pathogen has caused it. Simple allergies can also cause changes in the color of the mucus. 
The best sputum samples contain very little saliva, as saliva contaminates the sample with oral bacteria. This is especially true for samples for laboratory testing in cytology or microbiology. Specimen adequacy is assessed by the laboratory technologists by examining a Gram stain or cytology stain of the sputum. More than 25 squamous epithelial cells at low power magnification exam under the microscope strongly suggests salivary contamination. Sputum samples have been used to quantify the degree of airway inflammation in human diseases such as asthma. Specifically, this work has demonstrated that a sub group of severe asthma patients have airway inflammation that is resistant to treatment with corticosteroids.
When a sputum specimen is plated out in microbiology, it is best to get the portion of the sample that most looks like yellow pus onto the swab. If there is any blood in the sputum, this should also be on the swab. Microbiological sputum samples are used to look for infections, such as Moraxella catarrhalis, Mycobacterium tuberculosis, Streptococcus pneumoniae, and Haemophilus influenzae. Other pathogens can also be found.
Purulent sputum contains pus, composed of white blood cells, cellular debris, dead tissue, serous fluid, and viscous liquid (mucus). Purulent sputum is typically yellow or green. It is seen in cases of pneumonia, bronchiectasis, lung abscess, or an advanced stage of bronchitis.
Sputum can be (when examined by the naked eye):