We have determined by two-dimensional nuclear magnetic resonance studies and molecular mechanics calculations the three-dimensional solution structure of a 21 residue oligonucleotide capable of forming a hairpin structure with a loop of three thymidine residues. This structure is in equilibrium with a duplex form. At 33 degrees C, low ionic strength and in the presence of MgCl2 the hairpin form dominates in solution. Six Watson-Crick base pairs are formed topped by the loop structure. The residues 1-3 and 18-21 are not complementary and form dangling ends. Distance constraints have been derived from nuclear Overhauser enhancement measurements. These, together with molecular mechanics calculations, have been used to determine the structure. We do not observe stacking of thymidine residues either over the 3' or the 5' end of the stem.