Objective Being born preterm is related to adverse health effects later in life. We studied whether preterm birth predicts the risk of migraine. Methods In this nationwide register study, we linked data from six administrative registers for all 235,624 children live-born in Finland (January 1987 to September 1990) and recorded in the Finnish Medical Birth Register. n = 228,610 (97.0%) had adequate data and were included. Migraine served as primary outcome variable and was stringently defined as a diagnosis from specialised health care and/or ≥2 reimbursed purchases of triptans. We applied sex- and birth year-stratified Cox proportional hazard regression models to compute hazard ratios and confidence intervals (95% confidence intervals) for the association between preterm categories and migraine. The cohort was followed up until an average age of 25.1 years (range: 23.3–27.0). Results Among individuals born extremely preterm (23–27 completed weeks of gestation), the adjusted hazard ratios for migraine was 0.55 (0.25–1.24) when compared with the full-term reference group (39–41 weeks). The corresponding adjusted hazard ratios and 95% confidence intervals for the other preterm categories were: Very preterm (28–31 weeks); 0.95 (0.68–1.31), moderately preterm (32–33 weeks); 0.96 (0.73–1.27), late preterm (34–36 weeks); 1.01 (0.91–1.11), early term (37–38 weeks); 0.98 (0.93–1.03), and post term (42 weeks); 0.98 (0.89–1.08). Migraine was predicted by parental migraine, lower socioeconomic position, maternal hypertensive disorder and maternal smoking during pregnancy. Conclusion We found no evidence for a higher risk of migraine among individuals born preterm.