This paper reports on a method to measure spring constant of hydrogel microparticles by a MEMS sensor. For calculating spring constant, not only force but also displacement is necessary. The MEMS sensor consists of two sidewall doped piezoresistive cantilevers in the ranges of μΝ and μm so that both parameters can be measured simultaneously. When one cantilever pushes a target to a wall, the cantilever can measure the restoring force of the target. At the same time, the other cantilever measures the displacement by pushing the wall directly. By measuring both force and displacement on the same sensor chip, the spring constant of targets can be obtained only from the sensor outputs, which makes the sensor system simple and compact. With this advantage, our method can be useful in actual experiments with microscopes and other systems.