A sewing machine comprising: a main shaft which is rotated by a motor to move a sewing needle up and down; a position detecting means (14, 15) for detecting a rotation angle of the main shaft as a main shaft angle; a thread cutting mechanism having a movable knife configured to capture a sewing thread and to cut the sewing thread; a thread cutting cam having a cam groove formed along a circumferential direction of the thread cutting cam and rotating in synchronization with the rotation of the main shaft; a cam follower configured to engage with and disengage from the cam groove of the thread cutting cam and to move the movable knife in accordance with the cam groove while engaging with the cam groove; a thread cutting actuator which switches the cam follower between an engaging position and a disengaging position with respect to the thread cutting cam; a control means for controlling the thread cutting actuator and the motor, and a speed setting means for setting the rotation speed (v1, v2) of the motor for the thread cutting operation, characterized in that the control means comprises an operation timing determining means for determining an operation start timing of the thread cutting actuator or the motor, based on at least one of a rotation speed (v1, v2) of the motor for a thread cutting operation and a main shaft stopped angle (θ1) at which the main shaft has stopped immediately before the thread cutting operation, and wherein the operation timing determining means determines an operation angle (θ3) as the operation start timing of the thread cutting actuator, based on the rotation speed set by the speed setting means, such that the operation of the thread cutting actuator to switch the cam follower to the engaging position is completed at a target main shaft angle, and starts the operation of the thread cutting actuator when the main shaft angle reaches the operation angle (θ3). a main shaft which is rotated by a motor to move a sewing needle up and down; a position detecting means (14, 15) for detecting a rotation angle of the main shaft as a main shaft angle; a thread cutting mechanism having a movable knife configured to capture a sewing thread and to cut the sewing thread; a thread cutting cam having a cam groove formed along a circumferential direction of the thread cutting cam and rotating in synchronization with the rotation of the main shaft; a cam follower configured to engage with and disengage from the cam groove of the thread cutting cam and to move the movable knife in accordance with the cam groove while engaging with the cam groove; a thread cutting actuator which switches the cam follower between an engaging position and a disengaging position with respect to the thread cutting cam; a control means for controlling the thread cutting actuator and the motor, and a speed setting means for setting the rotation speed (v1, v2) of the motor for the thread cutting operation, characterized in that the control means comprises an operation timing determining means for determining an operation start timing of the thread cutting actuator or the motor, based on at least one of a rotation speed (v1, v2) of the motor for a thread cutting operation and a main shaft stopped angle (θ1) at which the main shaft has stopped immediately before the thread cutting operation, and wherein the operation timing determining means determines an operation angle (θ3) as the operation start timing of the thread cutting actuator, based on the rotation speed set by the speed setting means, such that the operation of the thread cutting actuator to switch the cam follower to the engaging position is completed at a target main shaft angle, and starts the operation of the thread cutting actuator when the main shaft angle reaches the operation angle (θ3).