Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

We consent to the incorporation by reference in the following Registration Statements:

1)Registration Statement (Form S-8 No. 333-193735) pertaining to the 2008 Equity Incentive Plan, the 2013 Equity Incentive plan and the 2013 Employee Stock Purchase Plan of Trevena, Inc.
2)Registration Statements (Form S-8 Nos. 333-195957, 333-201672, 333-208948, 333-215421, 333-222471, 333-229161, 333-235942, and 333-252350) pertaining to the 2013 Equity Incentive Plan of Trevena, Inc.
3)Registration Statement (Form S-8 No. 333-215420) pertaining to the Trevena, Inc. Inducement Plan.
4)Registration Statement (Form S-3 No. 333-225685) of Trevena Inc.
5)Registration Statement (Form S-3 No. 333-251006) of Trevena Inc.

of our report dated March 9, 2021, with respect to the financial statements of Trevena, Inc. included in this Annual Report (Form 10-K) of Trevena, Inc. for the year ended December 31, 2020.

/s/ Ernst & Young LLP

Philadelphia, Pennsylvania

March 9, 2021