What Medicine Should You Take for Stomach Pain?

The right medicine for stomach pain depends on what’s causing it. A burning sensation after eating calls for a different treatment than cramping, bloating, or pain linked to diarrhea or constipation. Most stomach pain responds well to over-the-counter options, but picking the wrong one can waste time or even make things worse.

Burning or Acidic Pain

If your stomach pain feels like a burning sensation in your upper abdomen or chest, especially after meals, the problem is likely excess stomach acid. You have three tiers of relief to choose from, each working differently.

Antacids (calcium carbonate, magnesium hydroxide) neutralize acid that’s already in your stomach. They work within minutes, which makes them a good choice when you need fast relief. The tradeoff is that they wear off quickly, typically within an hour or two.

H2 blockers (famotidine) reduce acid production rather than just neutralizing what’s there. They take about 30 to 60 minutes to kick in but keep stomach acid suppressed for roughly four hours. These work well for predictable pain, like discomfort that shows up every night.

Proton pump inhibitors (omeprazole, lansoprazole) are the strongest option. They block the acid-producing pumps in your stomach lining directly, keeping stomach pH controlled for 15 to 22 hours per day compared to about four hours with an H2 blocker. The catch: PPIs take one to three days of daily use before they reach full effect, so they’re not the best choice for immediate relief. Over-the-counter PPIs are designed for 14-day courses. If your symptoms haven’t improved after two to four weeks, that’s a sign to talk to a doctor rather than continuing indefinitely.

Gas and Bloating Pain

Stomach pain from trapped gas often feels like pressure, fullness, or sharp pains that shift around your abdomen. Simethicone is the standard over-the-counter option for this. It works as a surfactant, lowering the surface tension of gas bubbles in your digestive tract so they merge together and pass more easily as burping or flatulence. It doesn’t reduce the amount of gas your body produces, but it helps what’s already there move out instead of sitting in painful pockets. The typical adult dose is 40 to 125 mg up to four times daily after meals, with a maximum of 500 mg per day.

Simethicone is not absorbed into your bloodstream, which makes it one of the safest over-the-counter options available. If gas pain is a recurring issue for you, it’s worth paying attention to food triggers (beans, cruciferous vegetables, carbonated drinks, dairy) since prevention will always outperform treatment.

Stomach Cramps and Spasms

Cramping pain, the kind that comes in waves and feels like your gut is squeezing, involves involuntary muscle contractions in your intestinal wall. Most antispasmodic medications in the U.S. require a prescription. These are commonly prescribed for irritable bowel syndrome, colon spasms, and functional dyspepsia.

Your main over-the-counter option is peppermint oil capsules, which act directly on the smooth muscle in your gastrointestinal tract to reduce spasms. Look for enteric-coated capsules so the peppermint releases in your intestines rather than your stomach, where it can actually worsen heartburn. Chamomile tea offers a milder version of the same muscle-relaxing effect and may help calm intestinal or menstrual cramps.

Pain With Diarrhea

When stomach pain comes alongside loose, frequent stools, the pain often improves once the diarrhea is under control. Loperamide slows the movement of your intestines, giving your body more time to absorb water and firm up stools. The standard approach for acute diarrhea is a 4 mg starting dose followed by 2 mg after each unformed stool, with a maximum of 8 mg per day for over-the-counter use.

Bismuth subsalicylate (the active ingredient in Pepto-Bismol) is another option that pulls double duty. It coats the stomach lining, reduces inflammation, and has mild antibacterial properties, making it useful when diarrhea comes with nausea or general upset. However, it contains a compound related to aspirin, so you should avoid it if you have an aspirin allergy or sensitivity. It also should not be given to children or teenagers with flu-like symptoms due to the risk of Reye’s syndrome, a rare but serious condition.

Pain From Constipation

Constipation-related stomach pain is a dull, heavy discomfort often concentrated in the lower abdomen. It tends to build gradually and may come with visible bloating. The fix is straightforward: get things moving, and the pain resolves.

Osmotic laxatives like polyethylene glycol (MiraLAX) and magnesium hydroxide (Milk of Magnesia) work by drawing water into the intestines to soften stool. They’re gentle and generally well-tolerated, with flatulence and mild nausea as the most common side effects. Expect results within one to three days.

Stimulant laxatives like bisacodyl and senna work faster by triggering contractions in the intestinal wall. They’re more likely to cause cramping and diarrhea as side effects. In clinical trials, roughly a third of patients taking stimulant laxatives experienced diarrhea, compared to much lower rates with osmotic options. Stimulant laxatives are fine for occasional use but aren’t ideal as a first choice if your pain is already significant, since they can temporarily intensify cramping before providing relief.

Why You Should Avoid Ibuprofen for Stomach Pain

This is one of the most common mistakes people make. Reaching for ibuprofen, aspirin, or other NSAIDs when your stomach hurts can make things significantly worse. These painkillers block the production of prostaglandins, compounds that normally protect your stomach lining by regulating blood flow and mucus production. Without that protection, your stomach wall becomes vulnerable.

NSAIDs also trigger abnormal contractions in the stomach, compressing the mucosal folds and restricting blood flow to specific areas of the lining. This creates a cascade of damage: increased permeability, inflammation, free radical production, and eventually visible lesions. The damage tends to appear in a predictable pattern along the stomach’s folds, exactly where compression from contractions is greatest. If your stomach already hurts, adding an NSAID is pouring fuel on the fire. Acetaminophen (Tylenol) is a safer alternative for pain relief that doesn’t affect the stomach lining.

Matching the Medicine to Your Symptoms

  • Burning after eating: antacid for quick relief, H2 blocker or PPI for recurring symptoms
  • Pressure and bloating: simethicone
  • Cramping in waves: peppermint oil capsules or chamomile tea
  • Pain with loose stools: loperamide or bismuth subsalicylate
  • Pain with inability to go: osmotic laxative first, stimulant laxative if needed
  • General nausea and upset: bismuth subsalicylate

Signs That Need Emergency Attention

Most stomach pain is manageable at home, but certain patterns signal something more serious. Seek emergency care if your pain is severe enough to prevent you from functioning normally, if you’re vomiting and unable to keep liquids down, or if you’re completely unable to have a bowel movement alongside intense pain. Pain that gets worse when you move, cough, or breathe deeply can indicate inflammation of the abdominal lining. Pain that starts mild and steadily worsens over hours, especially with fever or a rapid pulse, may point to appendicitis or another surgical emergency. If your stomach pain feels familiar but noticeably different from past episodes, more intense, or accompanied by unusual symptoms, treat it as something new rather than assuming it’s the same old problem.