Aiming at the problem that transformer differential protection needs to identify inrush current of excitation by means of secondary harmonics and other algorithms, a transformer protection algorithm based on fault component is proposed on the basis of longitudinal impedance protection principle. Based on the characteristics that the longitudinal impedance of the fault component is less than the transformer leakage impedance in the internal fault, more than the transformer leakage impedance in the external fault and more than the transformer leakage impedance in the no-load closing, the algorithm can identify the fault area reliably. According to the stable impedance relation in the transmission system, the protection algorithm can effectively resist the influence of inrush current when the transformer is closed at no load, so that the protection algorithm can not operate reliably when the transformer is closed at no load. At the same time, considering all kinds of saturation conditions that may occur in the fault ct outside the zone, the algorithm can correctly identify the fault zone and has strong anti-interference ability. The simulation experiment in PSCAD shows that the algorithm is not affected by current transformer saturation and excitation inrush current, has strong reliability and anti-interference ability, and has a good prospect of engineering application.