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 use in controlling the driving device. The trimming head includes a spool and a line holding element 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 element to make the spool and the line holding element rotate relatively so that a trimming line is wound on the spool automatically.