In order to explore the endophytic fungi of Fagopyrum Mill and Avena sativa, Illumina Miseq high-throughput sequencing was used to analyze the community structure and diversity of endophytic fungi in leaves and roots of buckwheat and oat at the mature stage. The results of community structure showed that there were 205 operational taxonomic units (OTUs) in buckwheat roots and 181 OTUs in buckwheat leaves based on 97% sequence similarity level. There were 152 OTUs and 127 OTUs in the root and the leaf of oat, respectively. At the phylum level, Ascomycota and Basidiomycota were the dominant endophytic fungi in buckwheat roots and leaves, while Ascomycota was the dominant endophytic fungus in oat roots and leaves. Alpha diversity analysis showed that the Ace index, Chao index and Shannon index of buckwheat roots were higher than that of buckwheat leaves, and the three indices of oat roots were also higher than that of oat leaves, indicating that the richness and diversity of endophytic fungi community in roots were higher than that in leaves. Biomarkers were found by significant difference analysis in buckwheat and oat. The endophytic functional groups of buckwheat and oat were mainly distributed in Pathotroph and Saprotroph. The results of this study laid a foundation for fully exploiting the dominant endophytic fungal resources of buckwheat and oat and further developing microbial fertilizers.