Four different wind turbine foundations were designed and optimised in this paper, which include the small scale onshore, large scale onshore, offshore monopile and offshore gravity-based foundation. According to the European Wind Energy Association, the foundation makes up on average 6.5% of the capital cost for onshore projects and 34% of that of offshore projects. This justifies the need for optimisations to be performed on all WT foundations to make wind energy more cost-competitive with conventional forms of thermal electricity generation. The primary driver in foundation size is wind loading, however it is also more desirable locate these structures in areas of high wind resources to maximise the annual energy yield. Therefore a specific indicator has been applied to measure performance of each foundation. This indicator is the energy payback time and it is minimised in order to develop the most cost-effective and optimal foundation.