Milk of Magnesia Rainbow

Dramatic color-changing neutralization reaction
Beginner🕐15 minLow hazardacid-base

Summary

Adding vinegar to milk of magnesia clears the milky suspension and, with an indicator, paints a whole pH1 rainbow as the base is neutralized2. You’ll be able to explain why the white suspension dissolves, why the colours appear in layers, and how an antacid mops up excess acid.

History

Milk of magnesia was invented in 1829 by Sir James Murray in Ireland, who created the white suspension of magnesium hydroxide as an antacid and laxative. The name comes from its milky appearance. Charles Henry Phillips commercialized it in 1880 as “Phillips’ Milk of Magnesia,” a brand that still exists today.

The chemistry demonstrates a fundamental principle of antacid action: magnesium hydroxide neutralizes stomach acid (hydrochloric acid in the body, but any acid works for demonstration). The reaction converts the insoluble white suspension into a clear, soluble salt solution.

When combined with universal indicator, this experiment creates a stunning “rainbow” effect as the pH gradually changes from basic (blue/green) through neutral to acidic (yellow/orange/red), making the abstract concept of neutralization beautifully visible.

Hazards & preparation

Warning

PPE: safety glasses. This experiment uses only food-safe materials, so it’s very low hazard.

  • Use unflavored milk of magnesia (flavored versions add dyes that muddy the colours).
  • Universal indicator is for demonstration only — don’t taste anything once it’s added.

Disposal: the product (magnesium acetate solution) is harmless down the drain with water. See the Safety page.

Materials

Procedure

Basic demonstration

  1. Pour 400mL water into the container.
  2. Add 15mL milk of magnesia and stir — the solution turns milky white.
  3. Slowly add vinegar while stirring.
  4. Watch the milky suspension gradually clear as the magnesium hydroxide is neutralized.
  5. The solution becomes completely transparent when neutralization is complete.

What you should see

In the basic demo the white cloudiness thins and vanishes to clear as you add vinegar. In the rainbow version, poured vinegar sinks and reacts on the way down, so you briefly get a vertical stripe of colours from blue (top) through green to red (bottom) before mixing evens it out.

Symptom Likely cause Fix
Muddy or grey colours Flavored/dyed milk of magnesia Use a plain, unflavored product
No distinct layers Stirred too soon, or vinegar added too fast Pour slowly down the side and don’t stir until you’ve enjoyed the layers
Stays cloudy after lots of vinegar Not enough acid, or under-mixed Add more vinegar and stir — it should clear at full neutralization

The reactions

\[\ce{Mg(OH)2(s) + 2 CH3COOH(aq) -> Mg(CH3COO)2(aq) + 2 H2O(l)}\]

magnesium hydroxide + acetic acid (vinegar) → magnesium acetate + water

The Science

Milk of magnesia is a suspension - tiny particles of solid magnesium hydroxide dispersed in water. It appears white because the particles scatter light. Magnesium hydroxide is a base (releases OH⁻ ions) but is only slightly soluble in water.

When acid is added:

  1. H⁺ ions from vinegar react with OH⁻ ions from Mg(OH)₂
  2. This pulls the equilibrium toward dissolution
  3. More Mg(OH)₂ dissolves to replace the consumed OH⁻
  4. Eventually all solid dissolves, forming soluble magnesium acetate
  5. The solution clears because there are no more particles to scatter light

The indicator shows pH changes in real-time:

  • Blue/Purple (pH 10+): Excess base
  • Green (pH 7-8): Near neutral
  • Yellow (pH 5-6): Slightly acidic
  • Orange/Red (pH 3-4): Excess acid

Questions to Explore

  1. Why does the suspension clear when acid is added? Milk of magnesia is a suspension of insoluble Mg(OH)₂ particles. Adding acid makes it clear. Is the solid dissolving, or is it converting to something else? How does looking at the reaction products help you answer this?

    Hint / answer

    It’s converting: the acid reacts the hydroxide away into soluble magnesium acetate, so the solid is consumed, not merely dissolved. Because the product is a different, water-soluble compound, no particles remain to scatter light and the liquid goes clear.

  2. Why does the rainbow form from the bottom up? When acid is poured slowly into the basic suspension with indicator, acid colours appear at the bottom while the top stays blue. What does this tell you about how the acid and base are mixing?

    Hint / answer

    The vinegar is denser and sinks, so the acidic (red) region builds at the bottom while the untouched base stays blue on top, with a neutral green band between. Mixing isn’t instant — it takes stirring or slow diffusion for the two to meet, which is why the layers persist for a while.

  3. Why is Mg(OH)₂ a good antacid? Stomach acid is hydrochloric acid. Magnesium hydroxide neutralizes it, but so does baking soda. What advantages and disadvantages does each have in speed, amount needed, and safety at high doses?

    Hint / answer

    Mg(OH)₂ is only slightly soluble, so it neutralizes steadily and can’t push the stomach far past neutral — gentle and self-limiting, though slower. Baking soda is fast but fully soluble, can overshoot, and releases CO₂ gas and a sodium load, which is worse in large or repeated doses.

  4. What is pH and what does it measure? The indicator changes colour continuously as pH goes from ~10 to ~3. pH is logarithmic — pH 4 has 10× more H⁺ than pH 5. Why use a logarithmic scale rather than stating acid concentration directly?

    Hint / answer

    H⁺ concentrations span an enormous range (many powers of ten), so a log scale compresses that into a handy 0–14 span where each unit is a tenfold change. It’s far easier to say “pH 3 vs pH 5” than “0.001 vs 0.00001 mol/L.”

  5. Why does the reaction “run out” at a specific point? Neutralization ends when acid and base have reacted in stoichiometric proportions. How could you calculate in advance exactly how much vinegar is needed to fully neutralize 15 mL of milk of magnesia?

    Hint / answer

    Work out the moles of Mg(OH)₂ in the dose (from its concentration), double it for the two OH⁻ per formula unit, and that’s the moles of acetic acid needed. Convert to a volume of vinegar using its acid concentration (~0.8 mol/L for 5% vinegar) — that’s your endpoint.

Going further

  • Antacid showdown. Neutralize a fixed amount of vinegar with measured doses of different antacids (Tums, Rolaids, Alka-Seltzer) using the indicator to spot the endpoint — which neutralizes the most acid per gram?
  • Make it quantitative. Titrate a known volume of vinegar with the antacid to the neutral (green) colour and compare against your calculated prediction.
  • Next in the Acid–Base track: put acids to work dissolving scale in Limescale Removal.

Footnotes

  1. pH — A 0–14 scale measuring how acidic (low) or basic (high) a solution is; 7 is neutral.↩︎

  2. Neutralization — The reaction of an acid with a base to produce a salt and water, moving pH toward 7.↩︎