Background: Hypericum is an important genus in the family Hypericaceae, which includes 484 species. This genus has been grown in temperate regions and used for treating wounds, eczema and burns. The aim of this study was to predict the content of hypericin in Hypericum perforatum in varied ecological and phenological conditions of habitat using artificial neural network techniques [MLP (Multi-Layer Perceptron), RBF (Radial Basis Function) and SVM (Support Vector Machine)]. Results: According to the results, the MLP model (R2 = 0.87) had an advantage over RBF (R2 = 0.8) and SVM (R2 = 0.54) models and it was relatively accurate in predicting hypericin content in H. perforatum based on the ecological conditions of site including soil types, its characteristics and plant phenological stages of habitat. The results of sensitivity analysis revealed that phenological stages, hill aspects, total nitrogen, altitude and organic carbon are the most influential factors that have an integral effect on the content of hypericin. Conclusions: The designed graphical user interface will help pharmacognosist, manufacturers and producers of medicinal plants and so on to run the MLP model on new data to easily discover the content of hypericin in H. perforatum by entering ecological conditions of site, soil characteristics and plant phenological stages.