Background Though diabetes mellitus (DM) is a well-recognised risk factor for onychomycosis (OM), the epidemiology of OM in diabetic patients remains largely unexplored, especially from the Indian subcontinent. Aims and objectives To estimate the prevalence of OM in diabetic patients, to identify and analyse risk factors, and correlate the severity of nail changes with glycemic control (HBA1c). Methods This cross-sectional, analytical study involved 300 diabetic patients. Patients with the clinical diagnosis of OM, supplanted by at least two of the four tests (KOH, culture, onychoscopy and nail histopathology) were considered cases of OM. Demographic and haematological profile was analysed using chi-square test/ Fischer's exact test. Logistic regression was applied to assess the independent risk factors. Results The prevalence of OM in DM patients was 34% (102/300) and significant risk factors included; age >60 years, male gender, closed shoes, disease duration >5 years, high BMI (>25) and lack of awareness about nail changes. Distal and lateral subungual OM (78%) was the commonest presentation followed by proximal subungual OM, superficial OM and total dystrophic OM. Correlation between HbA1c and the number of nails involved was found to be significant. Limitation As cases were recruited from a hospital setting, there could be chances of Berksonian bias. Conclusion The prevalence of OM in diabetic patients is high and the severity of nail changes correlates with HbA1C levels. It is important to diagnose OM early in order to treat and prevent complications.