The research aimed to assess the urban-rural gap in mathematics achievement among secondary education students in Peru using the ECE 2018 evaluation and the Oaxaca-Blinder method. Employing a retrospective observational design, the study analyzed data from the ECE to understand this disparity. It revealed a significant gap favoring urban areas, even after adjusting for socioeconomic factors and school contributions, with a difference of 63.28 points. Decomposition analysis showed that 82.58% of this gap is explained by differences in observable attributes (endowments), primarily socioeconomic variables and school inputs. These findings underscore the importance of public policies targeting improvements in both school resources and the living standards of impoverished populations to address educational disparities effectively.