Due to finite width of a spectral line,the visibility of the moire fringes formed by a grating and the self-image of another similar grating reduces by the increase of the self-image order. This effect is exploited to specify the spectral line shape by evaluating the Fourier transform of a function related to the visibility. Even, by using in-expensive optics, the technique can provide the spectral line shapes of rather broad widths—of the order of nanometer and more—by precisions that are comparable by those obtained by expensive Fourier transform spectrometers.Besides, it is shown that by comparing the line shapes obtained with and without a dispersive medium between the gratings, one can specify the dispersion function of the medium in the wavelength range covered by the spectrum.