How You Get Cavities and What Actually Stops Them

Cavities form when acid dissolves the minerals in your tooth enamel faster than your body can replace them. This process isn’t instant. It plays out over weeks or months as bacteria in your mouth feed on sugars, produce acid, and slowly eat through the layers of your teeth. Understanding exactly how this chain reaction works helps explain why some people get more cavities than others, and what actually prevents them.

What Happens Inside Your Mouth

Your mouth is home to hundreds of species of bacteria, many of them harmless. But certain strains thrive on the sugars and starches you eat. When these bacteria digest carbohydrates, they produce lactic acid as a waste product. That acid pools against your teeth in the sticky film called plaque.

Tooth enamel is the hardest substance in your body, but it has a specific weakness: it starts to dissolve at a pH of about 5.5 (for reference, water is 7.0 and lemon juice is around 2.0). Every time you eat or drink something with sugar or starch, the bacteria ramp up acid production and push the pH on your tooth surfaces below that critical threshold. The acid pulls calcium and phosphate out of the enamel in a process called demineralization.

Your saliva is designed to fight back. It contains bicarbonate and phosphate that act as buffers, neutralizing acid and nudging the pH back up. Saliva is also naturally loaded with calcium and phosphate ions, which can redeposit into weakened enamel and repair early damage. This back-and-forth between acid attack and repair happens dozens of times a day. A cavity forms when the acid side wins more often than the repair side.

Why Frequency Matters More Than Amount

After you eat something sugary, it takes your saliva roughly 20 to 30 minutes to neutralize the acid and bring your mouth back to a safe pH. This means every separate snack or sugary drink restarts the clock on an acid attack. Someone who sips a soda over three hours exposes their teeth to near-constant acid, while someone who drinks the same soda in ten minutes gives their saliva time to recover.

Research from a three-year longitudinal study found that higher sugar consumption between meals was a meaningful risk factor for decay, particularly for people already prone to cavities. The total amount of sugar matters, but the pattern of eating matters just as much. Grazing, frequent snacking, and slow sipping are some of the most effective ways to keep your mouth in a prolonged acidic state.

The Five Stages of a Cavity

Cavities don’t appear overnight. They progress through distinct stages, and the earliest one is actually reversible.

  • Demineralization. White, chalky spots appear on the enamel surface where minerals have been lost. There’s no hole yet. With better brushing, fluoride, and reduced sugar, the enamel can remineralize and the spots can fade.
  • Enamel decay. The white spots darken to brown, and the surface layer breaks down into a small hole. Once the enamel has an actual cavity in it, natural repair can no longer fix it. A filling is needed.
  • Dentin decay. Beneath the enamel is dentin, a softer, more porous layer. Once acid and bacteria reach it, decay accelerates significantly. You may start noticing sensitivity to hot, cold, or sweet foods because dentin sits closer to the tooth’s nerve.
  • Pulp involvement. The pulp is the innermost part of the tooth, containing blood vessels and nerves. When decay reaches it, the result is often intense, throbbing pain. A root canal is typically needed to save the tooth at this point.
  • Abscess. If bacteria invade the pulp and travel to the root tip, an infection called an abscess can form. This causes severe pain, facial swelling, fever, and poses a risk of the infection spreading to other parts of the body. The tooth may need to be extracted.

The jump from stage one to stage two can take months. From dentin decay onward, things move faster because dentin is softer and less resistant to acid than enamel.

Why Some People Are More Prone to Cavities

If you brush and floss regularly and still get cavities while your friend who barely flosses has none, genetics may be part of the explanation. Your genes influence the thickness and mineral density of your enamel, the composition of your saliva, and even how your immune system responds to the bacteria that cause decay. Specific genetic variations affect proteins in saliva that control how bacteria bind to teeth, and certain immune system genes have been linked to higher rates of early childhood cavities.

Dry mouth is another major risk factor. Anything that reduces saliva flow strips away your mouth’s primary defense. Common culprits include hundreds of prescription medications (antihistamines, antidepressants, blood pressure drugs), mouth breathing, and certain medical conditions. Nighttime is particularly risky because saliva production naturally drops while you sleep. If you take a medication that causes dry mouth, taking it in the morning rather than at night can reduce the impact on your teeth.

Other factors that raise your risk include acid reflux (which bathes teeth in stomach acid), receding gums that expose softer root surfaces, and orthodontic appliances that make thorough cleaning harder.

How Fluoride Changes the Math

Fluoride works by swapping into the mineral structure of your enamel. Normal enamel is made of a mineral called hydroxyapatite, which dissolves at pH 5.5. When fluoride is incorporated, it converts to a different mineral called fluorapatite, which doesn’t start dissolving until pH 4.6. That shift of nearly a full pH point means your teeth can withstand significantly stronger acid attacks before any minerals are lost.

This is why fluoride toothpaste and fluoridated water have such a large effect on cavity rates. Fluoride doesn’t create an impenetrable shield. It raises the bar that acid has to clear before it can do damage, and it helps your saliva redeposit minerals into weakened spots more effectively.

How Common Cavities Actually Are

Despite being largely preventable, cavities remain one of the most common chronic conditions in the United States. CDC surveillance data from 2024 shows that about 11% of children aged 2 to 5 already have untreated decay in their baby teeth. That number jumps to nearly 18% for children aged 6 to 8. Among adults aged 20 to 64, roughly 21% have at least one untreated cavity, making it the age group with the highest rate of untreated decay.

These numbers only count untreated cavities. The total percentage of people who have ever had a cavity is far higher. By adulthood, the vast majority of Americans have had at least one.

What Actually Prevents Them

Knowing the mechanism tells you exactly where to intervene. Cavities need three things: bacteria, sugar, and time. Removing any one of those slows or stops the process.

Brushing with fluoride toothpaste twice a day removes plaque before it can produce enough acid to cause lasting damage. Flossing clears the tight spaces between teeth where a toothbrush can’t reach, and where many cavities start. Limiting snacking and sugary drinks between meals gives your saliva the 20 to 30 minutes it needs to neutralize acid and begin repairs.

Drinking water throughout the day, especially fluoridated tap water, helps rinse away food particles and keeps saliva flowing. Sugar-free gum after meals stimulates extra saliva production, which speeds up acid neutralization. And if you’re going to eat something sweet, having it with a meal rather than as a standalone snack reduces the total number of acid attacks your teeth face in a day.