A shape calculating apparatus includes a light source and a light guide provided with detection targets to decrease quantity of light guided by the light guide according to a bend shape of the light guide. The apparatus also includes a light detector to detect light quantity information in wavelengths included in light absorption spectra of the detection targets, a calculation unit that makes a calculation relating to a shape of each detection target based on the light quantity information, and a control unit that changes a dynamic range of at least one of an intensity of light input to the light guide and a detection signal output by the light detector for each wavelength range so that a magnitude of the detection signal is within a range between a lower limit threshold and an upper limit threshold of the light detector.