Using six high-resolution dissipationless simulations with a varying box size in a flat Lambda cold dark matter (ΛCDM) universe, we study the mass and redshift dependence of dark matter halo shapes for Mvir= 9.0 × 1011− 2.0 × 1014 h−1 M⊙, over the redshift range z= 0–3, and for two values of σ8= 0.75 and 0.9. Remarkably, we find that the redshift, mass and σ8 dependence of the mean smallest-to-largest axis ratio of haloes is well described by the simple power-law relation 〈s〉= (0.54 ± 0.02)(Mvir/M*)−0.050±0.003, where s is measured at 0.3Rvir, and the z and σ8 dependences are governed by the characteristic non-linear mass, M*=M*(z, σ8). We find that the scatter about the mean s is well described by a Gaussian with σ∼ 0.1, for all masses and redshifts. We compare our results to a variety of previous works on halo shapes and find that reported differences between studies are primarily explained by differences in their methodologies. We address the evolutionary aspects of individual halo shapes by following the shapes of the haloes through ∼100 snapshots in time. We determine the formation scalefactor ac as defined by Wechsler et al. and find that it can be related to the halo shape at z= 0 and its evolution over time.