A measuring device characterized by comprising: at least two magnetic sensors capable of selectively measuring a magnitude of a component in a specific direction of a magnetic field, the at least two magnetic sensors being arranged lined up in the specific direction, the specific direction being a specific single linear direction; acquiring means configured for repeatedly acquiring, at a plurality of timings, a measurement value indicating the magnitude of the magnetic field detected by each of the at least two magnetic sensors; first identifying means configured for identifying the measurement value having the largest absolute value, from among at least two measurement values acquired at a specific timing from each of the at least two magnetic sensors by the acquiring means; second identifying means configured for identifying a first magnetic sensor that has detected the measurement value having the largest absolute value identified by the first identifying means; and third identifying means configured for identifying, based on a time change in the measurement value acquired by the acquiring means, a distance in an orthogonal direction that is orthogonal to the specific direction, between an object to be measured and the first magnetic sensor identified by the second identifying means, characterized in that the third identifying means is configured to identify the distance based on a ratio of the larger of a time change in a second measurement value and a time change in a first measurement value to the smaller of the time change in the second measurement value and the time change in the first measurement value, and an interval in the specific direction between the first magnetic sensor and a second magnetic sensor, the first measurement value being the measurement value detected by the first magnetic sensor identified by the second identifying means, the second measurement value being the measurement value detected by the second magnetic sensor, the second magnetic sensor being adjacent to the first magnetic sensor. at least two magnetic sensors capable of selectively measuring a magnitude of a component in a specific direction of a magnetic field, the at least two magnetic sensors being arranged lined up in the specific direction, the specific direction being a specific single linear direction; acquiring means configured for repeatedly acquiring, at a plurality of timings, a measurement value indicating the magnitude of the magnetic field detected by each of the at least two magnetic sensors; first identifying means configured for identifying the measurement value having the largest absolute value, from among at least two measurement values acquired at a specific timing from each of the at least two magnetic sensors by the acquiring means; second identifying means configured for identifying a first magnetic sensor that has detected the measurement value having the largest absolute value identified by the first identifying means; and third identifying means configured for identifying, based on a time change in the measurement value acquired by the acquiring means, a distance in an orthogonal direction that is orthogonal to the specific direction, between an object to be measured and the first magnetic sensor identified by the second identifying means, characterized in that the third identifying means is configured to identify the distance based on a ratio of the larger of a time change in a second measurement value and a time change in a first measurement value to the smaller of the time change in the second measurement value and the time change in the first measurement value, and an interval in the specific direction between the first magnetic sensor and a second magnetic sensor, the first measurement value being the measurement value detected by the first magnetic sensor identified by the second identifying means, the second measurement value being the measurement value detected by the second magnetic sensor, the second magnetic sensor being adjacent to the first magnetic sensor. the first measurement value being the measurement value detected by the first magnetic sensor identified by the second identifying means, the second measurement value being the measurement value detected by the second magnetic sensor, the second magnetic sensor being adjacent to the first magnetic sensor.