The maximum achievable N content ([N]max) in nitride films is examined by combining ab initio simulations with reactive magnetron sputtering [J.Houska, Acta Mater. 174, 189-194 (2019)]. Structures of amorphous nitrides such as CNx, Si-C-N and B-C-N are predicted in a wide range of compositions and densities (>9000 trajectories). When and only when the simulation algorithm allows the formation and final presence of N2 molecules, the predicted lowest-energy densities are in agreement with the experiment. The number of unbonded N2 molecules ranges e.g. from no N2 at the lowest-energy density of a-Si3N4 to many N2 at the lowest-energy density of a-C3N4. Detailed analysis shows that [N]max in a-CNx networks is 42%. The increasing [N]max in Si-C-N with increasing Si/C ratio is also in an excellent agreement with the experiment. While the N2 formation at a given total N content is given by the packing factor, the lowest-energy packing factor increases with Si/C.