The present invention relates to process to prepare a chlorine-containing compound using an aqueous salt solution containing at least 100 g/l of sodium chloride and a contaminating amount of polyvalent cations comprising the steps of (i) preparing an aqueous salt solution containing at least 100 g/l of sodium chloride and at least 0.01 ppm of polyvalent cations by dissolving a sodium chloride source in water, (ii) adding an effective amount of at least one positive retention enhancing component to the aqueous solution, (iii) subsequently subjecting the solution to a nanofiltration step, thereby separating the solution into a retentate which is enriched for polyvalent cations and a permeate which is the purified aqueous salt solution, (iv) reacting the chloride anions in the permeate to a chlorine-containing compound by an electrolysis step, and (v) recycling at least part of the retentate to dissolution step (i).