Stoichiometric and non-stoichiometric Mg-doped lithium iron phosphates were synthesised via spray-pyrolysis, followed by sintering at high temperature for crystallization. The spray pyrolysis process allows the homogeneous mixing of the ingredient reactants at atomic level. The electronic conductivities of the Mg-doped lithium iron phosphates have been drastically improved by 4 orders of magnitude, comparing to the undoped LiFePO4. The electrochemical properties of as-prepared lithium iron phosphates were systematically measured by cyclic voltammetry and constant current charge/discharge cycling tests.