A work machine comprising: a vehicle main body; a work device attached to the vehicle main body; an operation signal sensor (9a, 9b) configured to detect an operation signal for driving the work device; a control system including an obstacle position calculating section configured to detect an obstacle present on a periphery of the work machine having the vehicle main body and the work device, and compute a relative position of the detected obstacle relative to the work machine; and a work mode selecting device configured to select a work mode of the work machine; the control system including a work determining section configured to determine, on the basis of a detection result of the operation signal sensor (9a, 9b), whether work contents of the work mode selected by the work mode selecting device is performed as work contents of the work machine, a minimum alarm region determining section configured to select one minimum alarm region corresponding to the work mode from three minimum alarm regions preset on the periphery of the work machine when the work mode other than a standard mode is selected by the work mode selecting device, and the work determining section determines that the work contents selected by the work mode selecting device is performed, and an alarm determining section configured to output an alarm signal to an alarming device when the relative position of the obstacle relative to the work machine, the relative position being computed by the obstacle position calculating section, is inside an alarm region set so as to include the minimum alarm region determined by the minimum alarm region determining section. a vehicle main body; a work device attached to the vehicle main body; an operation signal sensor (9a, 9b) configured to detect an operation signal for driving the work device; a control system including an obstacle position calculating section configured to detect an obstacle present on a periphery of the work machine having the vehicle main body and the work device, and compute a relative position of the detected obstacle relative to the work machine; and a work mode selecting device configured to select a work mode of the work machine; the control system including a work determining section configured to determine, on the basis of a detection result of the operation signal sensor (9a, 9b), whether work contents of the work mode selected by the work mode selecting device is performed as work contents of the work machine, a minimum alarm region determining section configured to select one minimum alarm region corresponding to the work mode from three minimum alarm regions preset on the periphery of the work machine when the work mode other than a standard mode is selected by the work mode selecting device, and the work determining section determines that the work contents selected by the work mode selecting device is performed, and an alarm determining section configured to output an alarm signal to an alarming device when the relative position of the obstacle relative to the work machine, the relative position being computed by the obstacle position calculating section, is inside an alarm region set so as to include the minimum alarm region determined by the minimum alarm region determining section. a work determining section configured to determine, on the basis of a detection result of the operation signal sensor (9a, 9b), whether work contents of the work mode selected by the work mode selecting device is performed as work contents of the work machine, a minimum alarm region determining section configured to select one minimum alarm region corresponding to the work mode from three minimum alarm regions preset on the periphery of the work machine when the work mode other than a standard mode is selected by the work mode selecting device, and the work determining section determines that the work contents selected by the work mode selecting device is performed, and an alarm determining section configured to output an alarm signal to an alarming device when the relative position of the obstacle relative to the work machine, the relative position being computed by the obstacle position calculating section, is inside an alarm region set so as to include the minimum alarm region determined by the minimum alarm region determining section.