In order to efficiently remove phosphorus, thermodynamic equilibrium diagrams of the P-H2O system and P-M-H2O system (M stands for Fe, Al, Ca, Mg) were analyzed by software from Visual MINTEQ to identify the existence of phosphorus ions and metal ions as pH ranged from 1 to 14. The results showed that the phosphorus ions existed in the form of H3PO4, H2PO4−, HPO42−, and PO43−. Among them, H2PO4− and HPO42− were the main species in the acidic medium (99% at pH = 5) and alkaline medium (97.9% at pH = 10). In the P-Fe-H2O system ((P) = 0.01 mol/L, (Fe3+) = 0.01 mol/L), H2PO4− was transformed to FeHPO4+ at pH = 0–7 due to the existence of Fe3+ and then transformed to HPO42− at pH > 6 as the Fe3+ was mostly precipitated. In the P-Ca-H2O system ((P) = 0.01 mol/L, (Ca2+) = 0.015 mol/L), the main species in the acidic medium was CaH2PO4+ and HPO42−, and then transformed to CaPO4− at pH > 7. In the P-Mg-H2O system ((P) = 0.01 mol/L, (Mg2+) = 0.015 mol/L), the main species in the acidic medium was H2PO4− and then transformed to MgHPO4 at pH = 5–10, and finally transformed to MgPO4− as pH increased. The verification experiments (precipitation experiments) with single metal ions confirmed that the theoretical analysis could be used to guide the actual experiments.