The interaction between proteins and DNA or RNA plays an essential part in the function of biological macromolecules, and its physical basis resides in the three-dimensional structure of the interfaces that they form. We analyze the geometric, chemical and physical chemical properties of the interfaces that occur in sets of protein–DNA and protein–RNA complexes issued from X-ray studies and deposited in the Protein Data Bank. The interface size is measured by the area of the molecular surface buried in the contact. The average protein–DNA (resp. RNA) interface buries 3180 Å2 (resp. 2530 Å2) of the surface of the component molecules, and involves 49 (resp. 43) amino acid residues and 24 (resp. 18) nucleotides. The formation of an interface that buries 3000 Å2 or more of the protein and nucleic acid surfaces, is often accompanied with conformation changes that affect one or both components. The smallest interfaces bury about 900 Å2; they involve about 15 amino acids and 6–7 nucleotides in a double helix, but only 3 or 4, in an extended segment. The protein surface in contact with the nucleic acid has a peculiar amino acid composition, it is highly polar and bears a uniform positive charge complementary to the nucleic acid surface. Protein–nucleic acid interfaces contain many polar interactions, either direct H-bonds or salt bridges, or H-bonds mediated by water molecules. The average protein–DNA interface contains 22 direct polar interactions, 60% of which involve the phosphate groups; the average protein–RNA interfaces contains 20, 35% of them with the phosphates and 25% with the 2′-OH of the ribose. About one-third of the interface H-bonds implicate the bases of both DNA and RNA, but protein–DNA complexes exhibit specific patterns that are not observed with RNA. An example is the recognition of a G:C pair by a Lys or Arg side chain located in the major groove of the double helix. The atoms buried at the interfaces are close-packed, which indicates that they belong to surfaces with complementary shapes. Thus, protein–nucleic acid recognition involves elements of shape recognition as well as electrostatic interaction and the recognition of the base sequence.