In many organisms codon usage is biased, with certain synonymous codons preferred over others. It is less well known that within open reading frames codon pairing is also subject to significant bias. In this study we tested the hypothesis that the process of mRNA translation exerts a selective force on codon pair preference. A series of bioinformatic tools was created to analyse codon pair bias within bacterial and eukaryotic genomes. Cluster analysis was used to identify ribosomal P site (5') and A site (3') codons with similar pairing preferences. This revealed that the combined identities of the third P site nucleotide (P3) and the first A site nucleotide (A1) exert a key influence over codon pair bias. Other nucleotide combinations (P3-A2, P3-A3) within the two codons also modulate pairing preferences, indicating that codon-anticodon interactions act as a selective force on codon pair preference. In the genomes of Bacillus subtilis, Saccharomyces cerevisiae, and many of the gamma proteobacteria, there is also strong evidence that translational selection is operating. In these genomes, codons in the ribosomal A site that are decoded by the same tRNA isoacceptor exhibit highly similar codon pairing preferences. This suggests that codon pair selection is influenced by tRNA-mRNA interactions in the ribosomal A-site. Supporting this, multivariate analysis identified individual sequence elements within A-site tRNAs that affect codon pairing. In conclusion, we propose that in some genomes, optimal tRNA juxtaposition within the ribosome drives selection of codon pair preference. Such pairing may be an important factor enhancing translation rate or fidelity.