Kojic acid naturally appears in fermented foods and can be formed during the aerobic fermentation process induced by Aspergillus and Penicillium fungi. It is widely used in the food industry because it exhibits antibacterial and antifungal properties and does not affect food taste. However, recent studies indicate that kojic acid may be a potential carcinogen. Therefore, assessing the health risks of kojic acid in fermented foods are of great importance, and developing a sensitive and accurate analytical method for this compound is a significant endeavor. Much efforts have been devoted to the detection of kojic acid using electrochemistry, high performance liquid chromatography (HPLC), gas chromatography-mass spectrometry (GC-MS), and high performance liquid chromatography-tandem mass spectrometry (HPLC-MS/MS). HPLC and HPLC-MS/MS are the analytical techniques most often employed for this purpose. Of these two methods, HPLC-MS/MS displays excellent sensitivity and is the optimal selective technique. Pretreatment is usually necessary for kojic acid determination because of the complex matrix effects of fermented foods. However, few researches on the determination of kojic acid in food are available, and, to the best of our knowledge, the determination of kojic acid using solid-phase extraction (SPE) pretreatment has not been reported yet. Herein, a convenient, sensitive, and accurate method was developed to determine kojic acid in fermented foods using solid-phase extraction-ultra performance liquid chromatography-tandem mass spectrometry (SPE-UPLC-MS/MS). The pretreatment conditions, such as the extraction solvent, cartridge, rinse solvent, and eluent, were systematically optimized. The samples, including soy sauce, vinegar, liquor, sauce, fermented soya bean, and fermented bean curd, were extracted with 0.1% formic acid-absolute ethyl alcohol and purified using a PRiME HLB cartridge. Kojic acid was separated using an ACQUITY UPLC® BEH C18 column (100 mm×2.1 mm, 1.7 μm) with formic acid-acetonitrile (1∶999, v/v) and formic acid-5 mmol/L ammonium acetate (1∶999, v/v) solutions as the mobile phases under gradient elution mode. MS was performed in electrospray positive ionization (ESI+) and multiple reaction monitoring (MRM) modes. An internal standard method was used for quantification. Under optimized conditions, good linearity was achieved at mass concentrations of 5.0-100.0 μg/L, with a correlation coefficient (r) of 0.9994. The limits of detection and quantification of the method for kojic acid were 2-5 μg/kg and 6-15 μg/kg, respectively. Good recoveries of 86.8%-111.7%, intra-day precisions of 1.0%-7.9% (n=6), and inter-day precisions of 2.7%-10.2% (n=5) were also obtained. The matrix effect was evaluated by establishing a matrix-matching calibration curve, and weak inhibitory effects were found in vinegar and liquor; moderate inhibitory effects in fermented bean curd, fermented soya bean, and soy sauce; and a strong inhibitory effect in sauce. The developed method was used to detect kojic acid in 240 fermented foods, and the results showed that the detection rate of vinegar was the highest, followed by liquor, sauce, soy sauce, fermented soya bean, and fermented bean curd, the contents were 5.69-2272 μg/kg. Matrix interferences can be significantly reduced by optimizing the pretreatment and detection procedures. The proposed method is sensitive, accurate, and can be used to analyze kojic acid in fermented foods.