Soil microorganisms could affect the quality of tobacco leaves, however, little is known about the association of tobacco chemical components and soil fungal communities. In the present study, the relationship between soil fungi and tobacco quality based on chemical components in Bijie was investigated. The results showed that the total harmony scores (THS) of the analyzed tobacco leaves ranged from 46.55 ± 3.5 to 91.55 ± 2.25. Analyses of chemical components revealed that high contents of nicotine (≥ 1.06%) and sugar (total sugar: ≥ 22.96%, reducing sugar: ≥ 19.62%), as well as low potassium level (≤ 2.68%) were the main factors limiting the quality of flue-cured tobacco leaves. Pearson correlation analysis indicated that soil nitrate, available potassium/phosphorous, and organic matter significantly correlated with tobacco nicotine, potassium, and chloride levels (p < 0.05). Besides, the analysis of alpha- and beta-diversity of soil fungal communities implied that fungal structure rather than the richness affected the chemical quality of tobacco. In detail, the relative abundance of Humicola olivacea species in soils was positively correlated with the THS of tobaccos (r = 0.52, p < 0.05). Moreover, the species including Mortierella alpina, Mortierella hyalina, Tausonia pullulan, and Humicola olivacea were negatively correlated with tobacco sugar (r ≤ − 0.45, p < 0.05) while, Codinaea acaciae and Saitozyma podzolica species were negatively correlated with tobacco nicotine (r ≤ − 0.51, p < 0.05). The present study provides a preliminary basis for utilizing fungal species in soils to improve the chemical quality of tobacco in the studied area.