CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We consent to the incorporation by reference in this Registration Statement (Form S-8) of Territorial Bancorp Inc. of our report dated March 15, 2019, relating to the consolidated financial statements and the
effectiveness of internal control over financial reporting of Territorial Bancorp, Inc. which report appears in the Form 10-K of Territorial Bancorp Inc. for the year ended December 31, 2018.
/s/ Moss Adams LLP
Portland, Oregon
March 9, 2020