In order to establish optimal conditions of the struvite (MAP: MgNH4PO4 x 6H2O) formation, acid dissolution was applied and developed to perform element analyses on the precipitates obtained from MAP precipitation, and a novel analyzing and calculating method was developed to quantitatively determine the struvite content (purity) in the harvested precipitates according to the NH4+-N content. With this method, the purities of struvite were respectively determined for both ultra pure water and tap water used as solutes. At the same time, the effect of pH and Ca2+ on the formation and crystallization of struvite was evaluated. The newly developed method was effective enough to determine the purities of struvite, which could be a better method than qualitative X-ray diffraction (XRD). Based on the developed method, it was found that the optimal pH ranges for having a high struvite content (> 90%) were respectively at 7.5-9.0 with ultra pure water as solute and at 7.0-7.5 with tap water as solute. In real wastewater, Ca2+ at pH > 8.0 might result in impurities rather than struvite. Therefore, a neutral pH range (< 8.0) is proposed to perform struvite precipitation in wastewater.