A heat exchanger comprising: a header (10, 10a, 10b, 10c, 10d) that extends in a first direction; and a plurality of heat transfer tubes that extend in a second direction crossing the first direction, each of which has one end connected to the header, and that are arranged in the first direction at intervals, wherein the header includes a header body (20, 20a, 20b, 20c, 20d) having a tubular shape, a first member (30, 30a, 30b, 30c, 30d) through which the one end of each of the heat transfer tubes extends, and a second member (40, 40a, 40d) positioned between the header body and the first member in the second direction and including a base portion that extends in the first direction, characterized in that the second member further includes a plurality of protruding portions that extend from the base portion toward the first member in the second direction, wherein a length in a third direction of a first space surrounded by the base portion and the protruding portions that are adjacent to each other, the third direction crossing the first direction and the second direction, is greater than a length of each of the heat transfer tubes in the third direction, wherein a communication hole (Ha) that allows the first space and an inner space of the header body to communicate with each other is formed in the base portion, wherein a part of an edge that forms the communication hole of the base portion, the part being positioned on the heat transfer tube side, is chamfered in such a way that, from the heat exchange unit side toward the header body side, the edge portion becomes narrower than the length in the width direction and/or the length in the thickness direction of the heat transfer tube. a header (10, 10a, 10b, 10c, 10d) that extends in a first direction; and a plurality of heat transfer tubes that extend in a second direction crossing the first direction, each of which has one end connected to the header, and that are arranged in the first direction at intervals, wherein the header includes a header body (20, 20a, 20b, 20c, 20d) having a tubular shape, a first member (30, 30a, 30b, 30c, 30d) through which the one end of each of the heat transfer tubes extends, and a second member (40, 40a, 40d) positioned between the header body and the first member in the second direction and including a base portion that extends in the first direction, a header body (20, 20a, 20b, 20c, 20d) having a tubular shape, a first member (30, 30a, 30b, 30c, 30d) through which the one end of each of the heat transfer tubes extends, and a second member (40, 40a, 40d) positioned between the header body and the first member in the second direction and including a base portion that extends in the first direction, characterized in that the second member further includes a plurality of protruding portions that extend from the base portion toward the first member in the second direction, wherein a length in a third direction of a first space surrounded by the base portion and the protruding portions that are adjacent to each other, the third direction crossing the first direction and the second direction, is greater than a length of each of the heat transfer tubes in the third direction, wherein a communication hole (Ha) that allows the first space and an inner space of the header body to communicate with each other is formed in the base portion, wherein a part of an edge that forms the communication hole of the base portion, the part being positioned on the heat transfer tube side, is chamfered in such a way that, from the heat exchange unit side toward the header body side, the edge portion becomes narrower than the length in the width direction and/or the length in the thickness direction of the heat transfer tube.