A two-dimensional sample array synthesis has been used to screen carbon-coated Li(1−x)Mg x/2FePO4 and LiFe(1−y)Mg y PO4 powders as potential positive electrode materials in lithium ion batteries with respect to x, y and carbon content. The synthesis route, using sucrose as a carbon source as well as a viscosity-enhancing additive, allowed introduction of the Mg dopant from solution into the sol–gel pyrolysis precursor. High-throughput XRD and cyclic voltammetry confirmed the formation of the olivine phase and percolation of the electronic conduction path at sucrose to phosphate ratios between 0.15 and 0.20. Measurements of the charge passed per discharge cycle showed that the capacity deteriorated on increasing magnesium in Li(1−x)Mg x/2FePO4, but improved with increasing magnesium in LiFe(1−y) Mg y PO4, especially at high scan rates. Rietveld-refined XRD results on samples of LiFe(1−y)Mg y PO4 prepared by a solid-state route showed a single phase up to y =0.1 according to progressive increases in unit cell volume with increases in y. Carbon-free samples of the same materials showed conductivity increases from 10−10 to 10−8 Scm−1 and a decrease of activation energy from 0.62 to 0.51eV. Galvanostatic cycling showed near theoretical capacity for y =0.1 compared with only 80% capacity for undoped material under the same conditions.