Infection with Helicobacter pylori is associated with almost all cases of peptic ulcer. Using Bayes' formula, we evaluated whether testing for H. pylori in a patient with proven ulcer might help in the work-up of a Zollinger-Ellison syndrome (ZE). A negative test for H. pylori in a patient with duodenal ulcer would raise a pretest probability for ZE of 10-20% to a posttest range of 61-78%. The information provided by a negative test result with respect to ZE is greater in younger than in older ulcer patients. It is also greater in duodenal than gastric ulcer. We conclude that testing for H. pylori in ulcer patients, in whom ZE constitutes a possible differential diagnosis, adds substantially to the decision making at relatively low cost and little additional risk to the patient.