To examine the associations between the intake of total and individual whole grain foods and the risk of type 2 diabetes.Prospective cohort studies.Nurses' Health Study (1984-2014), Nurses' Health Study II (1991-2017), and Health Professionals Follow-Up Study (1986-2016), United States.158 259 women and 36 525 men who did not have type 2 diabetes, cardiovascular disease, or cancer at baseline.Self-reports of incident type 2 diabetes by participants identified through follow-up questionnaires and confirmed by a validated supplementary questionnaire.During 4 618 796 person years of follow-up, 18 629 participants with type 2 diabetes were identified. Total whole grain consumption was categorized into five equal groups of servings a day for the three cohorts. After adjusting for lifestyle and dietary risk factors for diabetes, participants in the highest category for total whole grain consumption had a 29% (95% confidence interval 26% to 33%) lower rate of type 2 diabetes compared with those in the lowest category. For individual whole grain foods, pooled hazard ratios (95% confidence intervals) for type 2 diabetes in participants consuming one or more servings a day compared with those consuming less than one serving a month were 0.81 (0.77 to 0.86) for whole grain cold breakfast cereal, 0.79 (0.75 to 0.83) for dark bread, and 1.08 (1.00 to 1.17) for popcorn. For other individual whole grains with lower average intake levels, comparing consumption of two or more servings a week with less than one serving a month, the pooled hazard ratios (95% confidence intervals) were 0.79 (0.75 to 0.83) for oatmeal, 0.88 (0.82 to 0.94) for brown rice, 0.85 (0.80 to 0.90) for added bran, and 0.88 (0.78 to 0.98) for wheat germ. Spline regression showed a non-linear dose-response association between total whole grain intake and the risk of type 2 diabetes where the rate reduction slightly plateaued at more than two servings a day (P<0.001 for curvature). For whole grain cold breakfast cereal and dark bread, the rate reduction plateaued at about 0.5 servings a day. For consumption of popcorn, a J shaped association was found where the rate of type 2 diabetes was not significantly raised until consumption exceeded about one serving a day. The association between higher total whole grain intake and lower risk of type 2 diabetes was stronger in individuals who were lean than in those who were overweight or obese (P=0.003 for interaction), and the associations did not vary significantly across levels of physical activity, family history of diabetes, or smoking status.Higher consumption of total whole grains and several commonly eaten whole grain foods, including whole grain breakfast cereal, oatmeal, dark bread, brown rice, added bran, and wheat germ, was significantly associated with a lower risk of type 2 diabetes. These findings provide further support for the current recommendations of increasing whole grain consumption as part of a healthy diet for the prevention of type 2 diabetes.