In this study, the desalination performance of Capacitive Deionization (CDI) and Membrane Capacitive Deionization (MCDI) was studied for a wide range of salt compositions. The comprehensive data collection for monovalent and divalent ions used in this work enabled us to understand better the competitive electrosorption of these ions both with and without ion-exchange membranes (IEMs). As expected, MCDI showed an enhanced salt adsorption and charge efficiency in comparison with CDI. However, the different electrosorption behavior of the former reveals that ion transport through the IEMs is a significant rate-controlling step in the desalination process. A sharper desorption peak is observed for divalent ions in MCDI, which can be attributed to a portion of these ions being temporarily stored within the IEMs, thus they are the first to leave the cell upon discharge. In addition to salt concentration, we monitored the pH of the effluent stream in CDI and MCDI and discuss the potential causes of these fluctuations. The dramatic pH change over one adsorption and desorption cycle in CDI (pH range of 3.5-10.5) can be problematic in a feed water containing components prone to scaling. The pH change, however, was much more limited in the case of MCDI for all salts.