The best medication for stomach pain depends on what’s causing it. Acid-related burning responds to antacids or acid reducers, gas pain calls for anti-gas products, general upset stomach improves with bismuth subsalicylate, and constipation-related cramping needs a laxative. Picking the right one starts with identifying your symptoms.
Burning or Acidic Stomach Pain
If your pain feels like a burning sensation in your upper stomach or chest, especially after eating, excess stomach acid is the likely culprit. Three categories of medication target this problem, and they work at different speeds and durations.
Antacids (calcium carbonate, magnesium hydroxide) neutralize acid that’s already in your stomach. They work within minutes, which makes them useful for occasional flare-ups after a heavy meal. The tradeoff is that relief typically lasts only an hour or two.
H2 blockers (famotidine) reduce the amount of acid your stomach produces. They take 30 to 60 minutes to kick in but last significantly longer, often 8 to 12 hours. In clinical studies, about 60 to 70 percent of patients with ulcer-related pain reported relief after four weeks on H2 blockers.
Proton pump inhibitors (omeprazole, lansoprazole) block acid production more completely than H2 blockers. They’re slower to start working, sometimes taking a day or more to reach full effect, but they’re the most powerful option. In head-to-head comparisons, around 72 to 81 percent of patients were pain-free at four weeks on omeprazole, compared to about 60 percent on H2 blockers. The FDA recommends limiting over-the-counter PPIs to a 14-day course, no more than three times a year.
For a quick fix right now, grab an antacid. For recurring acid pain that keeps coming back over days, an H2 blocker or a short PPI course is more effective.
Gas, Bloating, and Pressure
Stomach pain that comes with a feeling of fullness, pressure, or visible bloating is often caused by trapped gas. Two types of products address this.
Simethicone (the active ingredient in Gas-X and similar products) works by breaking up gas bubbles in your digestive tract so they’re easier to pass. It doesn’t prevent gas from forming, but it relieves the uncomfortable pressure relatively quickly. It’s considered very safe because it isn’t absorbed into your bloodstream.
Alpha-galactosidase (sold as Beano) takes a different approach. It’s an enzyme that breaks down the complex sugars in beans, broccoli, cabbage, and other gas-producing foods before bacteria in your colon can ferment them. Your body doesn’t naturally produce this enzyme, so those sugars normally pass undigested into your lower intestine, where bacteria turn them into hydrogen, methane, and carbon dioxide. Taking the enzyme with your first bite of food reduces the amount of gas that gets produced in the first place.
If you already feel bloated, simethicone is the better choice. If you know a gassy meal is coming, alpha-galactosidase taken at the start of the meal is more effective at preventing the problem.
General Upset Stomach and Nausea
When your stomach pain comes with nausea, mild cramping, or diarrhea, and you’re not sure exactly what’s going on, bismuth subsalicylate (Pepto-Bismol) is a versatile option. It treats indigestion, heartburn, nausea, upset stomach, and diarrhea. It typically controls diarrhea within 24 hours and relieves the abdominal cramps that come with it.
Bismuth subsalicylate doesn’t neutralize acid the way antacids do. Instead, it inhibits the digestive enzyme pepsin, increases the protective mucus layer in your stomach, and coats irritated areas of your stomach lining, shielding them from acid. That coating effect is why it works across such a wide range of symptoms.
One thing to know: it contains a compound related to aspirin, so avoid it if you’re allergic to aspirin, taking blood thinners, or giving it to children or teenagers with viral symptoms.
Cramping From Constipation
Lower abdominal pain that comes with infrequent bowel movements, straining, or a feeling of incomplete evacuation is often constipation. The pain itself comes from stool building up and stretching the intestinal walls. Treating the constipation resolves the pain.
Bulk-forming laxatives (psyllium, methylcellulose) absorb water and add bulk to your stool, making it softer and easier to pass. They’re the gentlest option and work within 12 to 72 hours. They’re safe for daily use but require drinking plenty of water.
Osmotic laxatives (polyethylene glycol, sold as MiraLAX) draw water into the bowel to soften stool. They generally produce a bowel movement within one to three days. They can cause bloating and nausea in some people.
Stimulant laxatives (bisacodyl, senna) trigger contractions in the intestinal wall to push stool through. They work faster, usually within 6 to 12 hours, but they can actually cause abdominal pain and cramping as a side effect. Use them only for short-term relief when gentler options haven’t worked.
For constipation-related stomach pain, start with an osmotic or bulk-forming laxative. Reserve stimulants for when you need faster results and can tolerate temporary cramping.
Abdominal Muscle Spasms and Cramping
Some stomach pain feels like involuntary tightening or spasming, particularly in people with irritable bowel syndrome or other functional gut conditions. This type of pain comes from smooth muscle in the intestinal wall contracting too forcefully or too frequently.
Antispasmodic medications work by relaxing that smooth muscle. Most antispasmodics, including dicyclomine and hyoscyamine, require a prescription. They work through different mechanisms: some block the nerve signals that trigger contractions, while others prevent calcium from entering muscle cells, which is necessary for muscles to contract. If cramping and spasms are your primary symptom and over-the-counter options aren’t helping, this is worth discussing with a healthcare provider.
Medications That Make Stomach Pain Worse
If you’re reaching for ibuprofen (Advil) or naproxen (Aleve) to treat stomach pain, stop. These anti-inflammatory drugs block the production of compounds that protect your stomach lining from its own acid. Without that protective layer, acid damages the tissue directly, which can cause gastritis or ulcers. All commonly used anti-inflammatory drugs, including ibuprofen, naproxen, and diclofenac, increase the risk of gastrointestinal injury.
Acetaminophen (Tylenol) is a safer alternative when you need a general pain reliever and your stomach is already bothering you. It reduces pain through a different mechanism that doesn’t affect the stomach lining. If you must take an anti-inflammatory for another condition, using the lowest effective dose for the shortest time reduces the risk of stomach damage.
When OTC Medication Isn’t Enough
Over-the-counter stomach medications are designed for mild, short-term symptoms. If your pain is severe, comes with a fever, or is accompanied by bloody stools, you need emergency medical care rather than a trip to the pharmacy. The same goes for persistent vomiting that won’t stop, unexplained weight loss, a swollen or extremely tender abdomen, or pain following an injury or accident.
For symptoms that aren’t emergencies but keep returning week after week, the medication may be masking something that needs a proper diagnosis. Recurring acid pain, for example, could signal an ulcer or a bacterial infection that requires targeted treatment rather than ongoing symptom management.

