The extraction of shallow geothermal energy using borehole heat exchangers (BHEs) is a promising approach for decarbonisation of the heating sector. However, a dense deployment of BHEs may lead to thermal interference between neighboring boreholes and thereby to over-exploitation of the heat capacity of the ground. Here we propose a novel method to estimate the technical potential of BHEs which takes into account potential thermal interference as well as the available area for BHE installations. The method combines simulation of the long-term heat extraction through BHEs for a range of borehole spacings and depths and includes an optimisation step to maximise the heat extraction. Application of the method to a case study in western Switzerland, from an available area of , yields an annual technical potential of 4.65 TWh and a maximum energy density of 15.5 kWh/m2. The results also suggest that, for a minimum borehole spacing of 5 m and a maximum borehole depth of 200 m, the cumulative installed borehole depth should not exceed 2 km / ha. The estimated technical potential can be used by urban planners for the techno-economic analysis of BHE systems and by policy makers to develop strategies that encourage the use of shallow geothermal energy.