Abstract Background Diet quality is generally poor in persons with diabetes and it is unknown whether this is associated with worse glycaemic control and atherogenic lipid profile. The aim was to examine diet quality in relation to important markers of metabolic control in adults with type 1 diabetes (T1D) and type 2 diabetes (T2D). Methods The study was cross-sectional and included 423 (49% females) persons with T1D and 339 (29% females) persons with T2D recruited from an outpatient diabetes clinic in Denmark. Data were collected from July 2014 to January 2015. Diet quality was assessed with a food frequency questionnaire to examine eight key dietary components (carbohydrates, saturated fatty acids, monounsaturated fatty acids, polyunsaturated fatty acids, added sugar, dietary fibre, fruit and vegetables). Clinical data assessing metabolic control (haemoglobin A1c (HbA1c), total cholesterol (total C), low-density lipoprotein cholesterol (LDL-C), high-density lipoprotein cholesterol (HDL-C), systolic and diastolic blood pressure and body mass index were extracted from the electronic medical records. Results In T1D, higher intake of carbohydrates and added sugar was associated with higher HbA1c; higher fruit intake was associated with lower total C and LDL-C; and higher intake of carbohydrates and dietary fibre was associated with lower HDL-C. In T2D, higher intake of saturated fat was associated with higher total C; higher intake of added sugar was associated with higher LDL-C; and higher intake of polyunsaturated fat was associated with higher diastolic blood pressure. Conclusions In Danish adults with T1D and T2D, both the total intake and the quality of carbohydrates and fat were associated with an unfavourable glucose regulation and lipid profile. Thus, our findings support a constant focus on diet and emphasise the need for dietary support in people with diabetes to improve diet quality, metabolic control and possibly reduce cardiovascular risk.