Nitrogen, the most dominant constituent of Earth's atmosphere, is critical for the habitability and existence of life on our planet. However, its distribution between Earth's major reservoirs, which must be largely influenced by the accretion and differentiation processes during its formative years, is poorly known. Sequestration into the metallic core, along with volatility related loss pre- and post-accretion, could be a critical process that can explain the depletion of nitrogen in the Bulk Silicate Earth (BSE) relative to the primitive chondrites. However, the relative effect of different thermodynamic parameters on the alloy-silicate partitioning behavior of nitrogen is still poorly known. Here we present equilibrium partitioning data of N between alloy and silicate melt ( ) from 67 new high pressure (P = 1-6 GPa)-temperature (T = 1500-2200 °C) experiments under graphite saturated conditions at a wide range of oxygen fugacity (logfO2 ~ΔIW - 4.2 to - 0.8), mafic to ultramafic silicate melt compositions (NBO/T = 0.4 to 2.2), and varying chemical composition of the alloy melts (S and Si contents of 0-32.1 wt.% and 0-3.1 wt.%, respectively). Under relatively oxidizing conditions (~ΔIW - 2.2 to - 0.8) nitrogen acts as a siderophile element ( between 1.1 and 52), where decreases with decrease in fO2 and increase in T, and increases with increase in P and NBO/T. Under these conditions remains largely unaffected between S-free conditions and up to ~17 wt.% S content in the alloy melt, and then drops off at > ~20 wt.% S content in the alloy melt. Under increasingly reduced conditions (< ~ ΔIW - 2.2), N becomes increasingly lithophile ( between 0.003 and 0.5) with decreasing with decrease in fO2 and increase in T. At these conditions fO2, along with Si content of the alloy under the most reduced conditions (< ~ΔIW - 3.0), is the controlling parameter with T playing a secondary role, while, P, NBO/T, and S content of the alloy have minimal effects. A multiple linear least-squares regression parametrization for based on the results of this study and previous studies suggests, in agreement with the experimental data, that fO2 (represented by Si content of the alloy melt and FeO content of the silicate melt), followed by T, has the strongest control on . Based on our modeling, to match the present-day BSE N content, impactors that brought N must have been moderately to highly oxidized. If N bearing impactors were reduced, and/or there was significant disequilibrium core formation, then the BSE would be too N-rich and another mechanism for N loss, such as atmospheric loss, would be required.