The selective coupling of G-protein-coupled receptors (GPCRs) to specific G proteins is critical to trigger the appropriate physiological response. However, the determinants of selective binding have remained elusive. Here we reveal the existence of a selectivity barcode (that is, patterns of amino acids) on each of the 16 human G proteins that is recognized by distinct regions on the approximately 800 human receptors. Although universally conserved positions in the barcode allow the receptors to bind and activate G proteins in a similar manner, different receptors recognize the unique positions of the G-protein barcode through distinct residues, like multiple keys (receptors) opening the same lock (G protein) using non-identical cuts. Considering the evolutionary history of GPCRs allows the identification of these selectivity-determining residues. These findings lay the foundation for understanding the molecular basis of coupling selectivity within individual receptors and G proteins.