LiNi1/3Mn1/3Co1/3-zMgzO2, LiNi1/3-zMn1/13Co1/3MgzO2, and LiNi1/3Mn1/3-zCo1/3MgzO2(0 <= 1/3) were prepared from hydroxide precursors. The hydroxide precursors were heated with Li2CO3 at 900 degrees C to prepare the oxides. Rietveld refinements of XRD data show that Mg substitution for Co, Ni and Mn results in different degrees of cation mixing in the Li layer with very little cation mixing in LiNi1/3Mn1/3-zCo1/3MgzO2 and the most cation mixing in LiNi1/3Mn1/3Co1/3-zMgzO2. Electrochemical studies of the LiNi1/3Mn1/3Co1/3-zMgzO2, LiNi1/3-zMn1/3Co1/3MgzO2, and LiNi1/3Mn1/3-zCo1/3MgzO2 (0 <= z < 1/3) samples were used to measure the rate of capacity reduction with Mg content, found to be about -389 (mAh/g)/(z = 1) independent of which cation was substituted by Mg. The impact of Mg substitution on the thermal stability of NMC samples was studied via accelerating rate calorimetry and compared with Al-substituted NMC samples. The substitution of Mg did not improve the thermal stability of the samples, independent of which cation was substituted and independent of the amount of Mg added, in contrast to the effect of A1, which dramatically improves thermal stability.