Complexes of 1,2,4-triazole (TR) and 3-amino-1,2,4-triazole (AT) with N2 were studied computationally employing MP2 and B3LYPD3 methods and experimentally by FTIR matrix isolation technique. The results show that both triazoles interact specifically with dinitrogen in several different ways. For the 1:1 complexes of 1,2,4-triazole five stable minima were located on the potential energy surface. The most stable of them comprises a weak hydrogen bond formed between the NH group of the ring and the lone pair of the nitrogen molecule. The second most stable structure is bound by the N⋯π bond formed between one of the N atoms of the N2 molecule and the triazole ring. Three other complexes are stabilized by the C-H⋯N and N⋯N van der Waals interactions. In the case of 3-amino-1,2,4-triazole, the two most stable dinitrogen complexes are analogous to those found for the 1,2,4-triazole and involve N-H⋯N and N⋯π bonds. In other structures amino or CH groups act as proton donors to the N2 molecule. The N⋯N van der Waals interactions are also present. The analysis of the infrared spectra of low temperature matrices containing TR or AT and dinitrogen indicates that in both systems mostly 1:1 hydrogen-bonded complexes with the NH group interacting with N2 are present in solid argon.