Exhibit 23.1 Consent of Independent Registered Public Accounting Firm We consent to the reference to our firm under the caption "Experts" and to the use of our report dated February 2, 2005 (except Note 14, as to which date is February 4, 2005), in Amendment No. 4 to the Registration Statement (Form S-1 No. 333-120757) and related Prospectus of AlgoRx Pharmaceuticals, Inc. dated February 10, 2005. /s/ Ernst & Young LLP MetroPark, New Jersey February 9, 2005