How Do You Get Heartburn? Causes and Risk Factors

Heartburn happens when stomach acid flows backward into your esophagus, the tube connecting your mouth to your stomach. A ring of muscle at the bottom of your esophagus, called the lower esophageal sphincter, normally acts as a one-way valve that opens to let food down and closes to keep acid where it belongs. When that valve weakens, relaxes at the wrong time, or gets overwhelmed by pressure from below, acid escapes upward and irritates the sensitive lining of your esophagus. That burning sensation behind your breastbone is the result.

Several everyday factors can set this process in motion, from what you eat and how you sleep to your body weight and the medications you take.

Food, Drink, and Eating Habits

Certain foods and beverages relax the lower esophageal sphincter or stimulate extra acid production. Common culprits include coffee, alcohol, chocolate, peppermint, citrus, tomato-based foods, and high-fat meals. Fat slows digestion, which means food sits in your stomach longer, producing more acid and more pressure against that valve.

How you eat matters as much as what you eat. Large meals stretch the stomach and put mechanical pressure on the sphincter. Eating within two to three hours of lying down compounds the problem because gravity can no longer help keep acid in your stomach. Even tight-fitting clothing around your midsection can squeeze your stomach enough to push acid upward.

Body Weight and Stomach Pressure

Carrying extra weight, especially around your abdomen, increases the pressure inside your abdominal cavity. That added pressure pushes against your stomach from the outside, forcing acid up toward the esophagus. This is one reason heartburn becomes more frequent as people gain weight and often improves with even modest weight loss. The relationship is straightforward: more pressure on the stomach means more opportunity for acid to escape.

How Lying Down Makes It Worse

When you’re upright, gravity helps keep stomach contents where they belong. Lying flat eliminates that advantage, which is why heartburn often flares at night. A study of 57 people with chronic heartburn found that sleeping position also plays a role. Acid episodes occurred at roughly the same rate regardless of position, but acid cleared from the esophagus significantly faster when participants slept on their left side compared to their back or right side. Faster clearance means less time for acid to damage the esophageal lining and less pain overall.

Elevating your upper body with a wedge pillow (not just stacking regular pillows, which can bend you at the waist) helps gravity work in your favor even while you sleep.

Pregnancy and Hormonal Changes

Heartburn affects a large percentage of pregnant people, and it tends to get worse as pregnancy progresses. The hormone progesterone, which rises steadily throughout pregnancy, has a direct relaxing effect on smooth muscle. That includes the lower esophageal sphincter. Research shows a progressive decrease in sphincter pressure as pregnancy advances, returning to normal soon after delivery.

Later in pregnancy, the growing uterus also pushes the stomach upward, adding physical pressure to the hormonal effect. These two forces together explain why heartburn in the third trimester can feel relentless even for people who never experienced it before.

Hiatal Hernia

Your diaphragm, the large muscle separating your chest from your abdomen, has a small opening called the hiatus where your esophagus passes through to connect to your stomach. A hiatal hernia occurs when the top of your stomach pushes up through that opening into your chest cavity. Stress, strain, and aging can widen the hiatus over time.

The most common type (Type 1) involves the junction between the esophagus and stomach sliding up through the hiatus and then back down. This disrupts the natural pinch point that helps keep acid contained. Many people with small hiatal hernias never notice symptoms, but among those who do, chronic acid reflux is the most common complaint.

Slow Stomach Emptying

Your stomach is designed to process food and move it into the small intestine at a steady pace. When that process slows down, a condition called gastroparesis, food lingers in the stomach longer than it should. The stomach stretches and distends, and that distension makes it easier for acid to escape through the top of the stomach into the esophagus. Diabetes, certain surgeries, and some neurological conditions can all slow gastric emptying, but in many cases no clear cause is found.

Medications That Trigger Reflux

Several common medications can worsen heartburn by relaxing the lower esophageal sphincter or increasing acid production. According to the Mayo Clinic, these include calcium channel blockers and nitrates (used for blood pressure and heart disease), certain antidepressants, opioid pain medications, sedatives, and medications for overactive bladder. Progesterone supplements can have the same sphincter-relaxing effect seen in pregnancy.

If you notice heartburn worsening after starting a new medication, it’s worth bringing up with your prescriber. In many cases, an alternative drug or adjusted timing can help without requiring you to stop treatment.

Smoking and Alcohol

Smoking weakens the lower esophageal sphincter and reduces saliva production. Saliva is mildly alkaline and helps neutralize small amounts of acid that reach the esophagus, so less saliva means acid lingers longer. Alcohol relaxes the sphincter directly and can also irritate the esophageal lining on its own, creating a double effect.

When Occasional Becomes Chronic

Most people experience heartburn now and then, and an occasional episode after a large or spicy meal is not cause for concern. When heartburn occurs twice a week or more over several weeks, it crosses into the territory of gastroesophageal reflux disease, or GERD. At that point, the repeated acid exposure starts to matter beyond just discomfort.

Chronic acid reflux can inflame and erode the esophageal lining. Over time, in roughly 10% to 15% of people with GERD, the cells lining the esophagus undergo a transformation called intestinal metaplasia. The flat, layered cells that normally line the esophagus are replaced by a different cell type that resembles the lining of the intestine. This condition, known as Barrett’s esophagus, is monitored closely because it carries a small but real increased risk of esophageal cancer.

The progression from occasional heartburn to tissue changes is not inevitable. Reducing the frequency and duration of acid exposure, whether through lifestyle changes, weight management, or medication, is the most effective way to protect the esophagus over the long term.