The association between Toxoplasma gondii (T. gondii) infection and diabetes mellitus remains controversial. With the improvement of living standards, the prevalence rate of diabetes is steadily increasing in China. Thus, it is necessary to explore the possible association between toxoplasmosis and diabetes mellitus in China. Hence, case-control studies were conducted to explore the T. gondii seroprevalence and identify the risk factors and possible transmission routes of T. gondii infection in different types of diabetes, including type 1 diabetes (T1DM), type 2 diabetes (T2DM), and gestational diabetes (GDM) patients in China. Four hundred serum samples for each type of diabetes mellitus, matched with 400 control subjects for each group, were collected and examined for anti-T. gondii IgG and IgM antibodies using commercially available enzyme immunoassay kits. The total T. gondii seroprevalence in T1DM, T2DM, and GDM patients was 16.50%, 23.50%, and 21.25%, respectively. Each type of diabetes mellitus patients had a significantly higher T. gondii seroprevalence than the control subjects. Multivariate regression identified three variables as risk factors for T. gondii infection in diabetes patients, including keeping cats at home and consumption of raw oysters for T1DM patients and consumption of raw/undercooked meat and raw oysters for T2DM patients, which may help to guide future research and control policies in diabetes mellitus patients.