1. A shape measuring method for measuring a surface to be measured which is formed based on a design shape having multiple periodical design level differences, by using a probe to scan, the shape measuring method comprising: a measuring step of scanning the surface to be measured with the probe to obtain multiple measuring points; a level difference specifying step of specifying, from the multiple measuring points, multiple level difference regions in which multiple level differences exist respectively on the surface to be measured and a height of each of the multiple level differences; a target data generating step of moving, among multiple no level difference regions outside the multiple level difference regions, multiple measuring points of one of a pair of no level difference regions adjacent to each other on both sides of each of the multiple level difference regions by the height of the each of the multiple level differences, so as to adjust heights of the multiple measuring points in the one of the pair of no level difference regions to heights of the multiple measuring points in another one of the pair of no level difference regions, to thereby obtain fitting target data; a reference shape obtaining step of obtaining a reference shape without the multiple design level differences from the design shape; and a fitting step of performing fitting between the fitting target data and the reference shape, wherein the shape of the surface to be measured is measured by determining a residual between the fitting target data and the reference shape after the fitting.