We propose a simple and precise spectral demodulation algorithm for chirped fiber Bragg grating (CFBG). This algorithm relies on mutual correlation. It can be used to measure the nonuniform temperature field and reconstruct the temperature field. First, a linear CFBG is placed in an inhomogeneous temperature field, therefore the spectrum of CFBG is compressed. In order to calculate the spectral offset of CFBG at different positions, the spectrum of room temperature and the spectrum of the temperature field to be measured are segmented. Then, according to the different trend of the spectrum, the point at the rising edge of the spectrum is taken as positive, and the point at the falling edge of the spectrum is taken as negative. Finally, the piecewise spectra are selected from the two spectra and the mutual correlation coefficient is calculated. The group with the largest correlation coefficient has the strongest correlation, and the offset of this group is calculated. Compared with the traditional chirped grating spectral demodulation algorithm, this demodulation method improves the accuracy and resolution, and the nonuniform temperature field can be reconstructed.