Gram Stain Steps: Primary Stain, Mordant and Counterstain

Last reviewed November 2026

Key ideas

Gram staining uses crystal violet, iodine, a decolorizer and safranin to sort bacteria by cell wall. Gram-positive bacteria have a thick peptidoglycan wall and stain purple. Gram-negative bacteria have a thin wall plus an outer membrane and stain pink.

  • The difference affects how bacteria cause disease and respond to antibiotics.

The Gram stain is a differential staining procedure: it uses different stains to make bacteria visible and tell them apart. It was developed by Danish microbiologist Hans Christian Gram in 1884 as a way to distinguish between bacteria with different types of cell walls. It’s still one of the most frequently used staining techniques and an effective way to identify bacteria.

Hans Christian Gram

“I have therefore published the method, although I am aware that as yet it is very defective and imperfect; but it is hoped that also in the hands of other investigators it will turn out to be useful.”

A brief overview of bacterial cell structure

Bacteria are unicellular organisms known as prokaryotes. A distinguishing feature of prokaryotes is that they lack membrane-bound organelles.

Without a nucleus, bacteria keep their chromosome, usually a single piece of circular, double-stranded DNA, in an area of the cell called the nucleoid. Many bacteria also have extra circular DNA called plasmids, which often carry genes that help them survive.

Most prokaryotes have a cell wall outside the plasma membrane. The cell wall protects the cell and gives it its shape. Some also have a capsule, an outermost layer that helps them attach to surfaces, protects them from drying out and from phagocytic cells, and makes pathogens more resistant to our immune responses.

Some species of bacteria also have flagella, used for movement, and pili or fimbriae, used to attach to surfaces, including other cells.

[Add image: bacterial cell structure diagram from the old page. Credit: OpenStax]

Check for understanding

1. Bacteria don’t have a nucleus. Where do they keep their chromosome?

Show answer

In an area of the cell called the nucleoid.

2. What are plasmids?

Show answer

Extra circular pieces of DNA in many bacteria, often carrying genes that help them survive.

3. What’s the difference between flagella and pili?

Show answer

Flagella are used for movement. Pili (or fimbriae) are used to attach to surfaces, including other cells.

Gram stain reagents and procedure

Reagents

  • Crystal violet: primary stain (purple)
  • Gram’s iodine: mordant (stabilizes the stain)
  • Ethanol or acetone-ethanol: decolorizer
  • Safranin: counterstain (pink to red)

Procedure

  1. Crystal violet, the primary stain, is applied to a heat-fixed smear, turning all of the cells purple.
  2. Gram’s iodine, a mordant, is added. A mordant sets or stabilizes a stain. The iodine binds the crystal violet, forming a crystal violet–iodine complex that clumps and stays trapped in thick layers of peptidoglycan in the cell wall.
  3. A decolorizer, usually ethanol or an acetone-ethanol mix, is added. Cells with thick peptidoglycan walls are much less affected and stay purple. The decolorizer washes the dye out of cells with thin peptidoglycan walls, leaving them colorless.
  4. Safranin, the counterstain, is added. It stains the decolorized cells pink and is barely noticeable in cells that are still purple.

[Add image: table of Gram staining steps from the old page, with alt text “Table showing the steps of Gram staining and how gram-positive and gram-negative bacteria look after each step.” Credit: OpenStax]

Check for understanding

1. What does Gram’s iodine do in the procedure?

Show answer

It’s a mordant. It binds the crystal violet to form a crystal violet–iodine complex that stays trapped in thick peptidoglycan walls.

2. Put the four reagents in order.

Show answer

Crystal violet, Gram’s iodine, decolorizer (ethanol or acetone-ethanol), then safranin.

3. What color are all the cells after the first step?

Show answer

Purple, from the crystal violet.

Try it

Stain the slides yourself in the Gram stain virtual lab: make a smear, time each reagent, then identify bacteria from five patient samples. Try leaving the alcohol on too long to see a Gram-positive turn pink. To design your own experiment, try the Gram stain investigation lab.

The cell wall: why the stains differ

Gram-positive (purple) and Gram-negative (pink) bacteria stain differently because their cell walls are built differently:

  • Gram-positive bacteria have a thick peptidoglycan cell wall that holds on to the crystal violet.
  • Gram-negative bacteria have a thin peptidoglycan layer sandwiched between an inner plasma membrane and an outer membrane.

Check for understanding

1. After Gram staining, the cells in a sample look pink. What does that tell you about their cell walls?

Show answer

They’re Gram-negative. Their thin peptidoglycan layer loses the crystal violet during decolorizing, so they take up the pink safranin counterstain.

2. What surrounds the thin peptidoglycan layer in Gram-negative bacteria?

Show answer

An inner plasma membrane on one side and an outer membrane on the other.

3. What color are Gram-positive bacteria at the end of the stain?

Show answer

Purple.

Things to consider when Gram staining

Purple, crystal violet–stained cells are called Gram-positive, and pink, safranin-stained cells are Gram-negative. A few things can throw off the results:

  1. Old cultures: older cells may have damaged cell walls, which can make Gram-positive bacteria look Gram-negative. Use fresh cultures to avoid a false negative.
  2. Decolorizing too long: if the decolorizer is left on too long, cells that should be Gram-positive may lose the crystal violet and look Gram-negative.

Check for understanding

1. Why can an old culture of Gram-positive bacteria look Gram-negative?

Show answer

Older cells may have damaged cell walls that don’t hold on to the crystal violet, giving a false negative. Fresh cultures avoid this.

2. What happens if the decolorizer is left on too long?

Show answer

Gram-positive cells can lose the crystal violet and look Gram-negative.

3. How can you avoid false negatives from old cultures?

Show answer

Use fresh cultures.

Gram-negative and Gram-positive bacteria

Differences in the cell wall

Gram-positive bacteria have a cell wall made of many layers of peptidoglycan, 30 to 100 nm thick in total. Gram-negative bacteria have a much thinner peptidoglycan layer, no more than about 4 nm, and a more complex cell envelope overall. The cell wall isn’t the only difference between the two groups.

[Add image: Gram-positive vs. Gram-negative cell wall diagram from the old page. Credit: Biomed Guide]

What are porins?

Porins are large proteins in the outer membrane of Gram-negative bacteria. They form a central pore large enough to let molecules pass through by passive diffusion.

Gram-negative bacteria have an outer membrane

Gram-negative bacteria have a second lipid bilayer, the outer membrane, on the outside of the thin peptidoglycan layer. The outer layer of this membrane contains lipopolysaccharides (LPS). LPS molecules are bacterial endotoxins and a major cause of the symptoms of Gram-negative infections, such as fever, bleeding and septic shock. The structure of LPS varies between species and strains, and some forms are far more dangerous than others.

Gram-positive bacteria have teichoic acids

Teichoic acids and lipoteichoic acids are thought to stabilize the peptidoglycan wall by making it more rigid. Teichoic acids anchored to the cell membrane are called lipoteichoic acids. These acids can act as antigens, meaning the immune system can recognize them, and they contribute to the ability of some Gram-positive bacteria to cause disease.

For example, some bacteria in the genus Streptococcus use teichoic and lipoteichoic acids to bind to proteins on the surface of host cells, which helps them cause infection.

Check for understanding

1. What are lipopolysaccharides (LPS), and which group of bacteria has them?

Show answer

LPS are molecules in the outer membrane of Gram-negative bacteria. They’re endotoxins and a major cause of symptoms such as fever and septic shock.

2. How thick is the peptidoglycan wall in each group?

Show answer

Gram-positive: 30 to 100 nm. Gram-negative: no more than about 4 nm.

3. What do teichoic acids do in Gram-positive bacteria?

Show answer

They’re thought to stabilize the peptidoglycan wall by making it more rigid, and they can help some bacteria cause disease.

Clinical relevance of the Gram stain

Beyond how they react to dyes, the chemical differences between Gram-positive and Gram-negative bacteria matter in medicine. Gram staining helps clinicians quickly sort bacteria in a sample into groups with known properties. For example, Gram-negative bacteria tend to be more resistant to certain antibiotics than Gram-positive bacteria.

Check for understanding

1. Why is a Gram stain useful to a clinician before choosing treatment?

Show answer

It quickly sorts bacteria into groups with known properties. For example, Gram-negative bacteria tend to be more resistant to certain antibiotics.

2. Which group tends to be more resistant to certain antibiotics?

Show answer

Gram-negative bacteria.

3. Besides staining differently, why do the chemical differences between the groups matter?

Show answer

They affect how bacteria behave in the body and respond to treatment, which matters in medicine.

Common Gram-positive and Gram-negative bacteria

BacteriumGram reactionShapeDisease it can cause
Staphylococcus aureusPositiveCocci in clustersSkin infections, MRSA
Streptococcus pyogenesPositiveCocci in chainsStrep throat
Bacillus anthracisPositiveRodsAnthrax
Listeria monocytogenesPositiveRodsFood poisoning (listeriosis)
Escherichia coliNegativeRodsUrinary tract infections, food poisoning
Salmonella speciesNegativeRodsFood poisoning
Neisseria gonorrhoeaeNegativeCocci in pairsGonorrhea
Bordetella pertussisNegativeShort rodsWhooping cough

Check for understanding

1. What color would E. coli be after a Gram stain?

Show answer

Pink, because it’s Gram-negative.

2. Staphylococcus aureus stains purple. What does that tell you about its cell wall?

Show answer

It’s Gram-positive, with a thick peptidoglycan wall.

3. Strep throat is caused by which bacterium, and is it Gram-positive or Gram-negative?

Show answer

Streptococcus pyogenes, which is Gram-positive.

Step timings and lab tips

  1. Prepare and heat-fix a thin smear of bacteria on a slide.
  2. Crystal violet: flood the slide for about 1 minute, then rinse gently with water.
  3. Gram’s iodine: flood for about 1 minute, then rinse.
  4. Decolorizer: add drop by drop for about 5 to 15 seconds, until the runoff is clear, then rinse right away. This is the step most likely to go wrong.
  5. Safranin: flood for about 1 minute, rinse and blot dry.
  6. View under oil immersion at 1000x magnification.

Tips: use a fresh culture, make the smear thin, and always run a known Gram-positive and Gram-negative control if you can.

Check for understanding

1. Which step is the most likely to cause a wrong result, and why?

Show answer

Decolorizing. Too long can wash crystal violet out of Gram-positive cells; too short can leave Gram-negative cells purple.

2. How long is crystal violet usually left on the slide?

Show answer

About 1 minute.

3. What magnification is used to view a Gram stain?

Show answer

1000x, with oil immersion.

Other staining methods

StainWhat it showsResultExample organisms
Acid-fast (Ziehl-Neelsen)Bacteria with waxy mycolic acid in their wallsAcid-fast cells stay red; others turn blueMycobacterium tuberculosis
Endospore (Schaeffer-Fulton)Tough, dormant endosporesEndospores green; cells pinkBacillus, Clostridium
Capsule (negative stain)The capsule around some bacteriaA clear halo against a dark backgroundKlebsiella, Streptococcus pneumoniae

Check for understanding

1. Which stain would you use to identify the bacterium that causes tuberculosis?

Show answer

The acid-fast stain.

2. In an endospore stain, what color are the endospores?

Show answer

Green.

3. How does a capsule appear in a capsule stain?

Show answer

As a clear halo around the cell, against a dark background.

References

  1. Parker N, Schneegurt M, Thi Tu AH, Lister P, Forster BM. “2.4 Staining Microscopic Specimens.” Microbiology. OpenStax, 2016. openstax.org/books/microbiology/pages/2-4-staining-microscopic-specimens. License: CC BY 4.0. Edited and adapted.
  2. Parker N, Schneegurt M, Thi Tu AH, Lister P, Forster BM. “3.3 Unique Characteristics of Prokaryotic Cells.” Microbiology. OpenStax, 2016. openstax.org/books/microbiology/pages/3-3-unique-characteristics-of-prokaryotic-cells. License: CC BY 4.0. Edited and adapted.
  3. Newlove M. “Clindamycin-resistant Group B Streptococcus bacteria.” CDC Public Health Image Library, 2019.
  4. Higgins D. “Bordetella pertussis bacteria.” CDC Public Health Image Library, 2019.

Key terms

Peptidoglycan
The polymer that makes up the bacterial cell wall.

Mordant
A substance that fixes a stain in place; here, Gram’s iodine.

Counterstain
A second stain that colors cells the first stain didn’t; here, safranin.

Primary stain
The first dye applied, which colors all cells; here, crystal violet.

Decolorizer
Alcohol or acetone-alcohol that washes crystal violet out of thin-walled cells.

Gram-positive
Bacteria with a thick peptidoglycan wall that keep crystal violet and look purple.

Gram-negative
Bacteria with a thin peptidoglycan layer and an outer membrane that lose crystal violet and look pink.

Heat fixing
Passing a dried smear through a flame so the cells stick to the slide before staining.

Lipopolysaccharide (LPS)
An endotoxin in the outer membrane of Gram-negative bacteria.