Biological nitrogen fixation (BNF) is a critical natural nitrogen input that sustains terrestrial carbon cycling, yet it remains poorly represented in terrestrial ecosystem models (TEMs). Here, we refine the nitrogen cycle representation in a TEM by incorporating free-living and symbiotic nitrogen fixation (SNF) processes along with atmospheric nitrogen deposition effects. Our updated model provides a new assessment of present-day and future global natural ecosystem BNF rates and their spatial distribution. We estimate that present-day (1981–2020) free-living nitrogen fixation (FLNF) contributes to 36 Tg N yr−1, ranging from 33 to 38.5 Tg N yr−1 and SNF is 88 Tg N yr−1 with a range of 80–95 Tg N yr−1, resulting in a total BNF 124 Tg N yr–1, ranging from 112 to 134 Tg N yr−1. Under the SSP5-8.5 warming scenario, our projections indicate that total BNF could increase to 178 Tg N yr−1 by the end of the 21st century. Our model results highlight that the FLNF plays a dominant role in low-temperature environments, and plant functional type emerges as the primary factor for both symbiotic and FLNF pathways, thus precise global vegetation classification is highly necessary for N2 fixation simulation. Our refined model advances global nitrogen cycle modeling and will improve future quantification of both global carbon and nitrogen cycles.