A noninvasive breath test has the potential to improve survival from esophagogastric cancer by facilitating earlier detection. This study aimed to investigate the production of target volatile fatty acids (VFAs) in esophagogastric cancer through analysis of the ex vivo headspace above underivatized tissues and in vivo analysis within defined anatomical compartments, including analysis of mixed breath, isolated bronchial breath, and gastric-endoluminal air. VFAs were measured by PTR-ToF-MS and GC-MS. Levels of VFAs (acetic, butyric, pentanoic, and hexanoic acids) and acetone were elevated in ex vivo experiments in the headspace above esophagogastric cancer compared with the levels in samples from control subjects with morphologically normal and benign conditions of the upper gastrointestinal tract. In 25 patients with esophagogastric cancer and 20 control subjects, receiver-operating-characteristic analysis for the cancer-specific VFAs butyric acid ( P < 0.001) and pentatonic acid ( P = 0.005) within in vivo gastric-endoluminal air gave an area under the curve of 0.80 (95% confidence interval of 0.65 to 0.93, P = 0.01). Compared with mixed- and bronchial-breath samples, all examined VFAs were found in highest concentrations within esophagogastric-endoluminal air. In addition, VFAs were higher in all samples derived from cancer patients compared with in the controls. Equivalence of VFA levels within the mixed and bronchial breath of cancer patients suggests that their origin within breath is principally derived from the lungs and, by inference, from the systemic circulation as opposed to direct passage from the upper gastrointestinal tract. These findings highlight the potential to utilize VFAs for endoluminal-gas biopsies and noninvasive mixed-exhaled-breath testing for esophagogastric-cancer detection.