To achieve high-precision dispersion measurement of optical components, a new method based on spectral shaping and frequency-to-time mapping was proposed, which was experimentally demonstrated and verified. In this research, a modelocked laser and a home-made spectral shaper were used to realize the spectral shaping of laser pulse with fingerprint-like characteristic. After transmitted through a dispersive medium, the temporal profile of the laser pulse became a scaled replica profile of the spectrum owing to the frequency-to-time mapping of chirped pulse. A Taylor-expanded chromatic dispersion model and least-square method were adopted for data analysis, which realized a measurement of 1-km fiber to the second-order dispersion with an error of 0.43%. The precision of the dispersion measurement was greatly enhanced by constructing a fingerprint-like characteristic spectrum. The experimental results showed that this method has better robustness and fidelity for different types of optical fiber, as well as various dispersive components in high-power laser system.