Although coffee and green tea are suggested to reduce the risk of some types of cancers, only a few epidemiological studies have investigated their effect on the risk of acute myeloid leukemia (AML) and myelodysplastic syndromes (MDS). Here, we investigated the association of coffee and green tea consumption and the risk of AML and MDS in a large-scale population-based cohort study in Japan. A total of 95,807 Japanese subjects (45,937 men and 49,870 women; age 40-69 years at baseline) were followed to the end of 2012, for an average of 18 years. Hazard ratios (HRs) and 95% confidence intervals (95% CIs) for the association between coffee and green tea consumption at baseline and the risk of AML and MDS were assessed using a Cox proportional hazards model with adjustment for potential confounders. During 1,751.956 person-years, we identified 85 AML cases and 70 MDS cases. Our findings showed no significant association between coffee consumption and the risk of AML, or between green tea consumption and the risk of AML or MDS. In contrast, we observed a decreasing dose-response relationship between coffee consumption and the risk of MDS among men (almost none: reference, 1-4 times/week: HR = 0.83, 95% CI: 0.43-1.62; ≥1cups/day: HR = 0.47, 0.22-0.99, p for trend = 0.049). Stratified analysis by smoking status suggested that the observed relative risk for AML and MDS of coffee drinkers relative to non-coffee drinkers might be due to residual confounding by smoking. These findings deserve further investigation in future studies.