What Medicine Is Good for Heartburn Relief?

For occasional heartburn, an over-the-counter antacid containing calcium carbonate is the fastest option, neutralizing stomach acid within minutes. If heartburn keeps coming back, stronger medications that reduce acid production, like H2 blockers or proton pump inhibitors, provide longer-lasting relief. The right choice depends on how often your symptoms occur and how severe they are.

Antacids: Fastest Relief for Occasional Heartburn

Antacids work by directly neutralizing the acid already in your stomach, raising the pH within minutes of taking them. That makes them the best pick when you need immediate relief after a spicy meal or a bout of nighttime burning. Common active ingredients include calcium carbonate (Tums, Rolaids) and magnesium hydroxide (Milk of Magnesia). Liquid forms tend to work slightly faster than chewable tablets, though both get the job done quickly.

The trade-off is duration. Antacids typically wear off within one to two hours, and their actual acid-buffering capacity can fade in as little as 30 minutes. That’s fine for a one-off episode, but if you’re reaching for them multiple times a day or most days of the week, you likely need something stronger. Calcium carbonate products generally cap at about 9 tablets per 24 hours (6 if you’re pregnant), and you shouldn’t use the maximum dose for more than two weeks without medical guidance.

H2 Blockers: Longer Relief Without a Prescription

H2 blockers take a different approach. Instead of neutralizing acid that’s already there, they block one of the chemical signals your stomach uses to produce acid in the first place. The most widely available option is famotidine (Pepcid). It takes 30 to 60 minutes to kick in, so it’s not as instant as an antacid, but the payoff is hours of suppression rather than minutes. Studies show famotidine can keep stomach acid levels low for roughly 9 hours per dose.

This makes H2 blockers a good middle-ground option. If you get heartburn a few times a week, especially predictable heartburn (like every time you eat tomato sauce or lie down after dinner), taking one before the triggering meal can prevent symptoms before they start. They’re also useful for nighttime heartburn, since the long duration covers most of your sleep.

Proton Pump Inhibitors: The Strongest Option

Proton pump inhibitors, or PPIs, are the most powerful acid-suppressing medications available over the counter. Common names include omeprazole (Prilosec), lansoprazole (Prevacid), and esomeprazole (Nexium). They work by shutting down the tiny acid pumps in your stomach lining, cutting acid production at its source.

PPIs are not designed for quick relief. A single dose won’t do much for the heartburn you’re feeling right now. The acid-suppressing effect takes at least five days to reach its full strength, so PPIs work best when taken daily as a course. The American Gastroenterological Association recommends an 8-week trial of once-daily PPI therapy for people with classic heartburn and regurgitation. For the best results, take a PPI 30 to 60 minutes before a meal rather than at bedtime.

If your heartburn is frequent (two or more days per week) and antacids or H2 blockers aren’t controlling it, a PPI is the logical next step. Most over-the-counter PPIs are labeled for 14-day courses and shouldn’t be repeated more than every four months without talking to a doctor.

Long-Term PPI Considerations

PPIs are safe for short courses, but long-term daily use (months to years) carries some concerns. Because stomach acid helps your body absorb certain nutrients, chronic suppression has been linked to a higher risk of bone fractures from reduced calcium absorption, deficiencies in vitamin B12, magnesium, and iron, and an increased risk of certain infections including pneumonia and a gut infection called C. difficile. These risks are relatively small for most people, but they’re worth weighing if you find yourself relying on PPIs indefinitely. Some people with severe esophageal damage do need ongoing PPI therapy, and for them the benefits clearly outweigh these risks.

Alginates: A Physical Barrier Against Reflux

Alginate-based products (like Gaviscon) work differently from all three categories above. When the alginate mixes with your stomach acid, it forms a gel-like raft that floats on top of the acid pool in your stomach. This physical barrier keeps acid from splashing up into your esophagus. Alginates are particularly helpful for reflux that happens when you bend over or lie down, since that’s exactly when acid is most likely to travel upward. They can be combined with antacids for both immediate neutralization and ongoing physical protection.

Choosing the Right Medicine for Your Symptoms

The best heartburn medicine depends on your pattern:

  • Rare, mild heartburn (once a week or less): A chewable antacid or liquid antacid provides fast, short-term relief and is all most people need.
  • Predictable heartburn before meals or at night: An H2 blocker like famotidine taken 30 to 60 minutes beforehand can prevent symptoms for hours.
  • Frequent heartburn (two or more days per week): A daily PPI taken before breakfast for 8 weeks is the guideline-recommended approach.
  • Heartburn that worsens when lying down: An alginate product at bedtime can add a physical layer of protection on top of other treatments.

You can also layer these strategically. Someone on a PPI course who gets breakthrough symptoms can still use an antacid for spot relief, since they work through completely different mechanisms.

Heartburn Medicine During Pregnancy

Heartburn is extremely common in pregnancy, especially in the second and third trimesters as the growing uterus pushes the stomach upward. Antacids are the go-to first-line option and are generally considered safe throughout pregnancy. H2 blockers are also considered safe but are best avoided in the first trimester as a precaution. One medication that’s otherwise rarely used, sucralfate (a coating agent), is specifically recommended for reflux during pregnancy as an alternative. PPIs can be used during pregnancy if milder options fail, but this is a conversation to have with your provider.

When Medicine Alone Isn’t Enough

Medication works best alongside basic habit changes. Eating smaller meals, staying upright for at least two to three hours after eating, and elevating the head of your bed by about six inches all reduce the amount of acid that reaches your esophagus. Cutting back on alcohol, coffee, chocolate, and high-fat foods can also lower acid production and reduce the pressure that pushes acid upward.

If you’ve tried an 8-week PPI course and still have symptoms, the next step is optimizing how you take it (timing, consistency, and whether it’s being taken before meals). Persistent heartburn despite proper PPI use warrants investigation, since the burning could be caused by something other than acid, or there may be structural issues that medication alone won’t fix.