A spectral module comprising: a substrate (2, 32) for transmitting light incident thereon from one surface; a light transmitting unit, disposed on the other surface (2b, 32b, 42b) side of the substrate (2, 32, 42), for transmitting the light incident on the substrate; a spectroscopic unit, formed with the light transmitting unit, for reflecting and spectrally resolving the light incident on the light transmitting unit; and a photodetector, disposed on the one surface side of the substrate, for detecting the light spectrally resolved by the spectroscopic unit; wherein the other surface (2b, 32b, 42b) is provided with a recess (19, 33, 43), adapted to mate with the light transmitting unit through an optical resin agent, transmissive for the light (L1, L2) and for bonding the light transmitting unit to the substrate, the recess (19, 33, 43) having a predetermined positional relationship with a reference unit (12a, 12b, 12c, 12d) for positioning the photodetector with respect to the substrate; wherein the recess (19, 33) is provided with a first mating section (22, 35a, 45a) adapted to mate with the light transmitting unit in an extending direction of a grating groove of the spectroscopic unit and a second mating section (22, 35b, 45b) adapted to mate with the light transmitting unit in a direction substantially orthogonal to the extending direction of the grating groove; and wherein the second mating section (22, 35b) and the light transmitting unit have a gap therebetween smaller than that between the first mating section (22, 35a) and the light transmitting unit, whereby the alignment between the light transmitting unit and photodetector is effected precisely in a direction substantially orthogonal to the extending direction of the grating grooves, and the excess of resin and air can effectively be released through the gap in the extending direction of the grating grooves when bonding the light transmitting unit to the substrate with the optical resin agent. a substrate (2, 32) for transmitting light incident thereon from one surface; a light transmitting unit, disposed on the other surface (2b, 32b, 42b) side of the substrate (2, 32, 42), for transmitting the light incident on the substrate; a spectroscopic unit, formed with the light transmitting unit, for reflecting and spectrally resolving the light incident on the light transmitting unit; and a photodetector, disposed on the one surface side of the substrate, for detecting the light spectrally resolved by the spectroscopic unit; wherein the other surface (2b, 32b, 42b) is provided with a recess (19, 33, 43), adapted to mate with the light transmitting unit through an optical resin agent, transmissive for the light (L1, L2) and for bonding the light transmitting unit to the substrate, the recess (19, 33, 43) having a predetermined positional relationship with a reference unit (12a, 12b, 12c, 12d) for positioning the photodetector with respect to the substrate; wherein the recess (19, 33) is provided with a first mating section (22, 35a, 45a) adapted to mate with the light transmitting unit in an extending direction of a grating groove of the spectroscopic unit and a second mating section (22, 35b, 45b) adapted to mate with the light transmitting unit in a direction substantially orthogonal to the extending direction of the grating groove; and wherein the second mating section (22, 35b) and the light transmitting unit have a gap therebetween smaller than that between the first mating section (22, 35a) and the light transmitting unit, whereby the alignment between the light transmitting unit and photodetector is effected precisely in a direction substantially orthogonal to the extending direction of the grating grooves, and the excess of resin and air can effectively be released through the gap in the extending direction of the grating grooves when bonding the light transmitting unit to the substrate with the optical resin agent.