Herpesviruses comprise an abundant, widely distributed group of large DNA viruses of humans and other vertebrates, and overall are among the most extensively studied large DNA viruses. Many herpesvirus genome sequences have been determined, and interpreted in terms of gene contents to give detailed views of both ubiquitous and lineage-specific functions. Availability of gene sequences has also enabled evaluations of evolutionary relationships. For herpesviruses of mammals, a robust phylogenetic tree has been constructed, which shows many features characteristic of synchronous development of virus and host lineages over large evolutionary timespans. It has also emerged that three distinct groupings of herpesviruses exist: the first containing viruses with mammals, birds and reptiles as natural hosts; the second containing viruses of amphibians and fish; and the third consisting of a single invertebrate herpesvirus. Within each of the first two groups, the genomes show clear evidence of descent from a common ancestor, but relationships between the three groups are extremely remote. Detailed analyses of capsid structures provide the best evidence for a common origin of the three groups. At a finer level, the structure of the capsid shell protein further suggests an element of common origin between herpesviruses and tailed DNA bacteriophages.