Rooftop solar photovoltaic (PV) systems can make a significant contribution to Europe's energy transition. Realising this potential raises challenges at policy and electricity system planning level. To address this, the authors have developed a geospatially explicit methodology using up-to-date spatial information of the EU building stock to quantify the available rooftop area for PV systems. To do this, it combines satellite-based and statistical data sources with machine learning to provide a reliable assessment of the technical potential for rooftop PV electricity production with a spatial resolution of 100 m across the European Union (EU). It estimates the levelised cost of electricity (LCOE) using country-specific parameters and compares it to the latest household electricity prices. The results show that the EU rooftops could potentially produce 680 TWh of solar electricity annually (representing 24.4% of current electricity consumption), two thirds of which at a cost lower than the current residential tariffs. Country aggregated results illustrate existing barriers for cost-effective rooftop systems in countries with low electricity prices and high investment interest rates, as well as provide indications on how to address these.