A mask with sterilization function is provided. The mask comprises two straps, a mask body, a functional layer, a first electrode, a second electrode, and a power inlet. The functional layer, the first electrode and the second electrode located in the mask body. The first electrode and the second electrode are located on a surface of the functional layer and are electrically connected to the power inlet. The first electrode and the second electrode are configured to input a current to the functional layer to heat the functional layer. The functional layer is a conductive layer and comprises a plurality of micropores.