Nonsteroidal anti-inflammatory drugs (NSAIDs) are widely used pharmaceuticals to treat pain, fever and inflammation. NSAIDs are also known to have many side effects including adverse effects on reproduction in both humans and animals. As NSAIDs usage is not regulated they are frequently detected at high concentrations in the environment. In order to understand the effect of NSAIDs on zebrafish sex differentiation, we used seven different NSAIDs which were either Cox-1 selective, Cox-1 biased, non-selective or COX-2 selective. We show that at higher concentration, NSAIDs are toxic to zebrafish embryo as they lead to mortality and hatching delay. Gene expression analysis following short term exposure of NSAIDs led to downregulation of female specific genes including zp2, vtg2 foxl2 and wnt4. Long term exposure of larvae to environmentally relevant concentrations of Cox-2 selective and non-selective NSAIDs resulted in male-biased sex ratio which confirmed the qRT-PCR analysis. However, the Cox-1 selective acetylsalicylic acid and the Cox-1 biased ketoprofen did not alter sex ratio. The observed male-biased sex ratio could also be due to induction of apoptosis process as the genes including p21 and casp8 were significantly upregulated following exposure to the Cox-2 selective and the non-selective NSAIDs. The present study indicates that NSAIDs alter sex differentiation in zebrafish, primarily through inhibition of Cox-2. This study clearly demonstrates that the use of NSAIDs and their release into the aquatic environment should be carefully monitored to avoid adverse effects to the aquatic organisms.