OBJECTIVE: We examined the association of habitual caffeine intake with intraocular pressure (IOP) and glaucoma and whether these associations were modified by genetic predisposition to higher IOP. We also assessed whether genetic predisposition to higher coffee consumption was related to IOP. DESIGN: A cross-sectional study in the UK Biobank. PARTICIPANTS: We included 121,374 participants (baseline ages 39-73 years) with data on coffee and tea intake (collected 2006-2010) and corneal-compensated IOP measurements in 2009. In a subset of 77,906 participants with up to five web-based 24-hour-recall food frequency questionnaires (2009-2012) we evaluated total caffeine intake. We also assessed the same relations with any glaucoma (9,286 cases and 189,763 controls). METHOD: We evaluated multivariable-adjusted associations with IOP using linear regression, and with glaucoma using logistic regression. For both outcomes, we examined gene-diet interactions, using a polygenic risk score (PRS), which combined the effects of 111 genetic variants associated with IOP. We also performed two-sample Mendelian Randomization (MR) using 8 genetic variants associated with coffee intake, to assess potential causal effects of coffee consumption on IOP. MAIN OUTCOME AND MEASURES: IOP; glaucoma. RESULTS: Mean IOP was 16.0 mmHg (Standard Deviation=3.8). MR analysis did not support a causal effect of coffee drinking on IOP (P>0.1). Greater caffeine intake was weakly associated with lower IOP: the highest (≥232mg/day) vs. lowest (<87mg/day) caffeine consumption was associated with a 0.10 mmHg lower IOP (P=0.01). However, this association was significantly modified by IOP PRS: among those in the highest IOP PRS quartile, consuming >480mg/day versus <80 mg/day was associated with a 0.35 mmHg higher IOP (P=0.01). The relation between caffeine intake and glaucoma was null (P≥0.1). However, this relation was also significantly modified by IOP PRS: compared to those in the lowest IOP PRS quartile consuming no caffeine, those in the highest IOP PRS quartile consuming ≥321mg/day had a 3.90-fold higher glaucoma prevalence (P=0.0003). CONCLUSIONS: Habitual caffeine consumption was weakly associated with lower IOP and the association between caffeine consumption and glaucoma was null. However, among participants with the strongest genetic predisposition to elevated IOP, greater caffeine consumption was associated with higher IOP and higher glaucoma prevalence.