A hydraulic device comprising: a tool unit having a hydraulic pump for generating pressure oil by rotation of a rotary member, a first rotary shaft connected to the rotary member, and a tool that operates by the pressure oil generated by the hydraulic pump; and a driving unit having a motor for driving rotation of the rotary member of the hydraulic pump, and a second rotary shaft rotated by the motor, the driving unit being detachably mounted to the tool unit; wherein a connected portion (68, 68m) is disposed at an end of one of the first rotary shaft of the tool unit and the second rotary shaft of the driving unit, and a connecting portion (52, 52m) which is connected to the connected portion (68, 68m) is disposed at an end of the other thereof; characterized in that: the connected portion (68, 68m) has a guide shaft that rotates integrally with the first rotary shaft or the second rotary shaft, and a plurality of engaged portions (68b, 68p) disposed around the guide shaft, and the connecting portion (52, 52m) has a guide hole into which the guide shaft is inserted, and engaging portions (52b, 52q) with which the engaged portions (68b, 68p) are engaged and which are disposed around the guide hole; wherein the engaged portions (68b, 68p) are projections (68b, 68p), and the engaging portions (52b, 52q) are recesses (52b, 52q) into which the projections (68b, 68p) fit, wherein a tip of each projection (68b, 68p) is tilted relative to a longitudinal direction of the guide shaft, and is tilted relative to a surface orthogonal to the longitudinal direction of the guide shaft, and wherein a projection (68b, 68p) is disposed between the recesses (52b, 52q), and a tip of the projection (68b, 68p) is tilted relative to a longitudinal direction of the guide hole, and is tilted relative to a surface orthogonal to the longitudinal direction of the guide hole. a tool unit having a hydraulic pump for generating pressure oil by rotation of a rotary member, a first rotary shaft connected to the rotary member, and a tool that operates by the pressure oil generated by the hydraulic pump; and a driving unit having a motor for driving rotation of the rotary member of the hydraulic pump, and a second rotary shaft rotated by the motor, the driving unit being detachably mounted to the tool unit; wherein a connected portion (68, 68m) is disposed at an end of one of the first rotary shaft of the tool unit and the second rotary shaft of the driving unit, and a connecting portion (52, 52m) which is connected to the connected portion (68, 68m) is disposed at an end of the other thereof; the connected portion (68, 68m) has a guide shaft that rotates integrally with the first rotary shaft or the second rotary shaft, and a plurality of engaged portions (68b, 68p) disposed around the guide shaft, and the connecting portion (52, 52m) has a guide hole into which the guide shaft is inserted, and engaging portions (52b, 52q) with which the engaged portions (68b, 68p) are engaged and which are disposed around the guide hole; wherein the engaged portions (68b, 68p) are projections (68b, 68p), and the engaging portions (52b, 52q) are recesses (52b, 52q) into which the projections (68b, 68p) fit, wherein a tip of each projection (68b, 68p) is tilted relative to a longitudinal direction of the guide shaft, and is tilted relative to a surface orthogonal to the longitudinal direction of the guide shaft, and wherein a projection (68b, 68p) is disposed between the recesses (52b, 52q), and a tip of the projection (68b, 68p) is tilted relative to a longitudinal direction of the guide hole, and is tilted relative to a surface orthogonal to the longitudinal direction of the guide hole.