The present invention provides a gas generator, comprising a water tank (2) and an electrolysis device (3). The water tank has a first hollow portion (20) for containing electrolyzed water. The electrolysis device (3) is disposed inside the first hollow portion (20) of the water tank (2) for electrolyzing the electrolyzed water to generate a hydrogen-oxygen mixed gas. The electrolysis device (3) comprises an electrolysis tank (32), a plurality of electrodes (34) and a pad (36). A plurality of orifices (360) in the pad (36) are connected with the first hollow portion (20) through a first channel (370) in an upper cover body (37). When the electrolysis device (3) starts to electrolyze the electrolyzed water, the first hollow portion (20) of the water tank is filled with the electrolyzed water for standing at a full level of water. And after the electrolysis device electrolyzed the electrolyzed water, the level of water for the electrolyzed water filled into the first hollow portion of the water tank is higher than 95% of the full level of water. The gas generator of the present invention provides the design for saving space, for providing no gas space to reduce the possibility of explosions resulting from hydrogen-oxygen mixed gas, and for decreasing the temperature of the electrolysis device. Moreover, a gas generator comprising an electrolysis device and a condense filter for filtering impurities from the hydrogen-oxygen mixed gas is disclosed. A further gas generator encompasses an electrolysis device and a humidification device.