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 (except Note 13, as to which date is January 19, 2005), in Amendment No. 2 to the Registration Statement (Form S-1 No. 333-120757) and related Prospectus of AlgoRx Pharmaceuticals, Inc. dated January 20, 2005. Ernst & Young LLP MetroPark, New Jersey The foregoing consent is in the form that will be signed upon the completion of the restatement of the capital accounts described in Note 13 to the financial statements. /s/ Ernst & Young LLP MetroPark, New Jersey January 19, 2005