A substantial proportion of women experience mental health challenges during pregnancy or the postpartum period. Common mental disorders (CMDs), including depression, anxiety, and obsessive-compulsive disorder, are prevalent. Identifying causes and associated risk factors is imperative for early intervention and the prevention of mental health issues. This study utilized data from the 2018 Basic Health Research, which was conducted nationwide in Indonesia, using a crosssectional approach. We focused on women aged 13-49 years who were currently or previously married, and had experienced pregnancy, including 8889 pregnant women and 77 012 women who had delivered between January 1, 2013 and August 31, 2018. The Self-Reporting Questionnaire-20 was employed to assess CMDs. Multivariate logistic regression was performed. The prevalence of CMDs in pregnant women was 12.6%, while postpartum mothers exhibited a prevalence of 10.1%. Poor health status displayed the strongest impact on CMDs during both pregnancy (adjusted odds ratio [aOR], 12.23; 95% confidence interval [CI], 9.01 to 16.60) and the postpartum period (aOR, 16.72; 95% CI, 14.85 to 18.82). Additional significant factors for both group include young maternal age, lack of education, unemployment, history of hypertension, and smoking status. Among pregnant women, CMDs was also associated with first-trimester pregnancy, previous pregnancy complications, and small upper arm circumference. For postpartum mothers, significant factors include living in rural areas, history of abortion, unwanted pregnancy, pregnancy complications, lack of antenatal care, spontaneous delivery, postpartum complications and contraceptive use. CMDs can impact in pregnant and postpartum women. Early diagnosis and management must be seamlessly integrated into primary healthcare practices.