How Cavities Form (and How to Stop Them)
A cavity is not something that just happens to you — it is a slow chemistry experiment running on the surface of your tooth. Sticky plaque bacteria eat your sugar and excrete acid. When that acid drives the pH below about 5.5, the mineral crystal of your enamel starts to dissolve. Then saliva rushes in, neutralises the acid, and puts the minerals back. Watch that tug-of-war play out below — and watch what happens when you tip it too far.
Try this: start on Healthy and see the pH sit safely above the red line. Then switch to Frequent sugar and watch the pH stay stuck below 5.5, the enamel gauge crash, and a hole open into the dentin. Now hit Fluoride & brushing and watch the enamel fight back.
What's happening
Real numbers: the resting plaque pH (~6.8–7.0), the critical pH (~5.5 for enamel, ~4.5 once fluoride has hardened it), and enamel's ~96% mineral content are genuine clinical values, and the pH graph traces the real shape of the Stephan curve. The timing is compressed so you can watch a 20–40 minute acid attack in a few seconds; the enamel-%, sugar-hit and cavity-depth numbers are an illustrative model, not a measurement of your teeth.
The Science in Plain Language
Your mouth is a tiny chemistry set
Every time you eat, the surface of your teeth swings through a burst of acid and then back to safety. Dentists have a famous graph for this called the Stephan curve: within about 2–5 minutes of eating sugar, the pH in your plaque plunges, and it takes roughly 20–40 minutes to climb back to normal. A cavity is simply what happens when that acid dip goes too deep, too often, for too long. The animation above is that curve, drawn live — the green trace is the pH sitting on your enamel, and the red dashed line is the point of no return.
The culprits: dental plaque and Streptococcus mutans
Your teeth are coated in a living biofilm — dental plaque — a sticky, organised community of bacteria, not just a random smear. The lead troublemaker is Streptococcus mutans (with help from Lactobacillus and others). It is very good at three things: gluing itself to enamel, thriving in acid that kills gentler bugs, and turning sugar into acid fast. Because plaque is a biofilm, it shields the bacteria inside it and holds the acid right against your tooth surface where it does the most damage. That is why physically removing the film matters so much — you can't just rinse a biofilm away.
Sugar in, acid out
When you eat sugar or refined carbs (sucrose, glucose, cooked starch), S. mutans ferments it through glycolysis and excretes lactic acid (plus some acetic and formic acid). This is the same fermentation chemistry that sours milk or leavens sourdough — it just happens to be running on your teeth. More sugar, and especially more frequent sugar, means a steady stream of acid pumped straight into the plaque. The bacteria don't want to hurt you; acid is simply their waste product. But it is a strong enough acid to attack rock.
The critical pH (~5.5): where enamel starts to dissolve
Enamel is about 96% mineral — a crystal called hydroxyapatite, Ca10(PO4)6(OH)2 — and it is the hardest tissue your body makes. But it is still just a mineral, and minerals dissolve in acid. Below a pH of about 5.5 (the critical pH), the surrounding fluid becomes "undersaturated," and calcium and phosphate ions leak out of the crystal into the plaque. This is demineralisation. Above 5.5 the fluid is saturated again and the ions stay put — or come back. The exact number shifts a little with how much calcium and phosphate are already in your saliva, but 5.5 is the practical tipping point, and it's the red line on the graph.
Saliva: your built-in repair crew
Here's the hopeful half of the story. Saliva is not just water — it is loaded with bicarbonate (which neutralises acid) and is supersaturated with the very calcium and phosphate that enamel is made of. After you stop eating, saliva washes the sugar away, buffers the acid back above 5.5, and then remineralises the enamel, depositing minerals back into the crystal. A healthy mouth runs this repair thousands of times. That's why chewing (which boosts saliva flow up to 1.5–2 mL/min), and why a dry mouth — from medications, radiation, or mouth-breathing — dramatically raises cavity risk: no saliva, no repair crew.
Frequency beats amount — why sipping is the worst
This is the single most useful idea on the page. A cavity is a balance: demineralisation versus remineralisation. Your enamel can easily survive one sugary treat — the pH dips, then saliva wins it back. What it can't survive is being kept below 5.5 all day. Sipping a sugary drink (or nursing a sweet coffee, or grazing on carbs) restarts the acid attack every few minutes, so the pH never climbs back to safety and demineralisation wins by default. Eating the exact same amount of sugar in one sitting is far kinder to your teeth than spreading it across the day. Switch the animation to Frequent sugar to watch the pH get stuck under the red line and the cavity break through.
Why fluoride works — fluorapatite
Fluoride is not a cover-up; it changes the chemistry. When fluoride (from toothpaste at ~1000–1500 ppm, or water at ~0.7 ppm) is present as enamel remineralises, it builds a tougher crystal called fluorapatite, Ca10(PO4)6F2. Fluorapatite is less soluble, so its critical pH drops from ~5.5 to about 4.5 — meaning it takes a much stronger acid attack to dissolve it. Fluoride also speeds up remineralisation and even slows the bacteria's acid-making enzymes. In the Fluoride & brushing scenario the red line drops and the enamel shrugs off attacks that would have caused damage.
There's one habit that surprises people and follows directly from this chemistry: after brushing, spit — don't rinse. Swishing water immediately washes the fluoride straight out of your mouth before it can do its slow remineralising work; leaving a thin film behind lets it keep hardening the enamel for hours. For teeth at high risk, dentists go further with high-concentration fluoride varnish, prescription toothpaste (~5000 ppm), or sealants — a thin resin painted into the deep grooves on the chewing surface, exactly where the plaque in the animation collects and where a toothbrush bristle can't reach.
Brushing, flossing, and xylitol — starving and stripping the biofilm
Everything you're told to do maps onto this mechanism. Brushing and flossing physically remove the plaque biofilm, so there are fewer bacteria to make acid (and they can't hide). Brushing right before bed matters most, because saliva flow nearly stops while you sleep — overnight is the one stretch with no repair crew on duty, so you want to go to sleep with a clean, fluoride-coated tooth and no sugar left for the bacteria. Fluoride toothpaste hardens the enamel at the same time. Cutting sugar frequency gives saliva the quiet hours it needs to win. And xylitol — a sugar alcohol found in some gums — is a clever trick: S. mutans takes it up but cannot ferment it, so it makes no acid and the bacteria are effectively starved; a few grams a day, spread out, measurably lowers plaque and S. mutans counts. (Chewing sugar-free gum after a meal helps a second way, too — it triggers a gush of saliva that buffers the acid faster.)
One nuance that trips people up: if you've just had something acidic — soda, citrus, wine — the enamel surface is briefly softened, and scrubbing it right then can wear it away. Wait 30–60 minutes (or rinse with plain water first) so saliva can re-harden the surface before you brush.
The myth worth correcting
The old idea that "sugar rots your teeth by touching them," or that a cavity is inevitable once decay begins, is wrong on both counts. Sugar doesn't attack enamel directly — bacterial acid does, which is why a person with fewer S. mutans can eat more sugar with fewer cavities, and why sugar-free foods that still feed acid-making bacteria (or acidic drinks that dissolve enamel outright) matter too. And early decay is reversible: that chalky white spot you saw form on the enamel is demineralised but not yet cavitated, and with fluoride and better habits it can remineralise and heal. Only once the surface collapses into a true hole — cavitation — is it permanent and in need of a filling. The lesson isn't "never eat sugar." It's "keep the acid attacks short and few, and give saliva and fluoride the upper hand."
What this actually means for you
Strip away the chemistry and the whole animation reduces to one balance you can tip in your favour every day:
- Count occasions, not grams. Two squares of chocolate with lunch cost your enamel less than the same chocolate nibbled across an afternoon. Every restart of the acid attack is a fresh dip below the red line.
- Water is the safe sipper. If you nurse a drink for hours, make it water. Sugary or acidic drinks kept in constant contact are the classic recipe for decay — and for babies, so is a bottle of milk or juice left in the mouth at sleep.
- Fluoride twice a day, and spit — don't rinse. Brush morning and (especially) last thing at night, and leave that thin fluoride film in place.
- Give saliva a hand. Chew after meals, stay hydrated, and if your mouth runs dry from medication, tell your dentist — dry mouth is one of the biggest, most fixable cavity risks.
- White spots are a warning, not a verdict. Seen early, they can be reversed. A dark, catching hole cannot — that's a dentist visit, and the sooner the smaller the filling.