Proteins that bind preferentially to specific recognition sites on DNA also bind more weakly to nonspecific DNA. We have studied both specific and non-specific binding of the EcoRI and BamHI restriction endonucleases, and determined enthalpic and entropic contributions to binding free energy (DeltaG degrees (bind)) using both the van't Hoff method and isothermal titration calorimetry. Specific binding is characterized by a strongly negative DeltaC degrees (p) and can be either enthalpy-driven or entropy-driven, depending on temperature. Nonspecific binding has DeltaC degrees (p) approximate to 0 and is enthalpy-driven. A strongly negative DeltaC degrees (p) is the "thermodynamic signature" of site-specific binding, because it reflects the characteristics of a tight complementary recognition interface: the burial of previously hydrated nonpolar surface and restriction of configurational-vibrational freedoms of protein, DNA, and water molecules trapped at the protein-DNA interface. These factors are absent in nonspecific complexes. We probed the contributions to DeltaC degrees (p) by varying the sequence context surrounding the recognition site. As DeltaG degrees (bind) improves, DeltaC degrees (p), DeltaH degrees and DeltaS degrees all become more negative, and there is a linear correlation between DeltaH degrees and DeltaS degrees (enthalpy-entropy compensation). Because these context variations do not change the protein-base or protein-phosphate contacts, the hydrophobic contribution or the number of trapped water molecules at the interface, we conclude that a better sequence context improves the "goodness of fit" in the interface and and thus increases the magnitude of the negative configurational-vibrational contribution to DeltaC degrees (p).