A computer program has been developed to survey a set of crystal structures for hydrogen-bond motifs. Possible ring and chain motifs are generated automatically from a user-defined list of interacting molecular fragments and intermolecular interactions. The new program was used to analyse the hydrogen-bond networks in the crystals of 52 zwitterionic a-amino acids. All the possible chain motifs (repeating 1-4 molecules) are frequent, while the frequency of ring motifs (2-6 molecules) ranges from 0 to 85% of the structures. The list of motifs displayed by each structure reveals structural similarities and it can be used to compare polymorphs. The motifs formed in cocrystals of a-amino acids and in crystals of ß- and ?-amino acids are similar to those of a-amino acids.