Preterm birth affects over 12% of all infants born in the United States; yet the biology of early delivery remains unclear, including whether epigenetic mechanisms are involved. We examined associations of maternal and umbilical cord blood long interspersed nuclear element-1 (LINE-1) DNA methylation with length of gestation and odds of preterm birth in singleton pregnancies in Project Viva. In white blood cells from maternal blood during first trimester (n = 914) and second trimester (n = 922), and from venous cord blood at delivery (n = 557), we measured LINE-1 by pyrosequencing [expressed as %5 methyl cytosines within the LINE-1 region analyzed (%5mC)]. We ran linear regression models to analyze differences in gestation length, and logistic models for odds of preterm birth (<37 v. ⩾37 weeks’ gestation), across quartiles of LINE-1. Mean (s.d.) LINE-1 levels were 84.3 (0.6), 84.5 (0.4) and 84.6 (0.7) %5mC for first trimester, second trimester and cord blood, respectively. Mean (s.d.) gestational age was 39.5 (1.8) weeks, and 6.5% of infants were born preterm. After adjustment for maternal age, race/ethnicity, body mass index, education, smoking status and fetal sex, women with the highest v. lowest quartile of first trimester LINE-1 had longer gestations [0.45 weeks (95% CI 0.12, 0.78)] and lower odds of preterm birth [OR 0.40 (0.17, 0.94)], whereas associations with cord blood LINE-1 were in the opposite direction (−0.45 weeks, −0.83, −0.08) and [OR 4.55 (1.18, 17.5)]. In conclusion, higher early pregnancy LINE-1 predicts lower risk of preterm birth. In contrast, preterm birth is associated with lower LINE-1 in cord blood.