Identifying MgCl2 or CaCl2 in solution I have an aqueous solution of either $\ce{MgCl2}$ or $\ce{CaCl2}$ in solution with $\ce{K2SO4}$. There is a white precipitate that forms on the bottom that does not dissolve when $\ce{HCl}$ is added (maybe it needs to be in excess?). Is there any way to find out if it's $\ce{Mg^2+}$ or $\ce{Ca^2+}$? I have already tried adding $\ce{NaOH}$, and the result was a not very cloudy, white precipitate, which is not really jelly like, but when compared to stock samples of $\ce{MgCl2}$ and $\ce{CaCl2}$ with $\ce{NaOH}$, they don't match. I tried a flame test but only could see the $\ce{K+}$ (violet flame).
$\ce{MgSO4}$, otherwise known as epsom salt, is soluble. $\ce{CaSO4}$ ($K_\mathrm{sp}=7.1 \times 10^{-5}$), is slightly soluble. It is extremely likely that unless there are some other unknown metal ions in this solution, the white precipitate you describe in the solution is $\ce{CaSO4}$.