A rotary actuator for producing rotation, and comprising; a frame; one output shaft; at least a first rotation unit and a second rotation unit, which are series connected regarding the produced rotation; the first rotation unit comprising a first pressure medium cylinder for providing a first axial movement and a first converting arrangement for converting the first axial movement to a first angular displacement (Rs); the second rotation unit comprising a second pressure medium cylinder for providing a second axial movement and a second converting arrangement for converting the second axial movement to a second angular displacement (Rs); control means for directing a pressure medium selectively to the pressure medium cylinders (3a, 3b) of the rotation units (2a, 2b) for operating the selected rotation units (2a, 2b) individually for producing the stepped angular displacements (Rs); and transmission means for transmitting the produced stepped angular displacements (Rs) of the rotation units (2a, 2b) to the output shaft, whereby the rotation of the output shaft is an outcome of the stepped angular displacements (Rs) produced by the at least two selectively controlled rotation units (2a, 2b), wherein the pressure medium cylinders (3a, 3b) of the at least first rotation unit and second rotation unit are provided each with two fixed operational positions, an extreme shortened first operational position and an extended second operational position, each of the pressure medium cylinders (3a, 3b) of the at least first rotation unit and second rotation unit being without any intermediate positions between the extreme shortened first and the extended second operational positions, and wherein the operation of the pressure medium cylinders (3a, 3b) of the at least first and second rotation units (2a, 2b) is independently controlled, characterized in that each of the pressure medium cylinders (3a, 3b) of the at least first and second rotation units (2a, 2b) is configured to produce only two stepped angular displacements, whereby total number of possible angular displacements of the output shaft of the rotary actuator is determined by formula 2 n, wherein n is number of pressure medium cylinders (3a, 3b) of the at least first and second rotation units (2a, 2b) of the rotary actuator. a frame; one output shaft; at least a first rotation unit and a second rotation unit, which are series connected regarding the produced rotation; the first rotation unit comprising a first pressure medium cylinder for providing a first axial movement and a first converting arrangement for converting the first axial movement to a first angular displacement (Rs); the second rotation unit comprising a second pressure medium cylinder for providing a second axial movement and a second converting arrangement for converting the second axial movement to a second angular displacement (Rs); control means for directing a pressure medium selectively to the pressure medium cylinders (3a, 3b) of the rotation units (2a, 2b) for operating the selected rotation units (2a, 2b) individually for producing the stepped angular displacements (Rs); and transmission means for transmitting the produced stepped angular displacements (Rs) of the rotation units (2a, 2b) to the output shaft, whereby the rotation of the output shaft is an outcome of the stepped angular displacements (Rs) produced by the at least two selectively controlled rotation units (2a, 2b), wherein the pressure medium cylinders (3a, 3b) of the at least first rotation unit and second rotation unit are provided each with two fixed operational positions, an extreme shortened first operational position and an extended second operational position, each of the pressure medium cylinders (3a, 3b) of the at least first rotation unit and second rotation unit being without any intermediate positions between the extreme shortened first and the extended second operational positions, and wherein the operation of the pressure medium cylinders (3a, 3b) of the at least first and second rotation units (2a, 2b) is independently controlled, characterized in that each of the pressure medium cylinders (3a, 3b) of the at least first and second rotation units (2a, 2b) is configured to produce only two stepped angular displacements, whereby total number of possible angular displacements of the output shaft of the rotary actuator is determined by formula 2 n, wherein n is number of pressure medium cylinders (3a, 3b) of the at least first and second rotation units (2a, 2b) of the rotary actuator.