Previous studies have found associations between one-carbon metabolism nutrients and risk of several cancers, but little is known regarding upper gastrointestinal tract (UGI) cancer. We analyzed prediagnostic serum concentrations of several one-carbon metabolism nutrients (vitamin B12, folate, vitamin B6, riboflavin and homocysteine) in a nested case–control study within the Alpha-Tocopherol, Beta-Carotene Cancer Prevention (ATBC) Study of male smokers, which was undertaken in Finland between 1985 and 1988. We conducted a nested case–control study including 127 noncardia gastric adenocarcinoma (NCGA), 41 esophagogastric junctional adenocarcinoma and 60 esophageal squamous cell carcinoma incident cases identified within ATBC. Controls were matched to cases on age, date of serum collection and follow-up time. One-carbon nutrient concentrations were measured in fasting serum samples collected at baseline (up to 17 years prior to cancer diagnosis). Odds ratios and 95% confidence intervals (CI) were calculated using conditional logistic regression. Lower prediagnostic vitamin B12 concentrations at baseline were associated with a 5.8-fold increased risk of NCGA (95% CI = 2.7–12.6 for lowest compared to highest quartile,p-trend <0.001). This association remained in participants who developed cancer more than 10 years after blood collection, and after restricting the analysis to participants with clinically normal serum vitamin B12 (>300 pmol/L). In contrast, pepsinogen I, a known serologic marker of gastric atrophy, was not associated with NCGA in this population. As vitamin B12 absorption requires intact gastric mucosa to produce acid and intrinsic factor, our findings suggest vitamin B12 as a possible serologic marker for the atrophic gastritis that precedes NCGA, one more strongly associated with subsequent NCGA than pepsinogen.