The invention discloses a terminal sliding mode control method for an active power filter, and the method comprises the following steps: S1, establishing a single-phase active power filter mathematical model, defining a state variable i as x, and obtaining an expression of a second derivative of x; S2, defining a tracking error and a first derivative thereof, defining a terminal sliding mode surface to obtain an equivalent control item, then defining a switching control item, and adding the equivalent control item and the switching control item to obtain a terminal sliding mode controller; S3, approximating the equivalent control item by using a double-hidden-layer recurrent neural network. According to the invention, the method can maintain the stability of an original controller, can simplify the control law, can achieve the better control precision, effectively reduces the distortion rate of power grid current, and improves the active power filter compensation effect.