Introduction More women with congenital heart disease are reaching childbearing age compared to earlier, due to advances in diagnosis and treatment. Women with congenital heart disease are at increased risk of obstetric and cardiac complications during pregnancy and childbirth. Likewise, studies indicate an increased risk of adverse neonatal outcomes such as premature birth and small birth weight. Preterm birth and low birth weight are strong predictors of neonatal morbidity and mortality as well as several diseases in adult life. Preterm birth is also known to differ by socioeconomic position. It is, however, unknown if the risk of preterm birth among women with congenital heart disease differs by socioeconomic position. We aim to test the hypothesis that women with congenital heart disease have higher risk of preterm birth, including extremely-, very- and moderately preterm birth and whether socioeconomic position modifies the risk. Method The study was a prospective cohort study. We included all singleton deliveries registered in the Danish Medical Birth Register between 1997 and 2014 among women born in Denmark. Women were included in the cohort when they completed 22 weeks of gestation. Maternal congenital heart disease was identified through The Danish National Patient Register. Deliveries among women with congenital heart disease were compared to deliveries among women without congenital heart disease. Preterm birth was defined as given birth before 37 completed weeks of gestation and was categorized into extremely preterm birth (22–27 completed weeks), very preterm (28–31 completed weeks) and moderately preterm (32–36 completed weeks). Highest level of completed education the year prior birth was used as measure of socioeconomic position and obtained from the Danish Education Registers and grouped into three categories. Hazard ratios (HR) of preterm birth according to maternal congenital heart disease were estimated using a Cox proportional hazard model with gestational age as underlying time scale. The model was adjusted for education, maternal age, parity, calendar year, induction of labor and prelabor caesarean section. To test for interaction between congenital heart disease and educational level a model with the single term of variables were compared to a model including the interaction term using a nested log likelihood test. Results A total of 934,314 births (7509 among women with congenital heart disease) were included in the sample for analysis. The overall proportion of preterm birth was 5.1% (47,737). The median gestational age was 280 days (interquartile range 173–187). The adjusted HR of any preterm birth was 1.38 (1.26–1.56). The HR of extremely-, very- and moderately preterm birth was 2.2 (1.59; 3.05), 1.34 (1.03; 1.75) and 1.34 (1.22; 1.48), respectively for women with congenital heart disease as compared to women without congenital heart disease. Education was strongly associated with any preterm birth. The HR of low and medium education as compared to high education was 1.71 (1.66–1.76) and 1.23(1.20–1.26), respectively. The risk of preterm birth was higher in all strata of educational level; HR of preterm birth among women with low education was 1.37(1.15–1.62), medium education 1.45(1.26–1.67), high education 1.30 (1.09–1.54). The P-value of interaction between congenital heart disease and education was 0.54. Conclusions Women with congenital heart disease were at increased risk of preterm birth when compared to women without congenital heart disease. The risk of given birth extremely preterm was more than twice as high for women with congenital heart disease. Education was strongly associated with risk of preterm birth and the risk of any preterm persisted in all strata of education.