This study presents a multi-compound method for the determination of 20 pharmacologically active dyes from 5 different chemical classes in environmental water samples. These compounds, including triphenylmethane dyes (malachite green, crystal violet, brilliant green, ethyl violet, methyl violet 2B, pararosaniline, victoria blue B, victoria blue R, victoria pure blue BO), phenothiazine dyes (methylene blue, azure A, azure B, azure C, new methylene blue, thionine), phenoxazine dye (nile blue A), acridine dyes (acriflavine, proflavine) and xanthene dyes (rhodamine B, rhodamine 6G) constitute pharmacologically active substances (PASs). For the optimisation of sample preparation, different solid-phase extraction (SPE) sorbents and a wide range of pH (from 2 to 12) of water samples were tested. Finally, water samples were preconcentrated and cleaned up on diol SPE cartridges. Extracts were analysed by ultra-performance liquid chromatography-tandem mass spectrometry (UPLC-MS/MS) operating in the positive electrospray ionisation (ESI+) mode. The chromatographic separation of the 20 pharmacologically active dyes was achieved within 5 min by using a pentafluorophenyl (F5) analytical column and mobile phases of ammonium acetate buffer (0.05 M, pH = 3.5) and acetonitrile with gradient elution. The developed method was validated proving to be suitable for the determination of all tested compounds. Limits of quantification were 0.01–0.1 μg/l, are sensitive enough to quantify very low concentration levels of the dyes in environmental water samples. The obtained recovery values for all tested analytes were between 71.2 and 104.9% with a good RSD, less than 14 % at all fortification levels. The application of the developed method to water samples allows the detection of dyes such as crystal violet, rhodamine B, and methyl violet in two wastewater samples in concentration range from 0.017 to 0.0043 μg/l).