Electronic spindle lock for a power tool. One embodiment provides a power tool including a housing, a bit receiving portion provided on the housing for receiving a power tool bit, a motor within the housing configured to rotate the bit receiving portion, and a controller coupled to the motor. The controller is configured to enter an electronic spindle lock mode, and detect rotation of the bit receiving portion in a first direction. The controller is also configured to control motor to rotate in a second direction in response to detecting rotation of the bit receiving portion in the first direction.