Removal of nutrients like nitrogen and phosphorus from wastewater can be accomplished by precipitating these as the mineral struvite (NH 4 MgPO 4 . 6H 2 O). Predicting struvite precipitation potential, yield, and purity is important for designers and operators of reactors for struvite precipitation. In this paper, a mathematical model of this precipitation process is developed using physicochemical equilibrium expressions, mass balance equations for nitrogen, phosphorous and magnesium, and charge balance. The model was simulated to explicitly solve for equilibrium concentrations of eighteen species that included dissolved (three), ionic (ten), and solid (five) species for a given set of initial concentrations of ammonium-nitrogen, magnesium and phosphate-phosphorus, and pH. The model simulations were validated against literature experimental data, which used synthetic as well as actual wastewater, and data from our experiments. The model satisfactorily predicted most data. Struvite fraction in the precipitate ranged from 27% to 100%. The purity of struvite in the precipitate and the pH that maximizes struvite fraction was dependent on the initial concentrations of ammonium, magnesium, and phosphate. Optimum pH and struvite fraction was, respectively, 8.5 and 29.3% for an equimolar mixture of ammonia, magnesium, and phosphate and 9.8 and 98.3% for 10:1.7:3.4 mM ratio. Struvite fraction in the precipitate increased as magnesium became limiting or as ammonia to phosphate ratio increased and magnesium to phosphate ratio decreased. Since the struvite component is only a fraction of the total solids, it is erroneous to report the total precipitate produced as being struvite as is conventionally done.