An air fryer with a steaming function includes a cooking chamber and a water tank arranged inside a housing. A steam generator is also arranged in the air fryer. A heating chamber is provided in the steam generator. The heating chamber in the steam generator is connected to a water tank via a water pump. High-temperature steam produced in the heating chamber of the steam generator is introduced into the cooking chamber. The steam generator is equipped with an over-temperature protector and a temperature sensor. Each of the over-temperature protector, the temperature sensor, the water pump, and the steam generator is electrically connected to the controller.