Benzene, toluene, and xylene, called BTX compounds, are broadly distributed in the environment. They frequently co-occur in air, water and soil because of common emission sources. However, these compounds differ considerably in terms of impact, in particular on human health. Due to this fact, measurement techniques are needed, which allow for identification of individual BTX compounds in the environment. The aim of the work was to show that differential ion mobility spectrometry (DMS) is capable of recognizing benzene, toluene or xylene in filtered air containing various amount of water vapor. For this purpose, the compounds recognition was represented as the classification problem. The discriminative power of DMS spectra, obtained for negative and positive ions, were explored as the basis for classification. We demonstrated that benzene, toluene, or xylene may be recognized with 100% success rate, in filtered air with varying humidity (from 0 to 77% RH). The best results, achieved with a relatively simple k-nearest neighbor classifier, were based on DMS spectrum for negative ions, recorded in full range of separation and compensation voltages. We believe, that the demonstration of a successful coupling of DMS and classification technique will contribute to further development of this analytical technique as well as its application in the environmental assessment. (C) 2016 Published by Elsevier B.V.