A spectrometer is disclosed. The spectrometer includes a fiber input, a collimator lens, a rotating shaft, a grating, a focal lens and a focal plane which have arranged in order. A broadband incident light of the fiber input becomes a first parallel beam through the collimator lens and separated by the grating into multiple parallel beams of different wavelengths and then focused by the focal lens to emit an output beams to an imaging position on the focal plane. The spectrometer can rotate the collimator lens and fiber input to change the imaging position on the focal plane.