We present predictions for the cosmic metal budget in various phases of baryons from redshift z= 6 → 0, taken from a cosmological hydrodynamic simulation that includes a well-constrained model for enriched galactic outflows. We find that substantial amounts of metals are found in every baryonic phase at all epochs, with diffuse intergalactic gas dominating the metal budget at early epochs and stars and halo gas dominating at recent epochs. We provide a full accounting of metals in the context of the missing metals problem at z≈ 2.5, showing that ∼40 per cent of the metals are in galaxies, and the remainder are divided between diffuse intergalactic medium (IGM) gas and shocked gas in haloes and filamentary structures. Comparisons with available observations of metallicity and metal mass fraction evolution show broad agreement. We predict that stars have a mean metallicity of one-tenth solar already at z= 6, which increases slowly to one-half solar today, while stars just forming today typically have solar metallicity. Our H i column density weighted mean metallicity (comparable to damped Lyman α system metallicities) slowly increases from one-tenth to one-third solar from z= 6 → 1, and then falls to one-quarter solar at z= 0. The global mean metallicity of the universe tracks ∼50 per cent higher than that of the diffuse phase down to z∼ 1, and by z= 0 it has a value around one-tenth solar. Metals move towards higher densities and temperatures with time, peaking around the mean cosmic density at z= 2 and an overdensity of 100 at z= 0. We study how carbon and oxygen ions trace the path of metals in phase space, and show that O iii–O vii lines provide the most-practical option for constraining IGM metals at z≲ 2.