A novel algorithm base on the correlation analysis of waveforms to distinguish between the magnetizing inrush and the short-circuit fault current is proposed. The algorithm makes use of the characteristics of differential current waveform in the non-saturation zone that it is similar with a part of sinusoidal wave under the short-circuit fault and far different with the sinusoid under the inrush condition. To realize this algorithm, the non-saturation zone of transformer is decided by comparing the algebraic sum of sampling data in a short slide window of differential current under the magnetizing inrush or the short-circuit fault, then two kinds of normal sinusoidal waveform are structured according to the value and position of peak point of differential current in the non-saturation zone. The correlation coefficients between the original waveform and two structured sinusoidal waveforms are calculated, and the magnetizing inrush or fault current is judged according to the average of two correlation coefficients. The experimental results verify that the algorithm can correctly open the differential protection in short time for the internal short-circuit fault in operation and energizing with a turn-to-turn short-circuit fault, reliably block the protection during the magnetizing inrush, and obtains good immunity to the saturation of current transformer. Low computation and requirement contribute to this algorithm is performed in practice.