The paper focuses on the optimization, settings and validation of direct analysis in real time coupled with time-of-flight detector when used for the evaluation of the quality of selected herbal teas (fennel, chamomile, nettle, linden, peppermint, thyme, lemon balm, marigold, sage, rose hip and St. John's wort). The ionization mode, the optimal ionization temperature and the type of solvent for sample extraction were optimized. The characteristic compounds of the analysed herbal teas (glycosides, flavonoids and phenolic and terpenic substances, such as chamazulene, anethole, menthol, thymol, salviol and hypericin) were detected. The obtained mass spectra were evaluated by multidimensional chemometric methods, such as cluster analysis, linear discriminate analysis and principal component analysis. The chemometric methods showed that the single variety herbal teas were grouped according to their taxonomic affiliation. The developed method is suitable for quick identification of herbs and can be potentially used for assessing the quality and authenticity of herbal teas. Direct analysis in real time/time-of-flight-MS is also suitable for the evaluation of selected substances contained in the mentioned herbs and herbal products. Copyright © 2017 John Wiley & Sons, Ltd.