Objective To assess the incidence and associates of diabetic ketoacidosis (DKA) in a representative community-based cohort. Methods All hospitalizations of 1724 participants in the Fremantle Diabetes Study Phase II for/with DKA (plasma glucose >13.8 mmol/L, urinary/serum ketones, serum bicarbonate <18 mmol/L and/or arterial/venous pH <7.30) were identified between study entry from 2008 to 2011 and end-2013. Details of each episode were categorized by chart review as confirmed/probable DKA, possible DKA or not DKA. Incidence rates by diabetes type were calculated. Cox proportional hazards modeling determined predictors of first episode, and negative binomial regression identified predictors of frequency. Results There were 53 coded DKA episodes (41 first episodes, 12 recurrences), of which 19 (35.8%) were incorrectly coded, 9 (17.0%) had possible DKA and 25 (47.2%) had confirmed/probable DKA. Of this latter group, 44% had type 1 diabetes, 32% had type 2 diabetes, 12% had latent autoimmune diabetes of adults (LADA) and 12% had secondary diabetes. The overall incidence of confirmed/probable DKA (95% CI) was 35.6 (23.0 to 52.6)/10 000 person-years (178.6 (85.7 to 328.5)/10 000 person-years for type 1 diabetes, 13.3 (5.7 to 26.1)/10 000 person-years for type 2 diabetes, 121.5 (33.1 to 311.0)/10 000 person-years for LADA and 446.5 (92.1 to 1304.9)/10 000 person-years for secondary diabetes). Baseline ln(fasting serum C-peptide) (inversely), glycated hemoglobin and secondary diabetes predicted both incident first confirmed/probable DKA episode and the frequency of DKA (p<0.001). Conclusions These data highlight the contribution of poor glycemic control and limited pancreatic beta cell function to incident DKA, and show that people with types of diabetes other than type 1, especially secondary diabetes, are at risk.