Exhibit 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We hereby consent to the incorporation by reference in the Registration Statements on FormS-3 (No.333-229377) and FormS-8 (Nos.333-230499,333-230181,333-223539 and333-221622) of X4 Pharmaceuticals, Inc. (formerly known as Arsanis, Inc.) of our report dated April 2, 2019 relating to the financial statements of X4 Therapeutics, Inc. (formerly known as X4 Pharmaceuticals, Inc.), which appears in this Current Report onForm 8-K.
/s/ PricewaterhouseCoopers LLP
Boston, Massachusetts
April 2, 2019