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 November 23, 2004, in Amendment No. 1 to the Registration Statement (Form S-1 No. 333-120757) and related Prospectus of AlgoRx Pharmaceuticals, Inc. dated December 30, 2004. /s/ Ernst & Young LLP MetroPark, New Jersey December 30, 2004