We present the results of full new calculation of radiocarbon 14C production in the Earth atmosphere, using a numerical Monte-Carlo model. We provide, for the first time, a tabulated 14C yield function for the energy of primary cosmic ray particles ranging from 0.1 to 1000 GeV/nucleon. We have calculated the global production rate of 14C, which is 1.64 and 1.88 atoms/cm2/s for the modern time and for the pre-industrial epoch, respectively. This is close to the values obtained from the carbon cycle reservoir inventory. We argue that earlier models overestimated the global 14C production rate because of outdated spectra of cosmic ray heavier nuclei. The mean contribution of solar energetic particles to the global 14C is calculated as about 0.25% for the modern epoch. Our model provides a new tool to calculate the 14C production in the Earths atmosphere, which can be applied, e.g., to reconstructions of solar activity in the past.