What Causes Heartburn: Foods, Hernia, and More

Heartburn happens when stomach acid flows backward into the esophagus, the tube connecting your mouth to your stomach. A muscular ring at the bottom of the esophagus, called the lower esophageal sphincter, normally opens to let food pass into the stomach and then closes behind it. When that muscle relaxes at the wrong time or becomes too weak to seal properly, acid escapes upward and irritates the esophageal lining, producing that familiar burning sensation behind the breastbone.

How the Sphincter Fails

The lower esophageal sphincter is essentially a one-way valve. It stays contracted most of the time, holding stomach contents where they belong. Problems start when it relaxes too frequently, stays open too long, or loses tone altogether. This can happen for a wide range of reasons, from the food you just ate to the medications you take to the pressure inside your abdomen. Understanding which of these factors applies to you is the key to reducing episodes.

Foods and Drinks That Trigger Reflux

Certain foods directly weaken the sphincter muscle. Coffee, both regular and decaf, relaxes it. Chocolate contains a compound called methylxanthine (chemically similar to caffeine) that does the same thing. Peppermint, garlic, and onions also loosen the sphincter and allow acid to travel upward.

Fatty, spicy, and fried foods cause a double problem: they relax the sphincter and slow stomach emptying, which means more acid sits in the stomach for longer with an easier path to escape. Carbonated drinks work through a different mechanism entirely. The gas they release inflates the stomach, increasing pressure against the sphincter until it gives way.

Timing matters as much as food choice. Eating a large meal increases the volume and pressure inside the stomach regardless of what’s on the plate. Eating within two hours of lying down is one of the most reliable triggers for nighttime symptoms.

Body Weight and Pregnancy

Extra weight around the midsection puts constant physical pressure on the stomach, pushing its contents upward toward the esophagus. This is a purely mechanical effect: the more pressure below, the harder the sphincter has to work to stay shut. Even moderate weight gain concentrated in the abdomen can shift the balance enough to cause regular heartburn in someone who never had it before.

Pregnancy creates the same pressure dynamic, compounded by hormonal changes. Rising progesterone levels during pregnancy relax smooth muscle throughout the body, including the esophageal sphincter. Combined with the growing uterus pressing against the stomach, this is why heartburn affects the majority of pregnant women, particularly in the third trimester.

Hiatal Hernia

Your diaphragm, the large breathing muscle separating the chest from the abdomen, wraps around the esophagus right where it meets the stomach. It acts as a secondary clamp that reinforces the sphincter. In a hiatal hernia, the upper part of the stomach pushes up through the diaphragm opening into the chest cavity. When that happens, the diaphragm can no longer help keep acid out of the esophagus. Small hiatal hernias are common and often cause no symptoms at all, but larger ones are a frequent underlying cause of persistent heartburn.

Medications That Make It Worse

Some medications irritate the esophageal lining directly. Common pain relievers like ibuprofen and aspirin fall into this category, as do bisphosphonates (drugs prescribed for osteoporosis). Taking these on an empty stomach or lying down shortly after swallowing them increases the risk.

Other drugs weaken the sphincter itself. Calcium channel blockers, statins, ACE inhibitors, and nitrates, all widely used for blood pressure and heart disease, can increase acid reflux by relaxing the smooth muscle of the sphincter. If you started a new medication and noticed heartburn for the first time, the timing is worth mentioning to whoever prescribed it.

Why It Gets Worse at Night

Gravity is one of the esophagus’s best defenses. When you’re upright, swallowed saliva and gravity continuously push any stray acid back down into the stomach. Lying flat eliminates that advantage. Refluxed acid pools in the esophagus longer, causing more irritation.

Sleep position also plays a measurable role. Research comparing positions found that sleeping on your left side clears acid from the esophagus roughly twice as fast as sleeping on your right side or on your back. In one study, median acid clearance time was 35 seconds on the left side versus 90 seconds on the right. Liquid reflux occurred more frequently in the supine and right-side positions. The likely explanation is anatomical: when you’re on your left, the esophagus enters the stomach from above the acid pool rather than below it.

Other Contributing Factors

Smoking weakens the esophageal sphincter and reduces saliva production, removing two protective mechanisms at once. Alcohol has a similar relaxing effect on the sphincter and also irritates the esophageal lining. Stress doesn’t directly cause acid production to spike, but it can heighten your sensitivity to pain in the esophagus, making normal amounts of reflux feel worse than they otherwise would.

Tight clothing, heavy lifting, and bending at the waist all temporarily increase abdominal pressure and can push acid upward in the same way excess body weight does. People who notice heartburn during exercise are usually experiencing this pressure effect, especially during core-intensive movements or running.

Heartburn vs. Heart Attack

Heartburn produces a burning sensation in the chest, often accompanied by a sour taste in the mouth or a small amount of stomach contents rising into the throat. It typically follows eating, responds to antacids, and gets worse when you lie down or bend over.

A heart attack feels different. The sensation is more often described as pressure, tightness, or squeezing rather than burning. The pain may radiate to the neck, jaw, or arms. It’s often brought on by physical exertion rather than meals. Other warning signs include shortness of breath, cold sweat, sudden dizziness, and unusual fatigue. Heart attacks can sometimes mimic indigestion, so chest pain that comes with any of these additional symptoms warrants emergency evaluation, especially if it’s a new or unfamiliar pattern for you.