Polynitrogen compounds are a class of promising green high‐energy‐density materials. Using three‐membered to six‐memberd nitrogen rings, called all‐nitrogen building blocks, a series of two dimensional (planar) to three dimensional (cluster) polynitrogen molecules can be built. Small‐angle strain of small nitrogen rings and noncovalent interaction between neighboring nitrogen atoms leads to cage strain, and cage strain energy can be used to describe the stability of polynitrogen molecules theoretically. Density functional theory B3LYP/6‐31g(d,p) was used to optimize geometrical configurations and second‐order perturbation theory MP2/6‐311g(d,p) was applied to calculate single point energies of polynitrogen and other related compounds. Homodesmotic reactions were designed to compute cage strain energies of polynitrogen molecules and average bond energies of their NN bonds. Some strategies were proposed to enhance the stability of polynitrogen molecules. This work provides theoretical evidence for the stability prediction of some nanomaterials (e.g., nanotube). © 2014 Wiley Periodicals, Inc.