For diagnosing ulcers, following initial clinical and laboratory assessments, upper gastrointestinal endoscopy (gastroscopy) is considered the gold standard. Gastroscopy allows direct visualization of ulcers, collection of biopsies to assess microscopic changes in the mucosa, and detection of Helicobacter pylori. If H. pylori is present, targeted antibiotic therapy is initiated. Additionally, acid-suppressing medications are prescribed. In cases of bleeding ulcers, endoscopic treatment methods can be applied during gastroscopy to stop the bleeding.

Treatment typically involves acid-suppressing medications such as H2 receptor blockers and proton pump inhibitors (PPIs), and if Helicobacter pylori is detected, specific antibiotic therapy. Reducing stomach acid production alleviates symptoms and allows the ulcer to heal.

Most ulcers heal with medication. Surgical interventions, such as vagotomy (cutting the vagus nerve to reduce acid and pepsin secretion), are rarely performed today due to their invasive nature and potential for complications, including recurrence. Surgery may also be necessary for severe complications like persistent bleeding, stenosis (narrowing/obstruction), or perforation.

Ulcers can be chronic and recurrent, significantly impacting a patient's quality of life. While proper treatment usually leads to healing, a healthy diet can also support recovery.