We derive a new relation between the metallicity of Seyfert 2 active galactic nuclei (AGNs) and the intensity of the narrow emission-lines ratio N2O2 = log([N II] λ6584/[O II] λ3727). The calibration of this relation was performed by determining the metallicity (Z) of a sample of 58 AGNs through a diagram containing the observational data and the results of a grid of photoionization models obtained with the CLOUDY code. We find the new Z/Z⊙–N2O2 relation using the obtained metallicity values and the corresponding observational emission-line intensities for each object of the sample. Estimations derived through the use of this new calibration indicate that the narrow-line regions of Seyfert 2 galaxies exhibit a large range of metallicities (0.3 ≲ Z/Z⊙ ≲ 2.0), with a median value Z ≈ Z⊙. Regarding the possible existence of correlations between the luminosity L(Hβ), the electron density and the colour excess E(B − V) with the metallicity in this kind of objects, we do not find correlations between them.