Disclosed are a humidifier (20) for a respirator (10) and the respirator (10) comprising the humidifier (20). The humidifier (20) comprises a water-containing cavity (30) enclosed by a main body (31) and a bottom plate (32), wherein the water-containing cavity (30) is partitioned into an airtight liquid storage cavity (34) and a heating cavity (35) in communication with the outside by means of a partition plate (33) vertically arranged in the water-containing cavity. The partition plate (33) is provided with a channel (39), wherein the channel (39) is arranged to be adjacent to the bottom plate (32) and communicate the liquid storage cavity (34) and the heating cavity (35). A top wall (53) of the main body (31) is configured with a baffle (40) extending towards the bottom plate (32) in the heating cavity (35), wherein both the circumferential side wall of the heating cavity (35) and the liquid level in the heating cavity (35) are spaced apart from the baffle (40). The baffle (40) comprises a first cylindrical portion (51) and a second cylindrical portion (52) connected to the outer peripheral side wall of the first cylindrical portion (51), wherein the first cylindrical portion (51) forms an air outlet chamber (38) and the second cylindrical portion (52) forms an air inlet chamber (37) in communication with the air outlet chamber (38). The circumferential side wall of the baffle (40), the partition plate (33) and the top wall (53) form a backflow groove (54) together. In this way, when tilted, water in the humidifier (20) and the respirator (10) does not flow out.Linvention a pour objet un humidificateur (20) pour machine respiratoire (10) et une machine respiratoire (10) équipée dudit humidificateur. Lhumidificateur (20) comprend une chambre de réception deau (30), entourée par un corps principal (31) et une plaque de base (32), qui est disposée verticalement dans une cavité réservoir (34) hermétique séparée par un séparateur (33) et dans une cavité chauffante (35)