Nitrogen is the main reaction and detonation product of energetic materials. Therefore, studying the equation of state and phase transition of nitrogen at high temperature and high pressure is very important in evaluating the energy characteristics of energetic materials, especially in designing a new-generation nitrogen-rich energetic materials. Using density functional molecular dynamics simulation method, we calculate the pressure, internal energy and chemical components of fluid nitrogen in a temperature range of 900–25000 K and a pressure range of 2–300 GPa. The negative changes of pressure with temperature on isochores are observed under the temperature and pressure conditions of 3000–10000 K and 20–80 GPa. As the temperature increases, the pressure drop is caused by the collapse of nitrogen molecules. This phenomenon is related to the phase transition from molecular fluid nitrogen to polymerized fluid nitrogen. The triple bond in the molecule breaks and a polymer forms, which is connected by single and double bonds with neighboring atom. We also study the equation of state along Hugoniot curve under impact loading. The obtained Hugoniot curve is in good agreement with the experimental results. It is found that the softening of the experimental curve in a range of 30–60 GPa is related to the decomposition of nitrogen molecules and the formation of polymeric nitrogen.