In the current call for a greater human health and well-being as a sustainable development goal, to encourage active commuting to and from school (ACS) seems to be a key factor. Research focusing on the analysis of the association between environmental factors and ACS in children and adolescents has reported limited and inconclusive evidence, so more knowledge is needed about it. The main aim of this study is to examine the association between different built environmental factors of both school neighbourhood and home-school route with ACS of children and adolescents belonging to urban areas. The ACS level was evaluated using a self-reported questionnaire. Built environment variables (i.e., density of residents, street connectivity and mixed land use) within a school catchment area and home-school route characteristics (i.e., distance and pedestrian route directness—PRD) were measured using a geographic information system (GIS) and examined together with ACS levels. Subsequently, the association between environmental factors and ACS was analysed by binary logistic regression. Several cut-off points of the route measures were explored using receiver operating characteristic (ROC) curves. In addition, the PRD was further studied regarding different thresholds. The results showed that 70.5% of the participants were active and there were significant associations between most environmental factors and ACS. Most participants walked to school when routes were short (distance variable in children: OR = 0.980; p = 0.038; and adolescents: OR = 0.866; p < 0.001) and partially direct (PRD variable in children: OR = 11.334; p < 0.001; and adolescents: OR = 3.513; p < 0.001), the latter specially for children. Mixed land uses (OR = 2.037; p < 0.001) and a high density of street intersections (OR = 1.640; p < 0.001) clearly encouraged adolescents walking and slightly discouraged children walking (OR = 0.657, p = 0.010; and OR = 0.692, p = 0.025, respectively). The assessment of ACS together with the environmental factors using GIS separately for children and adolescents can inform future friendly and sustainable communities.