Background and objective Health status in childhood is correlated with educational outcomes. Emergency hospital admissions during childhood are common but it is not known how these unplanned breaks from schooling impact on education outcomes. We hypothesised that children who had emergency hospital admissions had an increased risk of lower educational attainment, in addition to the increased risks associated with other health, social and school factors. Methods This record-linked electronic birth cohort, included children born in Wales between 1 January 1998 and 31 August 2001. We fitted multilevel logistic regression models grouped by schools, to determine whether emergency hospital inpatient admission before age 7 years was associated with the educational outcome of not attaining the expected level in a teacher-based assessment at age 7 years (KS1). We adjusted for pregnancy, perinatal, socio-economic, neighbourhood, pupil mobility and school-level factors. Results The cohort comprised 64 934 children. Overall, 4680 (7.2%) did not attain the expected educational level. Emergency admission to hospital was associated with poor educational attainment (OR 1.12 95% Credible Interval (CI) 1.05, 1.20 for all causes during childhood, OR 1.19 95%CI 1.07, 1.32 for injuries and external causes and OR 1.31 95%CI 1.04, 1.22 for admissions during infancy), after adjusting for known determinants of education outcomes such as extreme prematurity, being small for gestational age and socio-economic indicators, such as eligibility for free school meals. Conclusion Emergency inpatient hospital admission during childhood, particularly during infancy or for injuries and external causes was associated with an increased risk of lower education attainment at age 7 years, in addition to the effects of pregnancy factors (gestational age, birthweight) and social deprivation. These findings support the need for injury prevention measures and additional support in school for affected children to help them to achieve their potential.