Molecular nitrogen (N2) comprises three-quarters of Earth's atmosphere and significant portions of other planetary atmospheres. We report a 19 per mil (‰) excess of 15N15N in air relative to a random distribution of nitrogen isotopes, an enrichment that is 10 times larger than what isotopic equilibration in the atmosphere allows. Biological experiments show that the main sources and sinks of N2 yield much smaller proportions of 15N15N in N2. Electrical discharge experiments, however, establish 15N15N excesses of up to +23‰. We argue that 15N15N accumulates in the atmosphere because of gas-phase chemistry in the thermosphere (>100 km altitude) on time scales comparable to those of biological cycling. The atmospheric 15N15N excess therefore reflects a planetary-scale balance of biogeochemical and atmospheric nitrogen chemistry, one that may also exist on other planets.