As tomorrow's cities are already largely built, many strategies stress the importance of urban renewal processes to address current energy issues. This paper focuses on the Spanish residential building stock built until 2001, which has a low level of energy performance.Considering the current economic crisis, the future lies in renovating the built environment, which holds a significant energy-saving potential. This potential is here quantified by applying the cost-optimal methodology, initially proposed by the Energy Performance of Buildings Directive, and which calculates costoptimal levels of minimum energy performance requirements at the building and component scale.The originality of our study lies in the application of this methodology at the territorial scale, comparing different retrofitting scenarios by scaling-up building-scale results through an archetypal approach. We also describe an Excel-based tool allowing two types of studies: (i) at the building scale, for one archetype in a particular climatic zone; (ii) at the territorial scale, to have an overview of all building archetypes and climatic zones simultaneously. Results include economic aspects, energy consumption and savings and associated emissions.The outcome can help construction-sector firms adapt their business plan, while also providing stakeholders with decision-support to promote a sustainable renewal of the building stock.