In this report, we conduct study on codon composition and codon usage of DPV glycoprotein B (gB) gene, its homologs constitute the most highly conserved family of herpesvirus glycoproteins and are present in members of each herpesvirus subfamily. Our results show that sixty-one codons (excluding the termination codons) in the polypeptide, a high level of diversity in codon usage bias existed for coding the Ala, Gly, Leu, Pro, Arg, Ser, Thr and Val amino acids. Sixteen codons (each for a amino acid), including GCA (Ala), GAT (Asp), GAA (Glu), GGA (Gly), CAT (His), ATA (Ile), AAA (Lys), CTA (Leu), AAT (Asn), CCA (Pro), CAA (Gln), AGA (Arg), TCT (Ser), ACT (Thr), GTA (Val) and TAT (Tyr) were determined as the translationally optimal codons. The codon preferences of DPV gB gene were compared with those of E. coli, yeast, and H. sapiens, we can speculate that the DPV gB gene may be more efﬁciently expressed in the E. coli system. In summary, knowledge of codon usage of herpesvirus gB genes provides insights into molecular and species evolution, and also plays important role in furthering some biotechnological applications. These would be fruitful areas for further study.