A gram stain is a test that's often used to identify the type of bacteria that has caused a bacterial infection.
The test is used to find out whether bacteria are present in an area of the body that's usually sterile, such as spinal fluid.
A sample is taken from the infected area and placed on a glass slide. A series of stains are added to the sample on the slide which is then examined under a microscope. The bacteria will either be purple (gram positive) or pink (gram negative).
The initial result of the gram stain can provide doctors with an indication of the type of bacteria that may have caused the infection. This allows treatment with appropriate antibiotics to be started while further tests are carried out to confirm the specific bacteria responsible.