Quantum private comparison (QPC) aims to determine whether two parties’ private inputs are equal or not without leaking out their genuine contents. At present, there is seldom QPC protocol which uses single photons as quantum resource. In this paper, we are devoted to converting Zhang et al.’s three-party quantum summation (QS) protocol based on single photons (Int. J. Quantum Inf. 15(2), 1750010, 2017) into the corresponding two-party QPC protocol with single photons. The correctness and the security of the proposed QPC protocol with single photons can be guaranteed. The proposed QPC protocol is naturally free from Trojan horse attacks because of its single directional particle transmission mode.