Exhibit 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We hereby consent to the incorporation by reference in this Registration Statement onForm S-8 of X4 Pharmaceuticals, Inc. of our report dated March 11, 2019 relating to the financial statements, which appears in Arsanis, Inc.’s Annual Report onForm 10-K for the year ended December 31, 2018.
/s/ PricewaterhouseCoopers LLP
Boston, Massachusetts
August 9, 2019