The binding affinity between an antigenic peptide and its particular major histocompatibility complex (MHC) molecule seems to be largely determined by only a few residues. These residues have been called "anchors" because of their property of fitting into "pockets" inside the groove of the MHC molecule. To predict natural antigenic epitopes within a longer sequence, it therefore appears to be important to know the motif or pattern describing the anchors, i.e. the anchors amino acid residue preference and the distance between anchor residues. A large set of MHC class I-restricted peptides has been described. Peptide sequences vary in length and lack an obvious common sequence motif. For a list of peptides belonging to one type of MHC class I molecule, we describe a method to find the most prominent sequence motif with at least two anchor residues. Briefly, antigenic sequences are aligned, and two anchor positions are searched for, where all anchor residues share a high similarity. The alignments are scored according to the similarity of their anchor residues. We show that the motifs predicted for the MHC alleles A2.1, B27, Kb, Kd, Db are in substantial agreement with experimental data. We derive binding motifs for the MHC class I alleles HLA-A1, A11, B8, B14, H-2Ld and for the MHC class II alleles I-Ab and I-As. In some cases, higher scores were obtained by allowing a slight variation in the number of residues between anchors. Therefore, we support the view that the length of epitopes belonging to a particular class I MHC is not uniform. This method can be used to predict the natural short epitope inside longer antigenic peptides and to predict the epitopes anchor residues. Anchor motifs can be used to search for antigenic regions in sequences of infectious viruses, bacteria and parasites.