Endophytic fungi from medicinal plants with specific pharmacological functions attract much attention to provide the possibility of discovering valuable natural drugs with novel structures and biological activities. Nervilia fordii is a rare and endangered karst endemic plant that is used as medicine and food homology in Guangxi, China. These plants have been reported to have antimicrobial, antitumor, antiviral, and anti-inflammatory activities. However, few studies have focused on the diversity and antibacterial activity of endophytic fungi from N. fordii. In the present study, 184 endophytic fungi were isolated from the healthy tissues of N. fordii, and their molecular diversity and antimicrobial activities were analyzed for the first time. These fungi were categorized into 85 different morphotypes based on the morphological characteristics and the similarity between the target sequence and the reference sequence in the GenBank database. With the exception of 18 unidentified fungi, the fungal isolates belonged to at least 2 phyla, 4 classes, 15 orders, 45 known genera, and 45 different species, which showed high abundance, rich diversity, and obvious tissue specificity. All isolates were employed to screen for their antimicrobial activities via the agar diffusion method against Escherichia coli, Staphylococcus aureus, and Candida tropicalis. Among these endophytes, eight strains (9.41%) displayed inhibitory activity against E. coli, 11 strains (12.94%) against S. aureus, and two strains (2.35%) against C. tropicalis, to some extent. In particular, our study showed for the first time that the fungal agar plugs of Penicillium macrosclerotiorum 1151# exhibited promising antibacterial activity against E. coli and S. aureus. Moreover, the ethyl acetate (EA) extract of P. macrosclerotiorum 1151# had antibacterial effects against E. coli and S. aureus with a minimum inhibitory concentration (MIC) of 0.5 mg ml–1. Further research also confirmed that one of the antimicrobial compounds of P. macrosclerotiorum 1151# was methyl chloroacetate and exhibited excellent antibacterial activity against E. coli and S. aureus up to 1.71-fold and 1.13-fold compared with tetracycline (TET) (5 mg ml–1), respectively. Taken together, the present data suggest that various endophytic fungi of N. fordii could be exploited as sources of novel natural antimicrobial agents.