The performance of platinum electrodes towards the hydrogen evolution reaction (HER) during pH neutral brine electrolysis was investigated in the presence of alkaline earth metal divalent cations, with focus on Mg2+ ions. This study aimed to understand the impact of these cations and/or their hydroxide deposits on electrode performance. Electrochemical measurements were conducted in electrolytes with varying Mg2+ concentrations (0 mM to 55 mM) in 1 M Na2SO4 solution. Contrary to concerns that Mg(OH)2 deposits can might impair HER performance, Pt electrodes exhibited improved HER activity across all Mg2+ concentrations compared to Mg-free electrolytes. To distinguish the effects of hydroxide deposits from solvated cation interactions with the electrocatalyst, other divalent cations (Ca2+, Sr2+, Mn2+) with varying solubility product constant (Ksp) were also tested. All cations enhanced HER performance, including those unlike to form deposits under the tested conditions (e.g., Ca2+ and Sr2+). Our results point out to cation acidity and Gibbs free energy of hydration as effective descriptors for predicting the role of divalent cations in HER kinetics. In situ image analysis revealed that Mg(OH)2 deposits are periodically removed by evolving hydrogen bubbles, preventing active site blockage. In situ Raman spectroscopy further confirmed the formation of Mg(OH)2 deposits during HER.