A string trimmer includes: a housing; a line container, configured to accommodate a trimmer line, and an end of the trimmer line extending out of the line container; a motor, configured to drive the line container to rotate to perform cutting work; a start switch, configured to generate a start signal according to an operation of a user, to control the motor to start or stop; a release mechanism, capable of selectively releasing the trimmer line, to increase the length of the trimmer line that has extended out of the line container; and a calculation unit, configured to respond to a release signal to calculate the usage and/or remainder of the trimmer line. In the embodiments of the present disclosure, the calculation unit configured to calculate the usage and/or remainder of the trimmer line is disposed in the string trimmer. In this way, when currently the usable amount of the trimmer line in the string trimmer is relatively small, the user can be reminded to change the trimmer line in time, thereby reducing the waste of time and labor during use because the trimmer line is used up.