The liquid metal–liquid silicate partitioning of molybdenum and tungsten during core formation must be well-constrained in order to understand the evolution of Earth and other planetary bodies, in particular because the Hf–W isotopic system is used to date early planetary evolution. The partition coefficients DMo and DW have been suggested to depend on pressure, temperature, silicate and metal compositions, although previous studies have produced varying and inconsistent models. Additionally, the high cationic charges of W and Mo in silicate melts make their partition coefficients particularly sensitive to oxygen fugacity. We combine 48 new high pressure and temperature experimental results with a comprehensive database of previous experiments to re-examine the systematics of Mo and W partitioning, and produce revised partitioning models from the large combined dataset. W partitioning is particularly sensitive to silicate and metallic melt compositions and becomes more siderophile with increasing temperature. We show that W has a 6+ oxidation state in silicate melts over the full experimental fO2 range of ΔIW −1.5 to −3.5. Mo has a 4+ oxidation state, and its partitioning is less sensitive to silicate melt composition but also depends on metallic melt composition. DMo stays approximately constant with increasing depth in Earth. Both W and Mo become more siderophile with increasing C content of the metal: we therefore performed experiments with varying C concentrations and fit epsilon interaction parameters: εCMo = −7.03 ± 0.30 and εCW = −7.38 ± 0.57.W and Mo along with C are incorporated into a combined N-body accretion and core–mantle differentiation model, which already includes the major rock-forming elements as well as S, and moderately and highly siderophile elements. In this model, oxidation and volatility gradients extend through the protoplanetary disk so that Earth accretes heterogeneously. These gradients, as well as the metal–silicate equilibration pressure, are fitted using a least squares optimisation so that the model Earth-like planet reproduces the composition of the bulk silicate Earth (BSE) in terms of 17 simulated element concentrations (Mg, Fe, Si, Ni, Co, Nb, Ta, V, Cr, S, Pt, Pd, Ru, Ir, W, Mo, and C). The effects of the interaction of W and Mo with Si, S, O, and C in metal are included. Using this model with six separate terrestrial planet accretion simulations, we show that W and Mo require the early accreting Earth to be sulfur-depleted and carbon-enriched so that W and Mo are efficiently partitioned into Earth’s core and do not accumulate in the mantle. When this is the case, the produced Earth-like planets possess mantle compositions matching the BSE for all simulated elements. However, there are two distinct groups of estimates of the bulk mantle’s C abundance in the literature: low (∼100 ppm) and high (∼800 ppm), and all six models are consistent with the higher estimated carbon abundance. The low BSE C abundance would be achievable when the effects of the segregation of dispersed metal droplets produced in deep magma oceans by the disproportionation of Fe2+ to Fe3+ plus metallic Fe is included.