A dilute-and-shoot based sequential window acquisition of all theoretical fragment-ion mass (SWATH-MS) approach was developed for rapid screening and determination of 23 synthetic dyes in spices. The analysis was carried out using ultra-high performance liquid chromatography-quadrupole time-of-flight mass spectrometry (UPLC-QTOF-MS) with SWATH scanning mode. The target analytes were extracted with a mix solvent system of water, acetonitrile and acetone, followed by a 5-fold dilution with methanol containing 0.1 % formic acid before analysis. The separation and detection of the 23 dyes were fulfilled in a 8 min single run under the optimized conditions. The pretreatment condition was optimzed, and validation of the method was performed in terms of selectivity, linearity, limits of detection (LODs), limits of quantitation (LOQs), matrix effect, accuracy and precision. The developed method was applied for the detection of the dyes in spices, none of the target dyes was found in 30 chilli powders and 20 cumin powder samples. Allowing the analysis of the target dyes with the advantages of simplicity, short analysis time, as well as being solvent-saving and environmentally friendly, the propesed method provide a promising alternative for rapid determination of the illegal dyes in food.