Gram staining differentiates bacteria by the chemical and physical properties of their cell walls by detecting peptidoglycan, which is present in the cell wall of Gram-positive bacteria. Gram-negative cells also contain peptidoglycan, but a very small layer of it that is dissolved when the gram staining lab report is added. This is why the cell loses its initial color from the primary stain.
The Gram stain is almost always the first step in the preliminary identification of a bacterial organism. While Gram staining is a valuable diagnostic tool in both clinical and research settings, not all bacteria can be definitively classified by this technique. This gives rise to gram-variable and gram-indeterminate groups. Carl Friedländer in the morgue of the city hospital in Berlin in 1884. The Gram stain is not an infallible tool for diagnosis, identification, or phylogeny, and it is of extremely limited use in environmental microbiology.