All terrestrial organisms depend on nucleic acids (RNA and DNA), which use pyrimidine and purine nucleobases to encode genetic information. Carbon-rich meteorites may have been important sources of organic compounds required for the emergence of life on the early Earth; however, the origin and formation of nucleobases in meteorites has been debated for over 50 y. So far, the few nucleobases reported in meteorites are biologically common and lacked the structural diversity typical of other indigenous meteoritic organics. Here, we investigated the abundance and distribution of nucleobases and nucleobase analogs in formic acid extracts of 12 different meteorites by liquid chromatography-mass spectrometry. The Murchison and Lonewolf Nunataks 94102 meteorites contained a diverse suite of nucleobases, which included three unusual and terrestrially rare nucleobase analogs: purine, 2,6-diaminopurine, and 6,8-diaminopurine. In a parallel experiment, we found an identical suite of nucleobases and nucleobase analogs generated in reactions of ammonium cyanide. Additionally, these nucleobase analogs were not detected above our parts-per-billion detection limits in any of the procedural blanks, control samples, a terrestrial soil sample, and an Antarctic ice sample. Our results demonstrate that the purines detected in meteorites are consistent with products of ammonium cyanide chemistry, which provides a plausible mechanism for their synthesis in the asteroid parent bodies, and strongly supports an extraterrestrial origin. The discovery of new nucleobase analogs in meteorites also expands the prebiotic molecular inventory available for constructing the first genetic molecules.