A grass trimmer includes a trimming head, a driving device for driving the trimming head to rotate so as to cut vegetation and an operating device for a user to operate so as to control the driving device. The trimming head includes a spool and a line holding member, the spool is used to wind a cutting line, and the line holding member is formed with a line holding structure. The driving device includes a motor. The grass trimmer has an auto-winding mode. In the auto-winding mode, the motor drives at least one of the spool and the line holding member to make the spool and the line holding member rotate relatively so that the cutting line is wound on the spool automatically.