Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

We hereby consent to the incorporation by reference in this Registration Statement on Form S-8 of Royal Bank of Canada of our report dated November 29, 2022 relating to the consolidated financial statements and effectiveness of internal control over financial reporting, which appears in Exhibit 2 to Royal Bank of Canada’s Annual Report on Form 40-F for the year ended October 31, 2022.

We also consent to the reference to us under the heading “Experts” in the Annual Information Form, which is filed as Exhibit 1 to Royal Bank of Canada’s Annual Report on Form 40-F for the year ended October 31, 2022, which is incorporated by reference in such Registration Statement.

/s/ PricewaterhouseCoopers LLP

Chartered Professional Accountants, Licensed Public Accountants

Toronto, Canada

December 8, 2022