The origin of life on Earth involves the early appearance of an information-containing molecule such as RNA. The basic building blocks of RNA could have been delivered by carbon-rich meteorites or produced in situ by processes beginning with the synthesis of hydrogen cyanide (HCN) in the early Earth’s atmosphere. Here, we construct a robust physical and nonequilibrium chemical model of the early Earth’s atmosphere. The atmosphere is supplied with hydrogen from impact degassing of meteorites, water evaporated from the oceans, carbon dioxide from volcanoes, and methane from undersea hydrothermal vents, and in it lightning and external UV-driven chemistry produce HCN. This allows us to calculate the rain-out of HCN into warm little ponds (WLPs). We then use a comprehensive numerical model of sources and sinks to compute the resulting abundances of nucleobases, ribose, and nucleotide precursors such as 2-aminooxazole resulting from aqueous and UV-driven chemistry within them. We find that 4.4 billion years ago the limit of adenine concentrations in ponds for habitable surfaces is 0.05 μM in the absence of seepage. Meteorite delivery of adenine to WLPs can provide boosts in concentration by 2–3 orders of magnitude, but these boosts deplete within months by UV photodissociation, seepage, and hydrolysis. The early evolution of the atmosphere is dominated by the decrease in hydrogen due to falling impact rates and atmospheric escape, and the rise of oxygenated species such as OH from H2O photolysis. The source of HCN is predominantly from UV radiation rather than lightning. Our work points to an early origin of RNA on Earth within ∼200 Myr of the Moon-forming impact.