A doctor will likely prescribe a stomach ulcer treatment according to the cause of the ulcer and a person’s age and general health. Stomach ulcer medications can include antibiotics, antacids, and proton pump inhibitors.

Assorted drugs on a table, with one spilling out tabletsShare on Pinterest
Bjarte Rettedal/Getty Images

Stomach ulcers, also known as peptic ulcers, are sores in the small intestine lining or the stomach. They can appear when the stomach loses its protective mucus lining due to various causes.

The best medication for a stomach ulcer addresses its cause. Possible medications include:

This article looks at the best medications for stomach ulcers. It also explores alternative treatments, prevention, and when to speak with a doctor.

A doctor may treat a person with antibiotics if a Helicobacter pylori (H. pylori) infection, which is a bacterium affecting the stomach and bowel, causes the ulcer to occur.

Healthcare professionals will usually test a person for H. pylori infection if they diagnose an ulcer. This infection is the leading cause of stomach ulcers and can lead to gastritis and stomach cancer.

Doctors are also likely to prescribe antibiotics if the ulcer results from a complication of nonsteroidal anti-inflammatory drugs (NSAIDs).

NSAIDs can cause ulcers because they inhibit the production of a messenger chemical called prostaglandins. Some prostaglandins help protect the mucosal stomach lining from stomach acid. This reduction of prostaglandins can lead to bleeding and ulcers.

The most common drugs to treat ulcers due to H. pylori infection and complications of NSAIDs are:


A doctor will typically prescribe a 1-week course of two antibiotics, which a person must take twice a day.

Potential side effects

Side effects from antibiotics are typically mild. They can include:

Antacids combine with stomach acid and neutralize it, alleviating stomach ulcer symptoms. However, antacids will not kill H. pylori bacteria and are not an effective treatment for ulcers due to the infection.

Aluminum hydroxide and magnesium hydroxide are antacids that a person may use together to relieve symptoms of a stomach ulcer, such as upset stomach and acid indigestion.


Antacids are available over the counter, and the dosage and frequency may vary between products. A person should take these medications according to the package insert instructions or as a doctor directs.

Unless a doctor has prescribed otherwise, a person should not take antacids for longer than 1–2 weeks.

Potential side effects

Adverse effects are common in infants and older adults.

Potential side effects of one type of antiacid, aluminum hydroxide, include:

PPIs reduce acid in the stomach, which protects stomach ulcers from damage and allows them time to heal. While they do not kill H. pylori bacteria, they can fight the bacterial infection.

Doctors commonly prescribe:


A person usually needs to take a PPI for 4–8 weeks. The standard dosage for different types of PPIs are:

  • lansoprazole: 30 milligrams (mg) per day
  • omeprazole: 20 mg per day
  • pantoprazole: 40 mg per day

Potential side effects

Side effects are typically mild and may include:

Histamine receptor blockers work similarly to PPIs and reduce the amount of acid the stomach produces.

They tend to work quickly and effectively and can relieve symptoms for long periods.

Types of these medications include:


Doctors usually prescribefamotidine 40 mg once a day or 20 mg twice a day

A doctor will adjust the dosage of cimetidine and nizatidine depending on whether a person is:

Potential side effects

Side effects may include:

  • drowsiness
  • headache
  • diarrhea
  • constipation
  • fatigue
  • abdominal pain

In people older than 50 years, these drugs may cause:

Protectants coat ulcers in a protective substance, which stops damage from enzymes and acids so that they can heal. Doctors prescribe the protectant sucralfate for the treatment of ulcers.


A person should take the tablets or liquid form according to the package insert instructions, usually four times a day for up to 8 weeks.

Potential side effects

Side effects may be serious and may include:

Some natural remedies may have protectant properties, which can help treat and prevent ulcers. These include:

A person cannot avoid an ulcer due to an H. pylori infection, but they can take measures to avoid contact with it.

Experts believe the infection spreads through contaminated food, water, and contact with bodily fluids of people with infections.

Other measures someone can take to prevent stomach ulcers include:

  • speaking with a doctor about stopping or reducing the intake of NSAIDs
  • avoiding foods that may contribute to ulcers, such as:
  • quitting smoking, if applicable
  • reducing their intake of alcohol
  • eating smaller meals
  • eating the last meal of the day at least 2–3 hours before lying down

The best medication for stomach ulcers depends on the cause of the ulcer, the person’s age and overall health, and whether they are on other medication.

A person can help prevent ulcers by avoiding NSAIDs, cutting foods from their diet that may contribute to ulcers, drinking less alcohol, and stopping smoking.

Anyone who thinks they may have an ulcer or experiencing symptoms should consult a doctor for a diagnosis and suitable treatment.