The significant contribution of buildings to global energy-related CO2 emissions and climate change has led to projections of a carbon–neutral building stock by 2050. This study evaluates the potential contribution of rooftop photovoltaics to urban energy self-sufficiency by developing an enhanced CityBEM framework, our in-house urban building energy model (UBEM). This methodology enables city-scale, simultaneous simulations of building energy use and rooftop photovoltaic retrofitting with low computational time. CityBEM’s robustness and high spatiotemporal resolution facilitate transient simulations of individual buildings with diverse usage types across large urban areas, addressing common computational constraints and input data limitations in UBEM applications. The rooftop photovoltaic model in CityBEM utilizes a comprehensive approach with physics-based modeling of crystalline PVs, model validation, and a proper design of array networks to manage self-shading effects. More than 57,000 buildings with a combined footprint of 32.37 million square meters are located in the simulation test case covering downtown Montreal (Quebec, Canada) and the surrounding areas. Results indicate that rooftop PV adoption in these buildings could potentially generate 5.9 TWh of electricity annually, reduce energy demand by 27.3%, and achieve an average annual energy saving of 40%. This local generation could also reduce operational CO2 equivalent emissions by over 0.2 megatons. Overall, this study highlights the significant potential of rooftop photovoltaics for a cleaner, more energy self-sufficient urban future.