Hairpins are common RNA secondary structures that play multiple roles in nature. Tetraloops are the most frequent RNA hairpin loops and are often phylogenetically conserved. For both the UNCG and GNRA families, CG closing base pairs (cbps) confer exceptional thermodynamic stability but the molecular basis for this has remained unclear. We propose that, despite having very different overall folds, these two tetraloop families achieve stability by presenting the same functionalities to the major groove edge of the CG cbp. Thermodynamic contributions of this molecular mimicry were investigated using substitutions at the nucleobase and functional group levels. By either interrupting or deleting loop-cbp electrostatic interactions, which were identified by solving the nonlinear Poisson-Boltzmann (NLPB) equation, stability changed in a manner consistent with molecular mimicry. We also observed a linear relationship between ΔG°37 and log[Na+] for both families, and loops with a CG cbp had a decreased dependence of stability on salt. NLPB calculations revealed that, for both UUCG and GAAA tetraloops, the GC cbp form has a higher surface charge density, although it arises from changes in loop compaction for UUCG and changes in loop configuration for GAAA. Higher surface charge density leads to stronger interactions of GC cbp loops with solvent and salt, which explains the correlation between experimental and calculated trends of free energy with salt. Molecular mimicry as evidenced in these two stable but otherwise unrelated tetraloops may underlie common functional roles in other RNA and DNA motifs.