To facilitate the biochemical study of posttranslationally modified proteins, we have developed a strategy in which otherwise posttranslationally modified amino acids are genetically encoded in Escherichia coli in response to unique nonsense or frameshift codons. Here, we illustrate the utility of this approach through the characterization of the doubly tyrosine-sulfated anti-gp120 antibody, 412d. By expressing selectively sulfated variants of 412d directly in E. coli with an orthogonal aminoacyl-tRNA synthetase/tRNA pair specific for sulfotyrosine, we were able to determine the contribution of each of the sulfates in 412d to gp120 binding affinity: tyrosine sulfation of 412d at position H100, position H100c, or dual sulfation at both positions (Kabat numbering where H designates heavy chain) leads to an increase in affinity for gp120 of 4.5-fold, 212-fold, or 500-fold, respectively. We also conducted directed evolution experiments to evolve 412d beyond the known sequence constraints required for posttranslational sulfation, while retaining the two tyrosine sulfates essential for function, yielding novel doubly sulfated antibodies, one of which binds gp120 with subnanomolar affinity. Taken together, our studies provide a more complete understanding of the role of 412d sulfation in gp120 binding and highlight the utility of genetically encoded unnatural amino acids in exploring the effects of posttranslational modifications on protein function.