Abstract The objective of this paper is to show that for the optimal design of an energy system, where there is a trade-off between exergy saving during operation and exergy use during construction of the energy system, exergy analysis and life cycle analysis should be combined. The two methods are often used separately, but a limited number of studies has been carried out in which they are combined in some way. An exergetic optimisation of a heat exchanger has been carried out on the basis of the life cycle analysis method in this paper. The optimisation takes into account irreversibilities due to frictional pressure drops and the temperature difference between the hot and cold stream and irreversibilities due to the production of the materials and the construction of the heat exchanger. As an example of this type of heat exchanger, a water to water heat exchanger in a city heating system has been selected. The influence of the configuration of the heating system, including the energy conversion, on the optimisation of the heat exchangers has been shown. The analysis of the heat exchanger in which exergy analysis and life cycle analysis are combined gives the design conditions of the heat exchangers which lead to the lowest life cycle irreversibility.