A heat exchanger comprises a first and a second fluid circuit extending through the heat exchanger. The heat exchanger further comprises a stack of fluid plates and a membrane arranged between each of the fluid plates where one interspace is formed between each fluid plate and membrane. The first and second fluid circuits are each constituted by a passage extending through the fluid plates and membranes and along the fluid plates and membranes in a least two interspaces. A primary fluid (W) is passed through the first fluid circuit and a secondary fluid (X) is passed through the second fluid circuit such that the primary fluid (W) is passed along one side of a membrane and simultaneously the secondary fluid (X) is passed along the other side of the membrane. Heat is thus exchanged between the primary fluid (W) and the secondary fluid (X) over the membrane.