Data centres (DCs) are expected to satisfy the rising demand for internet services. Denmark alone is expected to host several large-scale DCs, whose demand for electricity in 2040 may reach 33% of 2017 national electricity consumption. Understanding the operation and interactions of DCs with energy systems is key to understanding their impacts on installed capacities, costs and emissions. The present paper makes three contributions in this regard. First, we introduce a thermodynamic model that relates the power consumption of DCs to their production of excess heat (EH). Second, the results are scaled up to represent DCs in a national energy-system model for the analysis of different scenarios. Third, scenarios are generated and analysed to quantify the impact of DCs on the Danish energy system until 2050. The results show that DCs might have significant impacts on Denmark’s power and district heating (DH) sectors. First, the power demand from DCs translates into an additional 3–6 GW of offshore wind capacity. Second, EH from DCs is beneficial to the whole energy system, the entire quantity of EH being utilized in four out of five scenarios. EH recovery from DCs is economically beneficial, providing from 4% to 27% of Denmark’s DH after 2040.