To investigate the classification of anxiety based on potential category analysis in gestational diabetes mellitus (GDM) patients and the associated factors. This questionnaire-based, cross-sectional study was conducted on GDM patients admitted to a Grade III-A general hospital using convenience sampling between March and November 2021. Latent class analysis was utilized for classification. Multivariate logistic regression analysis was performed to identify factors associated with anxiety. A total of 215 valid questionnaires were collected, yielding a response rate of 99%. GDM patients were classified into 4 potential categories: low anxiety (54%), high anxiety (21%), worried about the fetus (11%), and worried about delivery (14%). Multivariate logistic regression analysis showed that, compared with low anxiety, education level, family history of diabetes, blood glucose changes, delivery mode schedule, knowledge score of GDM, and marital relationship scale score were independently associated with anxiety (P < .05). The number of births, education level, blood glucose changes, delivery mode schedule, and marital relationship scale score were independently associated with being worried about the fetus (P < .05). Education level, family history of diabetes, blood glucose changes, delivery mode schedule, knowledge score of GDM, and marital relationship scale score were independently associated with being worried about delivery (P < .05). Anxiety in GDM patients was categorized by latent class analysis into low anxiety (54%), high anxiety (21%), worried about the fetus (11%), and worried about delivery (14%). Education level, family history of diabetes, blood glucose changes, delivery mode schedule, GDM knowledge score, and marital relationship scale score might be associated with anxiety.