Healthy leaves of plants are inhabited by a hyperdiversity of fungi - endophytic fungi - that are mostly unknown to science, but which frequently protect plants from pathogens, herbivores and environmental stressors. Preliminary research revealed that endophyte-like fungi also live within the thalli of asymptomatic lichens. These endolichenic fungi are also hyperdiverse and mostly unknown. Because lichens are thought to have originated earlier than most land plants, lichen thalli may have been (1) the first hosts of these cryptic fungi and (2) the substrate in which most of the early diversification of endophytic and endolichenic lineages took place. The goals of this study are to document endophytic and endolichenic fungal diversity, to reconstruct the phylogenetic relationships of these previously unknown taxa, and to estimate the directionality and frequency with which major fungal lineages have switched hosts and trophic modes, generating a framework for future hypotheses regarding the evolution of mutualism and virulence. Broader impacts include support for three female graduate students in systematics, training for four undergraduates, and development of (1) a web-accessible, tree-referenced sequence and alignment database, (2) a searchable website highlighting the fungal symbiont diversity in six newly-studied biological provinces, and (3) a new software application to improve the visualization and interpretability of complex phylogenetic results.