The hairpin ribozyme in its natural context consists of two loops in RNA duplexes that are connected as arms of a four-way helical junction. Magnesium ions induce folding into the active conformation in which the two loops are in proximity. In this study, we have investigated nucleotides that are important to this folding process. We have analyzed the folding in terms of the cooperativity and apparent affinity for magnesium ions as a function of changes in base sequence and functional groups, using fluorescence resonance energy transfer. Our results suggest that the interaction between the loops is the sum of a number of component interactions. Some sequence variants such as A10U, G+1A, and C25U exhibit loss of cooperativity and reduced affinity of apparent magnesium ion binding. These variants are also very impaired in ribozyme cleavage activity. Nucleotides A10, G+1, and C25 thus appear to be essential in creating the conformational environment necessary for ion binding. The double variant G+1A/C25U exhibits a marked recovery of both folding and catalytic activity compared to either individual variant, consistent with the proposal of a triple-base interaction among A9, G+1, and C25 [Pinard, R., Lambert, D., Walter, N. G., Heckman, J. E., Major, F., and Burke, J. M. (1999) Biochemistry 38, 16035-16039]. However, substitution of A9 leads to relatively small changes in folding properties and cleavage activity, and the double variant G+1DAP/C25U (DAP is 2,6-diaminopurine), which could form an isosteric triple-base interaction, exhibits folding and cleavage activities that are both very impaired compared to those of the natural sequence. Our results indicate an important role for a Watson--Crick base pair between G+1 and C25; this may be buttressed by an interaction with A9, but the loss of this has less significant consequences for folding. 2'-Deoxyribose substitution leads to folding with reduced magnesium ion affinity in the following order: unmodified RNA > dA9 > dA10 > dC25 approximately dA10 plus dC25. The results are interpreted in terms of an interaction between the ribose ring of C25 and the ribose and base of A10, in agreement with the proposal of Ryder and Strobel [Ryder, S. P., and Strobel, S. A. (1999) J. Mol. Biol. 291, 295-311]. In general, there is a correlation between the ability to undergo ion-induced folding and the rate of ribozyme cleavage. An exception to this is provided by G8, for which substitution with uridine leads to severe impairment of cleavage but folding characteristics that are virtually unaltered from those of the natural species. This is consistent with a direct role for the nucleobase of G8 in the chemistry of cleavage.