Cordyceps, comprising over 400 species, was historically classified in the Clavicipitaceae, based on cylindrical asci, thickened ascus apices and filiform ascospores, which often disarticulate into part-spores. Cordyceps was characterized by the production of well-developed often stipitate stromata and an ecology as a pathogen of arthropods and Elaphomyces with infrageneric classifications emphasizing arrangement of perithecia, ascospore morphology and host affiliation. To refine the classification of Cordyceps and the Clavicipitaceae, the phylogenetic relationships of 162 taxa were estimated based on analyses consisting of five to seven loci, including the nuclear ribosomal small and large subunits (nrSSU and nrLSU), the elongation factor 1α (tef1), the largest and the second largest subunits of RNA polymerase II (rpb1 and rpb2), β-tubulin (tub), and mitochondrial ATP6 (atp6). Our results strongly support the existence of three clavicipitaceous clades and reject the monophyly of both Cordyceps and Clavicipitaceae. Most diagnostic characters used in current classifications of Cordyceps (e.g., arrangement of perithecia, ascospore fragmentation, etc.) were not supported as being phylogenetically informative; the characters that were most consistent with the phylogeny were texture, pigmentation and morphology of stromata. Therefore, we revise the taxonomy of Cordyceps and the Clavicipitaceae to be consistent with the multi-gene phylogeny. The family Cordycipitaceae is validated based on the type of Cordyceps, C. militaris, and includes most Cordyceps species that possess brightly coloured, fleshy stromata. The new family Ophiocordycipitaceae is proposed based on Ophiocordyceps Petch, which we emend. The majority of species in this family produce darkly pigmented, tough to pliant stromata that often possess aperithecial apices. The new genus Elaphocordyceps is proposed for a subclade of the Ophiocordycipitaceae, which includes all species of Cordyceps that parasitize the fungal genus Elaphomyces and some closely related species that parasitize arthropods. The family Clavicipitaceae s. s. is emended and includes the core clade of grass symbionts (e.g., Balansia, Claviceps, Epichloë, etc.), and the entomopathogenic genus Hypocrella and relatives. In addition, the new genus Metacordyceps is proposed for Cordyceps species that are closely related to the grass symbionts in the Clavicipitaceae s. s. Metacordyceps includes teleomorphs linked to Metarhizium and other closely related anamorphs. Two new species are described, and lists of accepted names for species in Cordyceps, Elaphocordyceps, Metacordyceps and Ophiocordyceps are provided.