Incidence of upper gastrointestinal cancers of the oesophagus and stomach show a strong unexplained male predominance. Hormonal and reproductive factors have been associated with upper gastrointestinal cancers in women but there is little available data on men. To investigate this, we included 219,425 men enrolled in the UK Biobank in 2006–2010. Baseline assessments provided information on hormonal and reproductive factors (specifically hair baldness, number of children fathered, relative age at first facial hair and relative age voice broke) and incident oesophageal or gastric cancers were identified through linkage to UK cancer registries. Unadjusted and adjusted hazard ratios (HR) and 95% confidence intervals (CIs) were estimated using Cox proportional hazards models. During 8 years of follow-up, 309 oesophageal 210 gastric cancers occurred. There was some evidence that male pattern baldness, was associated with gastric cancer risk (adjusted HR 1.35, 95% CI 0.97, 1.88), particularly for frontal male pattern baldness (adjusted HR 1.52, 95% CI 1.02, 2.28). There was little evidence of association between other hormonal and reproductive factors and risk of oesophageal or gastric cancer, overall or by histological subtype. In the first study of a range of male hormonal and reproductive factors and gastric cancer, there was a suggestion that male pattern baldness, often used as a proxy of sex hormone levels, may be associated with gastric cancer. Future prospective studies that directly test circulating sex steroid hormone levels in relation to upper gastrointestinal cancer risk are warranted.