Nitrogen (N) emissions from food production can cause serious environmental problems. Mitigation strategies require insights of N cycles in this complex system. A substance flow analysis for N in the Hungary food production and processing chain over the period 1961-2010 was conducted. Our results show that the history of the total N input and output for the Hungary food chain consists of four distinct periods: 1961-1974 a rapid increase; 1974-1988 a steady increase; 1988-1992 a sharp decrease; 1992-2010 a period of large annual variations. The total N input to the food chain largely depended on N fertilizer input (on average 83 % of total input). Nitrogen losses were the largest outflows, particularly via ammonia emissions and denitrification from agricultural systems. The N use efficiency (NUE) for crop production sharply decreased from 1961 to 1974, but went up since the late 1980s. The NUE of animal production increased from 11 % in 1961 to 20 % in 2010. The N cost of food production in Hungary largely varied from 3 to 10 kg kg(-1) during 1961-2010, which was related to changes in fertilizer use and human dietary preferences. Increased dependence of crop yield on weather was observed since the early 1990s where large decrease in N fertilizer use occurred. The observed weather-dependence has resulted in large yearly variations in crop yields, the NUE of crop production and also the food N cost, which may pose a threat to food security of Hungary.