The invention discloses a breathing machine and a humidifier device thereof. The humidifier device comprises a humidifying tank and a breather pipe assembly. The humidifying tank is provided with a through hole, the through hole is used for being communicated with a main machine of the breathing machine, and the humidifying tank is used for storing liquid. The breather pipe assembly comprises a breather pipe and a first mounting part, one end of the breather pipe is in butt joint with the through hole, and the other end of the breather pipe extends into the humidifying tank. The breather pipe is connected with the first mounting part, the humidifying tank is provided with a second mounting part, and the first mounting part is detachably connected with the second mounting part. Due to the fact that the first mounting part and the second mounting part are detachably connected, when the humidifying tank needs to be cleaned, the first mounting part and the second mounting part can be detached, then the ventilation pipe assembly and the humidifying tank are separated, cleaning dead corners formed between the ventilation pipe assembly and the humidifying tank can be cleaned, and the possibility that the humidifying tank is not thoroughly cleaned, and consequently germs are bred is reduced. Therefore, the safety of the breathing machine is improved.