A work machine comprising: a work device; a hydraulic cylinder driven by a hydraulic operating oil delivered from a hydraulic pump thereby driving the work device; an operation device (1a-1d) that gives instructions on operations of the hydraulic cylinder according to operation by an operator; and a controller configured to calculate respective target velocities of the hydraulic cylinder for moving a plurality of work point candidates (8a, 8b) along an optionally set target surface, the work point candidates (8a, 8b) being set to the work device, on a basis of positional data of the target surface, posture data of the work device, and operation data of the operation device (1a-1d), and control a velocity of the hydraulic cylinder according to one of a plurality of the calculated target velocities; characterized in that the controller calculates at least one candidate point velocity (VTab, VTba) that occurs at least one remaining work point candidate among the plurality of work point candidates (8a, 8b) in a case where each of the plurality of work point candidates (8a, 8b) is moved at a corresponding target velocity among the plurality of target velocities (VTa, VTb), creates a plurality of velocity groups by grouping the at least one candidate point velocity (VTab, VTba) for each of the plurality of work point candidates (8a, 8b), selects one velocity group from among the plurality of work point candidates (8a, 8b), the one velocity group in which all of the plurality of work point candidates (8a, 8b) are least likely to perform an operation of entering the target surface, and controls the hydraulic cylinder according to a target velocity, among the plurality of target velocities (VTa, VTb), of a work point candidate associated with the selected one velocity group. a work device; a hydraulic cylinder driven by a hydraulic operating oil delivered from a hydraulic pump thereby driving the work device; an operation device (1a-1d) that gives instructions on operations of the hydraulic cylinder according to operation by an operator; and a controller configured to calculate respective target velocities of the hydraulic cylinder for moving a plurality of work point candidates (8a, 8b) along an optionally set target surface, the work point candidates (8a, 8b) being set to the work device, on a basis of positional data of the target surface, posture data of the work device, and operation data of the operation device (1a-1d), and control a velocity of the hydraulic cylinder according to one of a plurality of the calculated target velocities; calculates at least one candidate point velocity (VTab, VTba) that occurs at least one remaining work point candidate among the plurality of work point candidates (8a, 8b) in a case where each of the plurality of work point candidates (8a, 8b) is moved at a corresponding target velocity among the plurality of target velocities (VTa, VTb), creates a plurality of velocity groups by grouping the at least one candidate point velocity (VTab, VTba) for each of the plurality of work point candidates (8a, 8b), selects one velocity group from among the plurality of work point candidates (8a, 8b), the one velocity group in which all of the plurality of work point candidates (8a, 8b) are least likely to perform an operation of entering the target surface, and controls the hydraulic cylinder according to a target velocity, among the plurality of target velocities (VTa, VTb), of a work point candidate associated with the selected one velocity group.