Background: Esophagectomy or pancreaticoduodenectomy is the standard surgical approach for patients with tumors of the esophagus or pancreatic head. Postoperative mortality is strongly correlated with the occurrence of anastomotic leakage (AL). Delay in diagnosis leads to delay in treatment, which ratifies the need for development of novel and accurate non-invasive diagnostic tests for detection of AL. Urinary volatile organic compounds (VOCs) reflect the metabolic status of an individual, which is associated with a systemic immunological response. The aim of this study was to determine the diagnostic accuracy of urinary VOCs to detect AL after esophagectomy or pancreaticoduodenectomy. Methods: In the present study, urinary VOCs of 63 patients after esophagectomy (n = 31) or pancreaticoduodenectomy (n = 32) were analyzed by means of field asymmetric ion mobility spectrometry. AL was defined according to international study groups. Results: AL was observed in 15 patients (24%). Urinary VOCs of patients with AL after pancreaticoduodenectomy could be distinguished from uncomplicated controls, area under the curve 0.85 (95% CI 0.76–0.93), sensitivity 76%, and specificity 77%. However, this was not observed following esophagectomy, area under the curve 0.51 (95% CI 0.37–0.65). Conclusion: In our study population AL following pancreaticoduodenectomy could be discriminated from uncomplicated controls by means of urinary VOC analysis, NTC03203434.