Objective. To evaluate the prevalence of HSV-1 and HSV-2 in pregnant and nonpregnant women, testing the correlation between DNA of the viruses with colposcopic and/or cytological changes, and evaluate association with sociodemographic characteristics and sexual activity. Methods. Included in this study were 106 pregnant and 130 nonpregnant women treated at primary health care units of Natal, Brazil, in the period 2010-2011. The patients were examined by colposcopy, and two cervical specimens were collected: one for cytology examination and another for analysis by PCR for detection of HSV-1 and HSV-2. Results. HSV-1 alone was detected in 16.0% of pregnant and 30.0% of nonpregnant women. For HSV-2, these rates were 12.3% and 15.5%, respectively. HSV-2 had a higher correlation with cytology and/or colposcopy changes than HSV-1 did. Genital HSV-1 infection was not associated with any of the variables tested, whereas HSV-2 infection was associated with ethnicity, marital status, and number of sexual partners. Conclusions. The prevalence of HSV-1 was higher than that observed for HSV-2 in both pregnant and nonpregnant women. The genital infection by HSV-2 was higher in women with changed colposcopy and/or cytology, and it was associated with ethnicity, marital status, and number of sexual partners.