From the saprotrophs that decay plant material to the pathogens and mutualists that shape plant demography at local and regional scales, fungi are major drivers of tropical forest dynamics. Although endophytic fungi are abundant and diverse in many biomes, they reach their greatest diversity in tropical forests, where they can influence plant physiology, performance and survival. The number of quantitative studies regarding endophytes has increased dramatically in the past two decades, but general rules have not yet emerged regarding the biogeography, host affiliations, local or regional distributions, or phylogenetic diversity of endophytes in most tropical settings. Here, endophytic fungal communities associated with 18 species of eupolypod fern were compared among forest reserves in Panama, Costa Rica and Mexico. Molecular sequence data for >2000 isolates were used to determine the relationships of host taxonomy, forest (site), and environmental dissimilarity to endophyte community composition. Communities in related ferns differed significantly among forests, reflecting the interplay of geographic distance and environmental dissimilarity. Although the same phyla and classes of fungi were prevalent at each site, they differed in relative abundance. All sites were dominated by the same order (Xylariales), but sites differed in the phylogenetic clustering vs. evenness of their endophyte communities. By addressing the relationship of endophyte communities to host taxonomy, geographic distance and environmental factors, this study complements previous work on angiosperms and contributes to a growing perspective on the factors shaping communities of ecologically important fungi in tropical forests.