The RNA world hypothesis assumes that life on earth started with small RNA molecules that catalyzed their own formation. Vital to this hypothesis is the need for prebiotic routes towards RNA. Contemporary RNA, however, is not only constructed from the four canonical nucleobases (A, C, G and U), but it contains in addition many chemically modified (non-canonical) bases. A yet open question is if these non-canonical bases were formed in parallel to the canonical bases (chemical origin), or whether they were created later, when life demanded higher functional diversity (biological origin). Here we show that isocyanates in combination with sodium nitrite establish methylating and carbamoylating reactivity compatible with early Earth conditions. This chemistry leads to the formation of methylated and amino acid modified nucleosides that are still extant. Our data provide a plausible scenario for the chemical origin of certain non-canonical bases, which suggests that they are fossils of an early Earth