A heat exchanger comprising: a plurality of heat transfer tubes arranged in multiple columns along a predetermined direction; and a header configured to retain first longitudinal end portions of the heat transfer tubes , the header including: a first member including a main wall portion having a plurality of through holes through each of which the first longitudinal end portion of an associated one of the heat transfer tubes passes; a second member defining a plurality of insertion spaces that each communicate with the first longitudinal end portion of at least one of the heat transfer tubes ; and a third member facing the first longitudinal end portions of the heat transfer tubes that have respectively passed through the through holes , wherein the second member includes: a pair of side plates defining the insertion spaces therebetween in a width direction of the header ; and at least one partition plate connected to the pair of side plates to separate the insertion spaces from each other, characterized in that the pair of side plates and the at least one partition plate of the second member each have two end surfaces that are respectively in contact with the main wall portion of the first member and the third member . a plurality of heat transfer tubes arranged in multiple columns along a predetermined direction; and a header configured to retain first longitudinal end portions of the heat transfer tubes , the header including: a first member including a main wall portion having a plurality of through holes through each of which the first longitudinal end portion of an associated one of the heat transfer tubes passes; a second member defining a plurality of insertion spaces that each communicate with the first longitudinal end portion of at least one of the heat transfer tubes ; and a third member facing the first longitudinal end portions of the heat transfer tubes that have respectively passed through the through holes , wherein the second member includes: a pair of side plates defining the insertion spaces therebetween in a width direction of the header ; and at least one partition plate connected to the pair of side plates to separate the insertion spaces from each other, characterized in that the pair of side plates and the at least one partition plate of the second member each have two end surfaces that are respectively in contact with the main wall portion of the first member and the third member . a first member including a main wall portion having a plurality of through holes through each of which the first longitudinal end portion of an associated one of the heat transfer tubes passes; a second member defining a plurality of insertion spaces that each communicate with the first longitudinal end portion of at least one of the heat transfer tubes ; and a third member facing the first longitudinal end portions of the heat transfer tubes that have respectively passed through the through holes , wherein the second member includes: a pair of side plates defining the insertion spaces therebetween in a width direction of the header ; and at least one partition plate connected to the pair of side plates to separate the insertion spaces from each other, characterized in that the pair of side plates and the at least one partition plate of the second member each have two end surfaces that are respectively in contact with the main wall portion of the first member and the third member . a pair of side plates defining the insertion spaces therebetween in a width direction of the header ; and at least one partition plate connected to the pair of side plates to separate the insertion spaces from each other, characterized in that the pair of side plates and the at least one partition plate of the second member each have two end surfaces that are respectively in contact with the main wall portion of the first member and the third member . <EOS>