Adult hair glucocorticoid concentrations reflect months of hypothalamic-pituitary-adrenal axis activity. However, little is known about the determinants of neonatal hair glucocorticoids. We tested associations between perinatal exposures and neonatal hair glucocorticoids. Cortisol and cortisone were measured by LC-MS/MS in paired maternal and infant hair samples collected within 10 days of birth (n = 49 term, n = 47 preterm), with neonatal samples collected at 6-weeks in n = 54 preterm infants. We demonstrate cortisol accumulation in hair increases with fetal maturity, with hair cortisol being higher in term than preterm born infants after delivery (median 401 vs 106 pg/mg; p < 0.001). In term born infants, neonatal hair cortisol is positively associated with maternal hair cortisol concentration (β = 0.240, p = 0.045) and negatively associated with birthweight z-score (β = −0.340, p = 0.006). Additionally, being born without maternal labour is associated with lower hair cortisol concentrations (β = −0.489, p < 0.001) and a lower ratio of cortisol to cortisone (β = −0.484, p = 0.001). In preterm infants, histological chorioamnionitis is associated with a higher cortisol to cortisone ratio in hair (β = 0.459, p = 0.001). In samples collected 6 weeks after preterm birth, hair cortisol concentration is associated with cortisol hair concentrations measured after birth (β = 0.523, p < 0.001), chorioamnionitis (β = 0.250, p = 0.049) and postnatal exposures including intravenous hydrocortisone therapy (β = 0.343, p < 0.007) and neonatal sepsis (β = 0.290, p = 0.017). In summary, neonatal hair cortisol is associated with birth gestation, maternal hair cortisol concentration and fetal growth. Additionally, exposures at delivery are important determinants of hair cortisol, and should be considered in the design of future research investigating how neonatal hair cortisol relates to prenatal exposures or fetal development.