A 3D (Three-Dimensional) printing machine capable of being automatically cleaned comprises a top plate, a bottom plate, a left baffle plate, a right baffle plate, a bearing platform, a first motor, asecond motor, a drum, a rotating shaft, a cross shaft, a printing head, a feeding pipe, a material tank and a control device, wherein two ends of the top plate are respectively connected with the leftbaffle plate and the right baffle plate; two ends of the bottom plate are respectively connected with the left baffle plate and the right baffle plate; the bearing platform is arranged on the bottomplate; the drum penetrates through the top plate and is connected with the first motor arranged on the top plate; the second motor is fixedly arranged on the drum; one end, which penetrates through the drum, of the rotating shaft is connected with an output shaft gear of the second motor; the other end of the rotating shaft is fixedly connected with one end of the cross shaft; the printing head ismovably connected with the cross shaft; the printing head can slide along the cross shaft; the material tank is arranged on the top plate; the material tank is used for feeding materials to the printing head through the feeding pipe; the control device is electrically connected with the first motor, the second motor, the printing head and the material tank.