To investigate postpartum myometrial elasticity in pregnant women with gestational diabetes mellitus (GDM) using shear wave elastography (SWE) and analyze the correlation between myometrial SWE values and obstetric complications. Clinical data of women who gave birth at Affiliated Hospital of Yangzhou University from August 2022 to July 2023 were retrospectively analyzed and divided into two groups based on GDM diagnosis: the GDM group and the healthy control group. SWE was used to measure the elasticity values of the anterior and posterior myometrial walls in both groups. Differences in placental attachment position and SWE values at the placental attachment site were compared between the two groups. Spearman correlation analysis was utilized to evaluate the correlation between SWE values and obstetric complications. Glycated hemoglobin (HbA1c), homeostasis model assessment of insulin resistance (HOMA-IR), fasting plasma glucose (FPG), 2-hour postprandial glucose (2h PG), triglycerides (TG), and total cholesterol (TC) levels were higher in the GDM group than in the healthy control group (P<0.05). There was a statistically significant difference in placental attachment position between the two groups (P<0.05). In both the GDM (17.52±0.42 vs 25.29±0.74, P=0.001) and control groups (14.06±5.01 vs 22.20±6.34, P=0.001), mean SWE values were significantly lower for anterior versus posterior placental attachment, and mean SWE values were also significantly higher in the GDM versus control group for both anterior (17.52±0.42 vs 14.06±5.01, P=0.001) and posterior placental attachment (25.29±0.74 vs 22.20±6.34, P=0.001). Spearman correlation analysis showed that postpartum hemorrhage (r=0.632, P=0.017), preeclampsia (r=0.818, P=0.014), premature rupture of membranes (r=0.710, P=0.012), placental abruption (r=0.732, P=0.031), and ketoacidosis (r=0.729, P=0.022) were negatively correlated with average myometrial SWE values in the GDM group (P<0.05). SWE values at the placental attachment site were higher in GDM patients than in healthy pregnant women, and myometrial elasticity was positively correlated with obstetric complications.