Numerous predictive models for the risk of type 2 diabetes mellitus (T2DM) exist, but a minority of them has implemented nutrition data so far, even though the significant effect of nutrition on the pathogenesis, prevention and management of T2DM has been established. Thus, in the present study, we aimed to build a predictive model for the risk of T2DM that incorporates nutrition data and calculates its predictive performance. We analysed cross-sectional data from 1591 individuals from the population-based Cooperative Health Research in the Region of Augsburg (KORA) FF4 study (2013–14) and used a bootstrap enhanced elastic net penalised multivariate regression method in order to build our predictive model and select among 193 food intake variables. After selecting the significant predictor variables, we built a logistic regression model with these variables as predictors and T2DM status as the outcome. The values of area under the receiver operating characteristic (ROC) curve, sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV) and accuracy of our predictive model were calculated. Eleven out of the 193 food intake variables were selected for inclusion in our model, which yielded a value of area under the ROC curve of 0⋅79 and a maximum PPV, NPV and accuracy of 0⋅37, 0⋅98 and 0⋅91, respectively. The present results suggest that nutrition data should be implemented in predictive models to predict the risk of T2DM, since they improve their performance and they are easy to assess.