The association of chocolate consumption with risk of gestational diabetes has not been examined. We aimed to investigate the prospective association between chocolate consumption and risk of gestational diabetes in a large birth cohort in Japan. A total of 97 454 pregnant women with a median gestational age of 12 weeks were recruited from January 2011 to March 2014. Data on demographic information, disease history, socio-economic status, lifestyle and dietary habits were obtained at the study enrolment. Dietary intake during the past 12 months before study enrolment was assessed through a semi-quantitative FFQ. The logistic regression was used to obtain the OR of gestational diabetes in relation to chocolate consumption. Among 84 948 women eligible for the analysis, 1904 cases of gestational diabetes (2·2 %) were identified during the period of pregnancy. After controlling for potential confounding factors including age, smoking status, drinking status, education level, occupation, pre-pregnant BMI, depression, previous history of macrosomia babies, parity, physical activity and dietary factors, women in the highest quartile of chocolate consumption, compared with those in the lowest quartile, had a significantly lower risk of developing gestational diabetes (OR 0·78, 95 % CI 0·67, 0·90; P for trend = 0·002). Stratified analyses suggested that the association was not significantly modified by pre-pregnancy BMI, age, parity, smoking status or drinking status. The present prospective cohort study provided evidence that chocolate consumption was associated with a significant lower risk of gestational diabetes in Japanese women.