A shape measuring apparatus configured to measure a shape of a target object by applying white light to the target object and using reflected light from the target object, the shape measuring apparatus comprising: a light source configured to output the white light; a two-beam interference objective lens configured to divide the white light into two light beams, apply one of the two light beams to the target object and the other light beam to a reference surface, and cause interference between the reflected light from the target object and reflected light from the reference surface to output interference light; an imaging device configured to obtain an image of the interference light output from the two-beam interference objective lens; an observation optical system configured to guide the white light output from the light source to a surface of the target object through the two-beam interference objective lens and guide the reflected light from the surface to the imaging device through the two-beam interference objective lens; a positioning device configured to move the two-beam interference objective lens relative to the target object; and a control device configured to obtain a plurality of images while changing a distance between the target object and the two-beam interference objective lens in an optical axis direction of the two-beam interference objective lens, and measure the shape of the target object using the plurality of images, the control device being configured to for each unit region in the plurality of images, calculate, as a focus position of the unit region, a position of the two-beam interference objective lens at which a luminance-based evaluation value is maximized over the plurality of images, and measure the shape of the target object based on the focus position of each unit region in the plurality of images, and use, as the evaluation value, a luminance of each unit region in the plurality of images as well as a value correlated with a difference between the luminance of the unit region and luminances of a plurality of unit regions adjacent to the unit region, characterized in that the control device is configured to use the luminance as the evaluation value when a maximum value of the luminance of each unit region in the plurality of images is greater than a threshold value, and use the value correlated with the difference as the evaluation value when the maximum value is smaller than the threshold value. a light source configured to output the white light; a two-beam interference objective lens configured to divide the white light into two light beams, apply one of the two light beams to the target object and the other light beam to a reference surface, and cause interference between the reflected light from the target object and reflected light from the reference surface to output interference light; an imaging device configured to obtain an image of the interference light output from the two-beam interference objective lens; an observation optical system configured to guide the white light output from the light source to a surface of the target object through the two-beam interference objective lens and guide the reflected light from the surface to the imaging device through the two-beam interference objective lens; a positioning device configured to move the two-beam interference objective lens relative to the target object; and a control device configured to obtain a plurality of images while changing a distance between the target object and the two-beam interference objective lens in an optical axis direction of the two-beam interference objective lens, and measure the shape of the target object using the plurality of images, the control device being configured to for each unit region in the plurality of images, calculate, as a focus position of the unit region, a position of the two-beam interference objective lens at which a luminance-based evaluation value is maximized over the plurality of images, and measure the shape of the target object based on the focus position of each unit region in the plurality of images, and use, as the evaluation value, a luminance of each unit region in the plurality of images as well as a value correlated with a difference between the luminance of the unit region and luminances of a plurality of unit regions adjacent to the unit region, characterized in that the control device is configured to use the luminance as the evaluation value when a maximum value of the luminance of each unit region in the plurality of images is greater than a threshold value, and use the value correlated with the difference as the evaluation value when the maximum value is smaller than the threshold value.