Over 200 million of the world’s 273 million out-of-school children live in Central and Southern Asia or Sub-Saharan Africa, where distance to school is a persistent barrier, and walking remains the dominant travel mode. Tanzania presents a critical case: over 300,000 children dropped out before completing primary school in 2023, and only 8.5% complete upper-secondary education. We estimated walking travel time to the nearest primary and secondary school using a 100-metre resolution cost-surface that incorporated land cover, topography, and road networks. Travel time surfaces were linked to Demographic and Health Survey (DHS) data and analysed using multilevel Poisson regression for primary school-age children (aged 7–13) and single-level models for secondary school-age adolescents (aged 14–19). Among primary school-age children (n = 9213), poor geographic access (walking time > 45 min) was associated with a 27.9% higher prevalence of non-participation after socioeconomic adjustment, consistent across wealth quintiles and maternal education groups. Among secondary school-age adolescents (n = 2585), poor access was not significant. Household wealth and maternal education showed strong protective relationships at both levels. Each additional 10 min of walking travel time was associated with a 2.9% higher prevalence of non-participation, equivalent to approximately 18% per additional hour. Geographic access is an independent barrier to primary school-age participation irrespective of socioeconomic position, as there was approximately a 2.9% higher prevalence of non-participation in school for every additional 10 min of travel time, supporting geographically targeted infrastructure investment at primary level and demand-side interventions at secondary level.