GFP and its derivatives revolutionized the study of proteins. Spinach is a recently reported in vitro-evolved RNA mimic of GFP, which as genetically encoded fusions makes possible live-cell, real-time imaging of biological RNAs without resorting to large RNA-binding protein-GFP fusions. To elucidate the molecular basis of Spinach fluorescence, we solved the cocrystal structure of Spinach bound to its cognate exogenous chromophore, showing that Spinach activates the small molecule by immobilizing it between a base triple, a G-quadruplex and an unpaired G. Mutational and NMR analyses indicate that the G-quadruplex is essential for Spinach fluorescence, is also present in other fluorogenic RNAs and may represent a general strategy for RNAs to induce fluorescence of chromophores. The structure guided the design of a miniaturized 'Baby Spinach', and it provides a foundation for structure-driven design and tuning of fluorescent RNAs.