A heat exchanger comprising: a plurality of flat tubes arranged mutually; a header collecting tube to which are connected one ends of the flat tubes, and which extends in a vertical direction; and a plurality of fins joined to the flat tubes, wherein the header collecting tube (23, 123, 223) has a loop structure including partition members (51, 52, 53, 151, 251) that partition internal spaces (23a, 23b, 23c) into first spaces (51a, 52a, 53a), which are spaces to the side where the flat tubes are connected, and second spaces (51b, 52b, 53b), which are spaces to the side opposite from the side where the flat tubes are connected to the first space, inflow ports (41x, 42x, 43x), which are located in lower parts of the first spaces and which, in the case of functioning as a refrigerant evaporator, prompt inflow of refrigerant so as to give rise to an ascending flow within the first spaces, upper communicating passages (51x, 52x, 53x) located in upper parts of the first spaces and the second spaces, and providing communication between the upper parts of the first spaces and the second spaces, thereby guiding the refrigerant which has ascended within the first spaces into the second spaces, and lower communicating passages (51y, 52y, 53y, 151y, 215y) located in lower parts of the first spaces and the second spaces, providing communication between the lower parts of the first spaces and the second spaces, and guiding the refrigerant in a direction other than vertical direction from the second spaces towards spaces above the inflow ports in the first spaces, thereby guiding the refrigerant from the first spaces to the second spaces, and returning the refrigerant having descended through the second spaces from the second spaces to the first spaces, characterized in that: flow regulation spaces (41a, 42a, 43a) are formed at the bottoms of the first spaces and second spaces among the internal spaces, the first and second spaces and the flow regulation spaces, are partitioned by flow regulation members (41, 42, 43), and the inflow ports are furnished to the flow regulation members, in such a way that the passage cross section area of the refrigerant going from the flow regulation spaces towards the first spaces can be throttled. a plurality of flat tubes arranged mutually; a header collecting tube to which are connected one ends of the flat tubes, and which extends in a vertical direction; and a plurality of fins joined to the flat tubes, wherein the header collecting tube (23, 123, 223) has a loop structure including partition members (51, 52, 53, 151, 251) that partition internal spaces (23a, 23b, 23c) into first spaces (51a, 52a, 53a), which are spaces to the side where the flat tubes are connected, and second spaces (51b, 52b, 53b), which are spaces to the side opposite from the side where the flat tubes are connected to the first space, inflow ports (41x, 42x, 43x), which are located in lower parts of the first spaces and which, in the case of functioning as a refrigerant evaporator, prompt inflow of refrigerant so as to give rise to an ascending flow within the first spaces, upper communicating passages (51x, 52x, 53x) located in upper parts of the first spaces and the second spaces, and providing communication between the upper parts of the first spaces and the second spaces, thereby guiding the refrigerant which has ascended within the first spaces into the second spaces, and lower communicating passages (51y, 52y, 53y, 151y, 215y) located in lower parts of the first spaces and the second spaces, providing communication between the lower parts of the first spaces and the second spaces, and guiding the refrigerant in a direction other than vertical direction from the second spaces towards spaces above the inflow ports in the first spaces, thereby guiding the refrigerant from the first spaces to the second spaces, and returning the refrigerant having descended through the second spaces from the second spaces to the first spaces, characterized in that: flow regulation spaces (41a, 42a, 43a) are formed at the bottoms of the first spaces and second spaces among the internal spaces, the first and second spaces and the flow regulation spaces, are partitioned by flow regulation members (41, 42, 43), and the inflow ports are furnished to the flow regulation members, in such a way that the passage cross section area of the refrigerant going from the flow regulation spaces towards the first spaces can be throttled.