Abstract Silicon bulk micromachining techniques have been employed to fabricate an integrated grating and detector array in silicon for operation in the visible and near-infrared spectral range. Two wafers are machined in such a way that an optical path of about 4 mm in length is obtained in which dispersed light from a 32-slit diffraction grating is projected onto an array of photodiodes. The wafers are subjected to an electrochemically controlled etch. The interior of one of the wafers is subsequently coated with a reflective film. The grating and the array of photodetectors are integrated in the second wafer, which remains uncoated. The wafers can be bonded using the direct silicon-to-silicon fusion bonding technique. The functional division into a reflective wafer and a grating/readout wafer greatly simplifies the integration of the complete device in a smart silicon sensor.