Potassium (K)-struvite precipitation is a promising approach to K recovery but faces the critical challenge of co-precipitation of sodium (Na)-struvite mainly due to the addition of sodium hydroxide (NaOH) for pH adjustment. To avoid using NaOH, this study investigated the electrochemical addition of magnesium (Mg) and hydroxide ions for K-struvite recovery. Results showed that a high release rate of Mg and hydroxide ions in the electrolysis led to a Mg:Phosphorus (P) ratio higher than 1:1 and pH higher than 11.3, which however resulted in a decrease in the K recovery efficiency. Subsequent optimization experiments conducted in synthetic urine, diluted fivefold, maintained a process pH of 10.811.0, with a current density of 5 mA/cm2 and an electrode spacing of 20 mm. Under these conditions, K recovery efficiency reached 38 %, while P recovery efficiency reached 93 % after 30 minutes of electrolysis. Compared to chemical precipitation methods, electrochemical recovery exhibited a 41 % increase in K recovery efficiency and a 153 % increase in K-struvite:Na-struvite molar ratio in the precipitates. Furthermore, a predictive model was developed to estimate optimal K recovery time and energy consumption, showcasing the effectiveness of electrochemical Mg addition in urine for high-efficiency K recovery.