Non-steroidal anti-inflammatory drugs (NSAIDs) are one of the most commonly prescribed drugs that can reduce pain. This study aimed to measure the concentration of piroxicam and celecoxib in Iranian hospitals, as well as the effect of electron beam irradiation on the degradation of these pollutants in synthetic and real samples. The high-performance liquid chromatography (HPLC) was used to detect the residual analytes in the samples. The Response Surface Methodology (RSM) was used to design the experiment conditions that investigate the effect of electron beam irradiation on degradation of piroxicam and celecoxib from synthetic samples, and then according to the optimum condition, the experiments were carried out for real wastewater samples. The results of wastewater analysis shown that the mean concentration of PIRO and CELE were 6.32 ± 2.5 and 11.5 ± 3.2 μg/L, respectively. Also, the findings show that 98.98 % and 97.62 % of piroxicam and celecoxib was degraded, respectively, when the optimum conditions (pH = 4, electron beam irradiation = 8 kGy, and concentrations of 60 μg/L for piroxicam and 50 μg/L for celecoxib) were applied. Results show that the degradation rates of piroxicam and celecoxib in the real wastewater sample at optimum condition were 89.6 % and 84.25 %, respectively. So, electron beam irradiation is a long-lasting and promising method for removal emerging contaminants from wastewater, like non-steroidal anti-inflammatory drugs, that can't be removed by conventional wastewater treatment methods; so, it can be used in combination with conventional wastewater treatment methods.