Formaldehyde in food was determined by gas chromatography-mass spectrometry with selected ion monitor (GC-MS-SIM). The conditions of extraction and derivation were optimized. Formaldehyde was ~extracted for 40 min with ultrasonic wave and reacted for 6 h with 2,4-dinitrophenyldrazine (DNPH) to form hydrazone, then hydrazone was determined by GC-MS-SIM. The selected ions of 2,4-dinitrophenyldrazone were ~m/z 210 and m/z 79. The method could avoid the disturance of impurity in food, and was proved to be accurate and reliable. The recovery was in the range of ~88.4%~93.8% and the RSD was less than 7%, the limit of determination was 0.1 mg/kg. The method has been applied to the determination of formaldehyde in food.