Molecular beacons are DNA probes that form a stem-and-loop structure and possess an internally quenched fluorophore. When they bind to complementary nucleic acids, they undergo a conformational transition that switches on their fluorescence. These probes recognize their targets with higher specificity than probes that cannot form a hairpin stem, and they easily discriminate targets that differ from one another by only a single nucleotide. Our results show that molecular beacons can exist in three different states: bound to a target, free in the form of a hairpin structure, and free in the form of a random coil. Thermodynamic analysis of the transitions between these states reveals that enhanced specificity is a general feature of conformationally constrained probes.