An evaporator 1 includes a refrigerant inlet header section 5 and a refrigerant outlet header section 6 which are arranged in the front-rear direction, a refrigerant circulation passage for establishing fluid communication between the header sections 5 and 6. First ends of the header sections 5 and 6 are closed with a first cap 19 and the second ends thereof are closed with a second cap 18. A refrigerant inlet 37 and a refrigerant outlet are formed in the first cap 19. A pipe joint member 21, having a refrigerant inflow port 45 communicating with the refrigerant inlet 37 and a refrigerant outflow port 46 communicating with the refrigerant outlet 38, is joined to the first cap 19. Mating concave portions 19a and 19b are formed on the first cap 19. Mating convex portions 21a and 21b which project toward the first cap 19 and which are to be fitted into the mating concave portions 19a and 19b, respectively, are formed on the pipe joint member 21. The second cap 18 has no mating concave portions into which the mating convex portions 21a, 21b are fitted. The evaporator (1) to which the heat exchanger of the present invention is applied can prevent erroneous attachment of the pipe joint member during manufacture thereof.