To detect an ulcer, your healthcare professional may first take a medical history and do a physical exam. You also may need tests, such as:
Laboratory tests for H. pylori. A blood, stool or breath test can show whether H. pylori is in your body.
For the breath test, you drink or eat something that contains radioactive carbon. H. pylori breaks down the substance in your stomach. Later, you blow into a bag, which is then sealed. If you have H. pylori, your breath sample has the radioactive carbon in the form of carbon dioxide.
If you take an antacid or an antibiotic, tell your healthcare professional. You may need to stop the medicine for a time. Both can affect test results.
Endoscopy. During this procedure, your healthcare professional uses a long, flexible tube with a tiny camera, called an endoscope, to look at the upper part of your digestive system. Endoscopy involves passing the endoscope, down your throat and into your esophagus, stomach and small intestine to look for ulcers.
If there's an ulcer, your health professional may remove a small tissue sample for study in a lab. This is called a biopsy. A biopsy also can show whether H. pylori is in your stomach lining.
You're more likely to have endoscopy if you are older, have signs of bleeding, or have had recent weight loss or trouble eating and swallowing. If the endoscopy shows an ulcer in your stomach, you're likely to have a follow-up endoscopy after treatment. This can show if the ulcer has healed.

An endoscopy procedure involves inserting a long, flexible tube called an endoscope down your throat and into your esophagus. A tiny camera on the end of the endoscope allows views of your esophagus, stomach and the beginning of your small intestine, called the duodenum.
Treatment for peptic ulcers involves killing the H. pylori germ, if needed. Treatment also might involve stopping NSAIDs or lowering the amount, if possible, and taking medicine to help the ulcer heal.
Medicines can include:
Medicines that block acid. Proton pump inhibitors (PPIs) reduce stomach acid. PPIs include omeprazole (Prilosec), lansoprazole (Prevacid), rabeprazole (Aciphex), esomeprazole (Nexium) and pantoprazole (Protonix).
Most people take PPIs in pill form. In the hospital, treatment for a bleeding ulcer may involve a PPI given through a vein in the arm. This is known as intravenous delivery.
Long-term or high-dose use of proton pump inhibitors may increase your risk of hip, wrist and spine fracture. Ask your healthcare professional whether a calcium supplement may reduce this risk.
Treatment for peptic ulcers often leads to ulcer healing. But if your symptoms are severe or if you have them even with treatment, your healthcare professional may suggest endoscopy. This procedure can rule out other possible causes for your symptoms.
If your healthcare professional finds an ulcer during endoscopy, you may need another endoscopy after your treatment to make sure your ulcer has healed.
Peptic ulcers that don't heal with treatment are called refractory ulcers. Reasons for an ulcer not healing include:
Less often, refractory ulcers may be a result of:
Treatment for refractory ulcers most often involves getting rid of factors that keep the ulcer from healing and trying other antibiotics. If you smoke, your healthcare professional may suggest you quit. Smoking can slow ulcer healing.
A serious complication from an ulcer, such as bleeding or a hole in the stomach, may need treatment with endoscopy or surgery. But because there are many medicines that work well, people with peptic ulcers need surgery far less often than in the past.
You may find relief from the pain of a stomach ulcer if you:
Make an appointment with your main healthcare professional if you have symptoms that worry you. Your health professional may send you to a specialist in the digestive system, called a gastroenterologist.
Here's information to help you get ready for your appointment.
When you make the appointment, ask if there's anything you need to do in advance, such as restrict your diet or stop certain medicines.
Make a list of:
For peptic ulcers, some questions to ask include:
Be sure you ask all the questions you have.
Your healthcare professional might ask:
While you wait for your appointment, don't use tobacco or alcohol or eat spicy foods to help ease your discomfort.
Products containing bismuth may help with symptoms of a peptic ulcer. There also is some evidence that zinc can help heal ulcers.
Talk to your healthcare professional before using any alternative medicine for peptic ulcers.