Heartburn stops when you reduce the amount of stomach acid reaching your esophagus, either by neutralizing the acid, blocking its production, or preventing it from traveling upward in the first place. The approach that works best depends on whether you need relief right now or a longer-term fix for recurring episodes.
Why Heartburn Happens
A ring of smooth muscle sits where your esophagus meets your stomach. This muscle, called the lower esophageal sphincter, stays tightly contracted at a pressure of about 30 mmHg, sealing off your stomach contents from the sensitive lining of your esophagus. When you swallow, it relaxes just long enough to let food pass through, then clamps shut again.
The problem starts when this sphincter relaxes at the wrong time. Stomach distention from a large meal or excess gas triggers what’s known as a transient relaxation, a reflex that opens both the sphincter and the surrounding diaphragm muscles to release built-up gas. This is a normal protective mechanism, but it also lets acidic stomach contents splash upward into the esophagus. That’s the burning sensation. Anything that increases pressure on the stomach or weakens this sphincter (fatty meals, alcohol, lying down after eating, excess weight) makes these episodes more frequent.
Antacids for Quick Relief
Over-the-counter antacids are the fastest option. They work by chemically neutralizing stomach acid on contact. Calcium carbonate (Tums), magnesium hydroxide, and aluminum hydroxide are the most common active ingredients. All of them begin raising esophageal pH within about 30 to 35 minutes.
The trade-off is that relief is short-lived. Calcium carbonate’s antacid effect in the esophagus lasts roughly 60 minutes. Combination tablets containing aluminum hydroxide and magnesium hydroxide perform slightly better, providing about 82 minutes of esophageal relief. Chewable tablets and effervescent formulas tend to last longer in the stomach (up to about three hours) compared to tablets you swallow whole, which have surprisingly little effect.
Alginate Products: A Physical Barrier
Alginate-based products like Gaviscon work differently from traditional antacids. When sodium alginate hits stomach acid, it forms a gel. In formulas that also contain bicarbonate, carbon dioxide gets trapped in the gel, creating a buoyant “raft” that floats on top of your stomach contents. This raft acts as a physical cap, sitting between the acid pool and your esophagus so that when the sphincter relaxes, the raft blocks acid from splashing upward rather than neutralizing it after the fact.
This makes alginates particularly useful for heartburn that hits after meals or when you lie down, since the raft stays positioned right at the junction where reflux occurs.
H2 Blockers for Longer-Lasting Control
If antacids wear off too quickly, H2 blockers (like famotidine, sold as Pepcid) take a different approach. Instead of neutralizing acid that’s already been produced, they block one of the chemical signals that tells your stomach to make acid in the first place. Famotidine binds to receptors on the acid-producing cells of your stomach lining, reducing both the volume and the acidity of your gastric secretions.
The trade-off flips: H2 blockers take longer to kick in (about 90 minutes for famotidine, compared to 30 minutes for an antacid) but their effect lasts 10 to 12 hours. This makes them a better choice when you want to prevent heartburn before it starts, such as taking one before a meal you know will trigger symptoms.
Proton Pump Inhibitors for Persistent Heartburn
Proton pump inhibitors (PPIs) like omeprazole (Prilosec) are the strongest acid-suppressing option available without a prescription. They shut down the final step of acid production by irreversibly disabling the acid pumps on your stomach’s parietal cells. Because the drug binds permanently to these pumps, your stomach has to grow new ones before full acid production resumes, which is why a single daily dose provides around 24 hours of suppression.
PPIs are meant for people whose heartburn keeps coming back. The standard recommendation for ongoing symptoms is 20 mg once daily, taken before a meal, for up to 4 to 8 weeks. They’re not designed for long-term use. Guidelines from the American College of Gastroenterology recommend using the lowest effective dose for the shortest time, then stepping down to an H2 blocker if possible.
Baking Soda as a One-Time Fix
Sodium bicarbonate (baking soda) dissolved in water is a classic home remedy that genuinely works as an antacid. It neutralizes stomach acid on contact, and the dose can be repeated after 30 minutes if needed. But there are important limitations: don’t take it within one to two hours of other medications, since it can interfere with absorption. Avoid combining it with large amounts of milk or dairy, which increases the risk of side effects. And it’s not appropriate for children under six without a doctor’s guidance. Baking soda is fine as an occasional fix, not a regular strategy.
Lifestyle Changes That Reduce Reflux
Sleep on Your Left Side
Your sleep position has a surprisingly large effect on nighttime heartburn. When you lie on your right side, your stomach sits above the point where it connects to your esophagus, essentially positioning the acid pool directly above the opening. This promotes more reflux episodes and gives acid more time to linger in the esophagus. Lying on your left side reverses the geometry: your esophagus sits above the stomach, so gravity works in your favor and acid is far less likely to flow upward.
Leave Time Between Dinner and Bed
Eating close to bedtime is one of the most reliable triggers for nighttime heartburn. The standard recommendation is to finish your last meal at least three hours before lying down. This gives your stomach enough time to partially empty, reducing the volume of acidic contents available to reflux when you go horizontal.
Eat Smaller, Less Triggering Meals
Since stomach distention is the primary trigger for those unwanted sphincter relaxations, smaller meals directly reduce the opportunity for reflux. Common dietary triggers include fatty or fried foods, chocolate, coffee, alcohol, citrus, and tomato-based sauces. You don’t necessarily need to eliminate all of them. Pay attention to which ones reliably cause your symptoms and adjust from there.
When Heartburn Signals Something More Serious
Most heartburn responds to the strategies above. But certain symptoms alongside heartburn point to conditions that need investigation with an endoscopy. These include difficulty swallowing, pain when swallowing, unintentional weight loss, loss of appetite, vomiting blood or having dark stools (signs of gastrointestinal bleeding), and persistent vomiting.
Even without those red flags, heartburn that doesn’t improve after an 8-week course of a PPI warrants further evaluation. The same applies if your symptoms return every time you stop the medication. In those cases, the next step is typically an endoscopy performed after you’ve been off PPIs for two to four weeks, since the medication can heal visible damage and mask what’s actually going on. Interestingly, the most common finding when people with typical reflux symptoms get scoped is a normal-looking esophagus, which doesn’t mean nothing is wrong, just that the problem may require different testing to identify.

