A simple, rapid method using CE and microchip electrophoresis with C4D has been developed for the separation of four nonsteroidal anti‐inflammatory drugs (NSAIDs) in the environmental sample. The investigated compounds were ibuprofen (IB), ketoprofen (KET), acetylsalicylic acid (ASA), and diclofenac sodium (DIC). In the present study, we applied for the first time microchip electrophoresis with C4D detection to the separation and detection of ASA, IB, DIC, and KET in the wastewater matrix. Under optimum conditions, the four NSAIDs compounds could be well separated in less than 1 min in a BGE composed of 20 mM His/15 mM Tris, pH 8.6, 2 mM hydroxypropyl‐beta‐cyclodextrin, and 10% methanol (v/v) at a separation voltage of 1000–1200 V. The proposed method showed excellent repeatability, good sensitivity (LODs ranging between 0.156 and 0.6 mg/L), low cost, high sample throughputs, portable instrumentation for mobile deployment, and extremely lower reagent and sample consumption. The developed method was applied to the analysis of pharmaceuticals in wastewater samples with satisfactory recoveries ranging from 62.5% to 118%.