Background  Onychomycosis is a complication of diabetes mellitus (DM), which has a deleterious impact on the quality of life.

Aim  To explore the prevalence of onychomycosis amongst Taiwanese diabetics, and to analyze the factors associated with onychomycosis after adjusting for age and sex.

Methods  A total of 1245 Taiwanese diabetics were enrolled, and a nested case–control study was performed by onychomycosis outcome and the exposures were compared.

Results  The overall prevalence of onychomycosis among DM patients was 30.76% (383/1245), with a significantly higher prevalence in men than in women (P = 0.024). The factors associated with onychomycosis in matched pairs by gender and age were analyzed in 375 pairs. It was found that metabolic syndrome, obesity, triglyceride (TG) levels, and glycosylated hemoglobin (HbA1c) were associated with onychomycosis (P < 0.05).

Conclusion  Higher prevalence rates of onychomycosis were found in men and older DM patients. Metabolic syndrome, obesity, high TG levels, and poor glycemic control were associated with onychomycosis.