A shape sensor comprises a shape sensor main body which comprises an optical fiber capable, a detection object section, and a light detecting section to detect the detection light and which is capable of measuring a shape of a measurement target object by utilizing a change in characteristics of the light detected through the detection object section in accordance with a change in curvature of the optical fiber when the optical fiber curves and a curving direction regulating section which is provided on at least a part of the optical fiber along an optical axis thereof and regulates a curvable direction of the optical fiber to a desired direction wherein the curving direction regulating section is a core member which is disposed in at least a part of the shape sensor main body along the light propagating direction of the optical fiber and whose main curving direction is regulated.