The mineralogical and elemental compositions of the martian soil are indicators of chemical and physical weathering processes. Using data from the Mars Exploration Rovers, we show that bright dust deposits on opposite sides of the planet are part of a global unit and not dominated by the composition of local rocks. Dark soil deposits at both sites have similar basaltic mineralogies, and could reflect either a global component or the general similarity in the compositions of the rocks from which they were derived. Increased levels of bromine are consistent with mobilization of soluble salts by thin films of liquid water, but the presence of olivine in analysed soil samples indicates that the extent of aqueous alteration of soils has been limited. Nickel abundances are enhanced at the immediate surface and indicate that the upper few millimetres of soil could contain up to one per cent meteoritic material.