The Li3 2xMgxV2(PO4)3/C (x-=0, 0.01, 0.03 and 0.05) composites were prepared by a sol-gel method and characterized by X-ray diffraction (XRD), scanning electron microscopy (SEM) and electrochemical measurements. The XRD results reveal that a small amount of Mg2+ doping into Li sites does not significantly change the monoclinic structure of Li3V2(PO4)3, but Mg-doped Li3W2(PO4)3 has larger cell volume than the pristine Li3V2(PO4)3. All Mg-doped composites display better electrochemical performance than the pristine one, and Liz.94Mgo.03Vz(P04)3/C composite exhibits the highest capacity and the best cycle performance among all above-mentioned composites. The analysis of Li+ diffusion coefficients in Li3V2(PO4)3/C and Li2.94Mgo.03V2(P04)3/C indicates that rapid Li+ diffusion results from the doping of Mg2+ and the rapid Li+ diffusion is responsible for the better electrochemical performance of Mg-doped Li3V2(PO4)3/C composite cathode materials.