A stroke amount detecting device includes a first magnetic field generation member (21, 25), a second magnetic field generation member (22, 26), and a magnetic sensor unit (7, 8). The first magnetic field generation member (21, 25) and the second magnetic field generation member (22, 26) are opposed to each other with respect to a direction perpendicular to a straight stroking axis of a stroking object, and magnetized in opposite directions. The magnetic sensor unit (7, 8) is movable in an area between the first magnetic field generation member (21, 25) and the second magnetic field generation member (22, 26), along a straight traveling axis (X) that is parallel to the straight stroking axis relative to the first magnetic field generation member (21, 25) and the second magnetic field generation member (22, 26) in accordance with a stroke motion of the stroking object. The magnetic sensor unit (7, 8) has a magnetosensitive surface (5a, 6a) facing a direction parallel to the traveling axis (X), thereby to detect an amount of stroke of the object.