Disclosed are a humidifier (20) for a respirator (10) and the respirator (10) comprising the humidifier (20). The humidifier (20) comprises a water receiving chamber (30) enclosed by a main body (31) and a bottom plate (32), the water receiving chamber (30) is divided into a gastight liquid reservoir chamber (34) and a heating chamber (35) communicated with exterior environment by a vertically disposed partition plate (33). A passage (39) for communicating the liquid reservoir chamber (34) and the heating chamber (35) is disposed adjacent to the bottom plate (32). A baffle (40) extending toward the bottom plate (32) from a top wall (53) of the main body (31) is disposed in the heating chamber (35), there is a gap between the baffle (40) and each of a circumferential sidewall of the heating chamber (35) and a level of liquid in the heating chamber (35). The baffle (40) comprises a first cylindrical portion (51) and a second cylindrical portion (52) connected with a circumferential outer sidewall of the first cylindrical portion (51), the first cylindrical portion (51) forms a gas outlet chamber (38), the second cylindrical portion (52) forms a gas inlet chamber (37) which is in communication with the gas outlet chamber (38). A circumferential sidewall of the baffle (40), the partition plate (33) and the top wall (53) collectively form a backflow tank. When the humidifier (20) and the respirator (10) are tilted, the water inside the humidifier (20) does not flow out.