Piperazinyl phenyl phosphate (PPOP) and 4,4-diaminodiphenylmethyl phenyl phosphate (DPOA) containing phosphorus and nitrogen elements as flame retardants applied for epoxy resin (EP) were successfully synthesized, and substantiated by Fourier transform infrared spectra (FTIR), 1 H and 31 P nuclear magnetic resonance (NMR) and elemental analysis (EA). The limiting oxygen index (LOI) of the EP composites with 3 wt% of PPOP and DPOA attained 33.6% and 34.2%, both acquired the UL-94 V-0 rating, respectively. The peak of heat release rate (pHRR), the total heat release (THR) and the total smoke production (TSP) of EP/PPOP-1 decreased by 21.0%, 25.6%, and 18.7%, respectively. For EP/DPOA-1, the pHRR, THR, and TSP were brought down by 23.5%, 21.8%, and 26.4%, respectively. Flame-retardant mechanisms were explicitly evaluated by the scanning electron microscope (SEM), Raman spectroscopy and thermogravimetric analysis-infrared spectrometry (TG-IR). This proposed method not only could produce efficient flame retardant for EP but provide new ideas for replacing existing halogenated flame retardants.