Disclosed is a heat exchanger wherein a first heat exchanging unit has a first heat transfer tube in which a refrigerant flows, and a first fin, which is planarly formed, and into which the first heat transfer tube is inserted. The first heat transfer tube has a first heat transfer tube end portion facing a second heat exchanging unit. The first fin has a first fin end portion facing the second heat exchanging unit. A first distance between the first heat transfer tube end portion and the second heat exchanging unit is equal to a second distance between the first fin end portion and the second heat exchanging unit or shorter than the second distance.