We experimentally study a fiber-based three-stage nonlinear interferometer and demonstrate its application in generating heralded single photons with high efficiency and purity by spectral engineering. We obtain a heralding efficiency of 90% at a brightness of 0.039 photons/pulse. The purity of the source is checked by two-photon Hong-Ou-Mandel interference with a visibility of 95%+-6% (after correcting Raman scattering and multi-pair events). Our investigation indicates that the heralded source of single photons produced by the three-stage nonlinear interferometer has the advantages of high purity, high heralding efficiency, high brightness, and flexibility in wavelength and bandwidth selection.