The present study aimed to extract pesticide residues in the field and greenhouse-grown tomatoes and homemade paste based on the (QuEChERS) method before being determined by liquid chromatography-mass spectrometry (LC-MS). The mean difference in percentage reduction of deltamethrin (DLM) and acetamiprid (ACT) in raw tomatoes of greenhouse-grown was obtained at 91.42 and 90.00%, respectively, which was insignificantly more than filed condition (84.91% and 86.34%). Maximum reduction percentages of the DLM in paste under greenhouse and field tomato conditions were achieved by more than 95.86% and 93.11%, respectively. The residual concentration of both DLM (91.42%) and ACT (90.00%) in the greenhouse decreased more than the field (84.91% and 86.34%), respectively. Abamectin(ABA) reached below the MRL in a shorter time after spraying (2 days). Considering the pre-harvest interval (PHI) period of deltamethrin and abamectin can reach their residual concentration to the MRL in both conditions, which were determined by LC-MS. According to the results of the current study, 7 and 5 days can be suggested as the PHI period of the acetamiprid for field and greenhouse-grown tomatoes, respectively. Therefore, using pesticides in the proper dosage, considering appropriate PHI, and harvesting can reduce their residues in agricultural products.