To describe the prevalence of unintended pregnancy and its association with HIV status among pregnant women in South Africa. A cross-sectional survey was conducted between October and mid-November 2019 among pregnant women aged 15–49 years in 1589 selected public antenatal care facilities. Pregnancy intention was assessed using two questions from the London Measure of Unplanned Pregnancy. Survey logistic regression examined factors associated with unintended pregnancy. Among 34,946 participants, 51.6% had an unintended pregnancy. On multivariable analysis, the odds of unintended pregnancy was higher among women who knew their HIV-positive status before pregnancy but initiated treatment after the first antenatal visit (adjusted odds ratio [aOR], 1.5 [95% confidence interval (CI):1.2–1.8]), women who initiated treatment before pregnancy (aOR, 1.3 [95% CI:1.2–1.3]), and women with a new HIV diagnosis during pregnancy (aOR, 1.2 [95% CI:1.1–1.3]) compared to HIV-negative women. Women who were single, in a non-cohabiting or a cohabiting relationship, and young women (15–24 years) had significantly higher risk of unintended pregnancy compared to married women and women aged 30–49 years, respectively. A comprehensive approach, including regular assessment of HIV clients’ pregnancy intention, and adolescent and youth-friendly reproductive health services could help prevent unintended pregnancy.