A rollover prevention system for a construction machine, wherein the construction machine includes a work attachment such as a boom, an arm, or a bucket, a plurality of hydraulic cylinders (28, 33, 35) for driving the work attachment, and a swing motor for controlling a swing operation of an upper frame, the rollover prevention system comprising: a first angle detection unit disposed adj acent to a turning joint to detect a swing angle of the upper frame, the turning joint being disposed on a central portion of the upper frame rotatably disposed on an undercarriage; a second angle detection unit disposed on the upper frame to detect an angular movement of the upper frame; safety valves (40, 40a, 40b) disposed on flow passages communicating with the hydraulic cylinders for the work attachment and the swing motor, wherein the safety valves control flows of working oil supplied to the hydraulic cylinders by opening and closing the flow passages in response to external signals; and an electronic controller electrically connected to the first angle detection unit, the second angle detection unit, and the safety valves, the electronic controller comprising a barycenter calculating section, a safety range determining section, and a signal outputting section, wherein the barycenter calculating section calculates a barycenter B uc of the undercarriage, a barycenter B uf of the upper frame, a barycenter B at of the work attachment, a first barycenter B 1 of the construction machine in a first state, and a second barycenter B 2 of the construction machine in a second state, based on values of angles applied from the first angle detection unit and the second angle detection unit based on a preset algorithm, wherein the first barycenter B 1 of the construction machine depends on the first state in which the bucket is fully loaded at a farthest distance to the swing axis, while the second barycenter B 2 of the construction machine depending on the second state in which the bucket is not loaded at a closest distance G from the swing axis, and wherein the safety range determining section determines whether or not the first barycenter B 1 and the second barycenter B 2 of the construction machine are present in a safety range, wherein the signal outputting section provides a closing signal for the safety valves and an alarm signal to the operator when the first barycenter B 1 or the second barycenter B 2 of the construction machine deviate from the safety range. a first angle detection unit disposed adj acent to a turning joint to detect a swing angle of the upper frame, the turning joint being disposed on a central portion of the upper frame rotatably disposed on an undercarriage; a second angle detection unit disposed on the upper frame to detect an angular movement of the upper frame; safety valves (40, 40a, 40b) disposed on flow passages communicating with the hydraulic cylinders for the work attachment and the swing motor, wherein the safety valves control flows of working oil supplied to the hydraulic cylinders by opening and closing the flow passages in response to external signals; and an electronic controller electrically connected to the first angle detection unit, the second angle detection unit, and the safety valves, the electronic controller comprising a barycenter calculating section, a safety range determining section, and a signal outputting section, wherein the barycenter calculating section calculates a barycenter B uc of the undercarriage, a barycenter B uf of the upper frame, a barycenter B at of the work attachment, a first barycenter B 1 of the construction machine in a first state, and a second barycenter B 2 of the construction machine in a second state, based on values of angles applied from the first angle detection unit and the second angle detection unit based on a preset algorithm, wherein the first barycenter B 1 of the construction machine depends on the first state in which the bucket is fully loaded at a farthest distance to the swing axis, while the second barycenter B 2 of the construction machine depending on the second state in which the bucket is not loaded at a closest distance G from the swing axis, and wherein the safety range determining section determines whether or not the first barycenter B 1 and the second barycenter B 2 of the construction machine are present in a safety range, wherein the signal outputting section provides a closing signal for the safety valves and an alarm signal to the operator when the first barycenter B 1 or the second barycenter B 2 of the construction machine deviate from the safety range.