v3.25.2
Cover Page - shares
6 Months Ended
Jun. 30, 2025
Aug. 04, 2025
Cover [Abstract]    
Document Type 10-Q  
Document Quarterly Report true  
Document Period End Date Jun. 30, 2025  
Document Transition Report false  
Entity File Number 001-38295  
Entity Registrant Name X4 PHARMACEUTICALS, INC  
Entity Incorporation, State or Country Code DE  
Entity Tax Identification Number 27-3181608  
Entity Address, Address Line One 61 North Beacon Street  
Entity Address, Address Line Two 4th Floor  
Entity Address, City or Town Boston  
Entity Address, State or Province MA  
Entity Address, Postal Zip Code 02134  
City Area Code 857  
Local Phone Number 529-8300  
Title of 12(b) Security Common Stock, par value $0.001 per share  
Trading Symbol XFOR  
Security Exchange Name NASDAQ  
Entity Current Reporting Status Yes  
Entity Interactive Data Current Yes  
Entity Filer Category Non-accelerated Filer  
Entity Small Business true  
Entity Emerging Growth Company false  
Entity Shell Company false  
Entity Common Stock, Shares Outstanding   11,408,357
Amendment Flag false  
Document Fiscal Year Focus 2025  
Document Fiscal Period Focus Q2  
Entity Central Index Key 0001501697  
Current Fiscal Year End Date --12-31