Background It is unknown whether a socio-economic difference exists in the association of diet quality with type 2 diabetes incidence, nor how diet influences the socioeconomic inequality in diabetes burden. Methods In 91,025 participants of the population-based Lifelines Cohort (aged ≥30, no diabetes or cardiovascular diseases at baseline), type 2 diabetes incidence was based on self-report, fasting glucose ≥ 7·0 mmol/l and/or HbA1c ≥ 6·5%. The evidence-based Lifelines Diet Score was calculated with data of a 110-item food frequency questionnaire. Socio-economic status (SES) was defined by educational level. Cox proportional hazards models were adjusted for age, gender, smoking, energy intake, alcohol intake and physical activity. Findings In 279,796 person-years of follow-up, 1045 diabetes cases were identified. Incidence rate was 5·7, 3·2 and 2·4 cases/1000 person-years in low, middle and high SES, respectively. Diet was associated with greater diabetes risk (HR(95%CI) in Q1 (poor diet quality) vs. Q5 (high diet quality) = 2·11 (1·70–2·62)). SES was a moderator of the association(pINTERACTION = 0·038). HRs for Q1 vs. Q5 were 1·66 (1·22–2·.27) in low, 2·76 (1·86–4·08) in middle and 2·46 (1·53–3·97) in high SES. With population attributable fractions of 14·8%, 40·1% and 37·3%, the expected number of cases/1000 person-years preventable by diet quality improvement was 0·85 in low, 1·28 in middle and 0·90 in high SES. Interpretation Diet quality improvement can potentially prevent one in three cases of type 2 diabetes, but because of a smaller impact in low SES, it will not narrow the socioeconomic health gap in diabetes burden. Funding None.