ImportanceUnderstanding the interplay between sleep duration, dietary habits, and the risk of developing type 2 diabetes (T2D) is crucial for public health and diabetes prevention strategies.ObjectiveTo investigate the associations of type of diet and duration of sleep with the development of T2D.Design, Setting, and ParticipantsData derived from the UK Biobank baseline investigation (2006-2010) were analyzed for this cohort study between May 1 and September 30, 2023. The association between sleep duration and healthy dietary patterns with the risk of T2D was investigated during a median (IQR) follow-up of 12.5 (11.8-13.2) years (end of follow-up, September 30, 2021).ExposureFor the analysis, 247 867 participants were categorized into 4 sleep duration groups: normal (7-8 hours per day), mild short (6 hours per day), moderate short (5 hours per day), and extreme short (3-4 hours per day). Their dietary habits were evaluated based on population-specific consumption of red meat, processed meat, fruits, vegetables, and fish, resulting in a healthy diet score ranging from 0 (unhealthiest) to 5 (healthiest).Main Outcomes and MeasuresCox proportional hazards regression analysis was used to calculate hazard ratios (HRs) and 95% CIs for the development of T2D across various sleep duration groups and healthy diet scores.ResultsThe cohort comprised 247 867 participants with a mean [SD] age of 55.9 [8.1] years, of whom 52.3% were female. During the follow-up, 3.2% of participants were diagnosed with T2D based on hospital registry data. Cox regression analysis, adjusted for confounding variables, indicated a significant increase in the risk of T2D among participants with 5 hours or less of daily sleep. Individuals sleeping 5 hours per day exhibited a 1.16 adjusted HR (95% CI, 1.05-1.28), and individuals sleeping 3 to 4 hours per day exhibited a 1.41 adjusted HR (95% CI, 1.19-1.68) compared with individuals with normal sleep duration. Furthermore, individuals with the healthiest dietary patterns had a reduced risk of T2D (HR, 0.75 [95% CI, 0.63-0.88]). The association between short sleep duration and increased risk of T2D persisted even for individuals following a healthy diet, but there was no multiplicative interaction between sleep duration and healthy diet score.Conclusions and RelevanceIn this cohort study involving UK residents, habitual short sleep duration was associated with increased risk of developing T2D. This association persisted even among participants who maintained a healthy diet. To validate these findings, further longitudinal studies are needed, incorporating repeated measures of sleep (including objective assessments) and dietary habits.