Selenocysteine (Sec or U) is encoded by UGA, a stop codon reassigned by a Sec-specific elongation factor and a distinctive RNA structure. To discover possible code variations in extant organisms we analyzed 6.4 trillion base pairs of metagenomic sequences and 24 903 microbial genomes for tRNA(Sec) species. As expected, UGA is the predominant Sec codon in use. We also found tRNA(Sec) species that recognize the stop codons UAG and UAA, and ten sense codons. Selenoprotein synthesis programmed by UAG in Geodermatophilus and Blastococcus, and by the Cys codon UGU in Aeromonas salmonicida was confirmed by metabolic labeling with (75) Se or mass spectrometry. Other tRNA(Sec) species with different anticodons enabled E. coli to synthesize active formate dehydrogenase H, a selenoenzyme. This illustrates the ease by which the genetic code may evolve new coding schemes, possibly aiding organisms to adapt to changing environments, and show the genetic code is much more flexible than previously thought.