A work machine comprising: a work tool; a plurality of actuators (2a, 4a, 5a, 6c) including at least one position control actuator (2a, 4a, 5a) that controls a position of the work tool and at least one posture control actuator that controls posture of the work tool, wherein the posture control actuator is a rotary motor that rotates the work tool; an operation device that instructs the plurality of actuators (2a, 4a, 5a, 6c) about operations of the actuators (2a, 4a, 5a, 6c); a controller that outputs a control signal for controlling at least one of the plurality of actuators (2a, 4a, 5a, 6c) on a basis of an operation amount of the operation device; and a design surface storage device that stores information concerning design surfaces including a plurality of target surfaces (S1, S2, S3), the controller being configured to extract a first target surface which is a target surface nearest to the work tool, from among the plurality of target surfaces (S1, S2, S3), and control an operation velocity of at least one actuator of the plurality of actuators (2a, 4a, 5a, 6c) on a basis of the position and posture of the work tool relative to the first target surface, in which the controller is configured to: extract a second target surface which is a target surface adjacent to the first target surface, from among the plurality of target surfaces (S1, S2, S3), calculate a first boundary line which is a boundary line between the first target surface and the second target surface, and prior to the work tool passing the first boundary line, correct a rotational angle of the rotary motor such that the angular difference between a reference line set on the work tool and the first boundary line becomes small so that at the time when the work tool passes the first boundary line, a line contact state between the work tool and each of the target surfaces and is maintained. a work tool; a plurality of actuators (2a, 4a, 5a, 6c) including at least one position control actuator (2a, 4a, 5a) that controls a position of the work tool and at least one posture control actuator that controls posture of the work tool, wherein the posture control actuator is a rotary motor that rotates the work tool; an operation device that instructs the plurality of actuators (2a, 4a, 5a, 6c) about operations of the actuators (2a, 4a, 5a, 6c); a controller that outputs a control signal for controlling at least one of the plurality of actuators (2a, 4a, 5a, 6c) on a basis of an operation amount of the operation device; and a design surface storage device that stores information concerning design surfaces including a plurality of target surfaces (S1, S2, S3), the controller being configured to extract a first target surface which is a target surface nearest to the work tool, from among the plurality of target surfaces (S1, S2, S3), and control an operation velocity of at least one actuator of the plurality of actuators (2a, 4a, 5a, 6c) on a basis of the position and posture of the work tool relative to the first target surface, in which the controller is configured to: extract a second target surface which is a target surface adjacent to the first target surface, from among the plurality of target surfaces (S1, S2, S3), calculate a first boundary line which is a boundary line between the first target surface and the second target surface, and prior to the work tool passing the first boundary line, correct a rotational angle of the rotary motor such that the angular difference between a reference line set on the work tool and the first boundary line becomes small so that at the time when the work tool passes the first boundary line, a line contact state between the work tool and each of the target surfaces and is maintained. extract a second target surface which is a target surface adjacent to the first target surface, from among the plurality of target surfaces (S1, S2, S3), calculate a first boundary line which is a boundary line between the first target surface and the second target surface, and prior to the work tool passing the first boundary line, correct a rotational angle of the rotary motor such that the angular difference between a reference line set on the work tool and the first boundary line becomes small so that at the time when the work tool passes the first boundary line, a line contact state between the work tool and each of the target surfaces and is maintained.