<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2023 Workiva-->
<!--r:63e64609-d034-4c0c-8490-3f281d38846f,g:3b404fd3-85d3-4343-9268-07f61042fc83-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:roleRef roleURI="http://www.x4pharma.com/role/ConsolidatedBalanceSheets" xlink:type="simple" xlink:href="xfor-20221231.xsd#ConsolidatedBalanceSheets"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/ConsolidatedBalanceSheets" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_a657cce7-e86e-42dc-bab9-6756f0e13f5a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_ac4bee7b-fd7f-45e5-8e60-f3298bde98ba" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetsCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_a657cce7-e86e-42dc-bab9-6756f0e13f5a" xlink:to="loc_us-gaap_AssetsCurrent_ac4bee7b-fd7f-45e5-8e60-f3298bde98ba" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_20a71cb3-05b7-4dac-bf91-b08f1ecb7dae" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_a657cce7-e86e-42dc-bab9-6756f0e13f5a" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_20a71cb3-05b7-4dac-bf91-b08f1ecb7dae" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_0f60db2f-93c1-4e62-9730-4bb8c84cc441" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_a657cce7-e86e-42dc-bab9-6756f0e13f5a" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_0f60db2f-93c1-4e62-9730-4bb8c84cc441" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_8966ef9a-6cb5-48e8-b32c-a8e6888434c2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Goodwill"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_a657cce7-e86e-42dc-bab9-6756f0e13f5a" xlink:to="loc_us-gaap_Goodwill_8966ef9a-6cb5-48e8-b32c-a8e6888434c2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent_25ebc323-6ba9-4f78-9600-a5f2d2a51dcd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_a657cce7-e86e-42dc-bab9-6756f0e13f5a" xlink:to="loc_us-gaap_OtherAssetsNoncurrent_25ebc323-6ba9-4f78-9600-a5f2d2a51dcd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_9ee5c1c2-7e3c-4d01-98e7-974ea1fc639d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValue_ac4a242c-2c90-4244-b9cd-92f9cb509751" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_9ee5c1c2-7e3c-4d01-98e7-974ea1fc639d" xlink:to="loc_us-gaap_CommonStockValue_ac4a242c-2c90-4244-b9cd-92f9cb509751" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_0c28d08d-57ab-4369-9568-a50068a00c8e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_9ee5c1c2-7e3c-4d01-98e7-974ea1fc639d" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_0c28d08d-57ab-4369-9568-a50068a00c8e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalCommonStock_c9f70dad-a20b-4a32-949f-6094a0954164" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AdditionalPaidInCapitalCommonStock"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_9ee5c1c2-7e3c-4d01-98e7-974ea1fc639d" xlink:to="loc_us-gaap_AdditionalPaidInCapitalCommonStock_c9f70dad-a20b-4a32-949f-6094a0954164" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_30a199d9-602e-438b-8b69-b817dcd1f41b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_9ee5c1c2-7e3c-4d01-98e7-974ea1fc639d" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_30a199d9-602e-438b-8b69-b817dcd1f41b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_9bbfb56b-69a5-498c-a935-d2ed3ce36b73" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_88418f01-f142-4292-b029-8cbeebf10220" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9bbfb56b-69a5-498c-a935-d2ed3ce36b73" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_88418f01-f142-4292-b029-8cbeebf10220" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_8b32af73-f54b-4dd8-ba5b-6f46b8680816" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9bbfb56b-69a5-498c-a935-d2ed3ce36b73" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent_8b32af73-f54b-4dd8-ba5b-6f46b8680816" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent_2610c768-ba89-48de-a082-c805c59b1fbf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9bbfb56b-69a5-498c-a935-d2ed3ce36b73" xlink:to="loc_us-gaap_AccountsPayableCurrent_2610c768-ba89-48de-a082-c805c59b1fbf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtCurrent_b9bea61f-ce7b-4ba4-bdac-4348453bdd25" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtCurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9bbfb56b-69a5-498c-a935-d2ed3ce36b73" xlink:to="loc_us-gaap_LongTermDebtCurrent_b9bea61f-ce7b-4ba4-bdac-4348453bdd25" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_3bc57965-bc21-4bdc-8dcf-a4a11c655854" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_b342306c-cf71-4255-beee-55b642867cb0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Liabilities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_3bc57965-bc21-4bdc-8dcf-a4a11c655854" xlink:to="loc_us-gaap_Liabilities_b342306c-cf71-4255-beee-55b642867cb0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_a34e3b65-937b-4291-8b4c-4d790b8eec34" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquity"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_3bc57965-bc21-4bdc-8dcf-a4a11c655854" xlink:to="loc_us-gaap_StockholdersEquity_a34e3b65-937b-4291-8b4c-4d790b8eec34" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingencies_cac9add3-8e94-4e27-816e-d6f3c5426034" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommitmentsAndContingencies"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_3bc57965-bc21-4bdc-8dcf-a4a11c655854" xlink:to="loc_us-gaap_CommitmentsAndContingencies_cac9add3-8e94-4e27-816e-d6f3c5426034" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_e8f255fe-ca26-413e-914b-2e2d84f6d67b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Liabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LongTermDebtNonCurrentIncludingAccrection_24dadd1c-50c8-493f-96fc-7c75b06151e9" xlink:href="xfor-20221231.xsd#xfor_LongTermDebtNonCurrentIncludingAccrection"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_e8f255fe-ca26-413e-914b-2e2d84f6d67b" xlink:to="loc_xfor_LongTermDebtNonCurrentIncludingAccrection_24dadd1c-50c8-493f-96fc-7c75b06151e9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesNoncurrent_d5bf70a2-6748-4e79-a819-e460927a53eb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherLiabilitiesNoncurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_e8f255fe-ca26-413e-914b-2e2d84f6d67b" xlink:to="loc_us-gaap_OtherLiabilitiesNoncurrent_d5bf70a2-6748-4e79-a819-e460927a53eb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_b4b8998b-4d02-449d-b2f6-f66553e49f45" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_e8f255fe-ca26-413e-914b-2e2d84f6d67b" xlink:to="loc_us-gaap_LiabilitiesCurrent_b4b8998b-4d02-449d-b2f6-f66553e49f45" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_2b41a27d-5297-44b5-886b-3d662cf3bfa9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_e8f255fe-ca26-413e-914b-2e2d84f6d67b" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_2b41a27d-5297-44b5-886b-3d662cf3bfa9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilitiesNoncurrent_f46d35ac-6a63-41f8-8c10-986c26cddf35" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeLiabilitiesNoncurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_e8f255fe-ca26-413e-914b-2e2d84f6d67b" xlink:to="loc_us-gaap_DerivativeLiabilitiesNoncurrent_f46d35ac-6a63-41f8-8c10-986c26cddf35" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_701873e1-0aaf-47dd-a396-7982377528d3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetsCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ResearchAndDevelopmentIncentiveReceivable_243a23b2-3296-400e-b120-57015c44d2dd" xlink:href="xfor-20221231.xsd#xfor_ResearchAndDevelopmentIncentiveReceivable"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_701873e1-0aaf-47dd-a396-7982377528d3" xlink:to="loc_xfor_ResearchAndDevelopmentIncentiveReceivable_243a23b2-3296-400e-b120-57015c44d2dd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_0db7580d-f92f-4136-9f7d-c9cf588ac448" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_701873e1-0aaf-47dd-a396-7982377528d3" xlink:to="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_0db7580d-f92f-4136-9f7d-c9cf588ac448" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_7d3eb13a-d93b-42bd-bdbf-a3822f147b32" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_701873e1-0aaf-47dd-a396-7982377528d3" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_7d3eb13a-d93b-42bd-bdbf-a3822f147b32" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/ConsolidatedStatementsofOperationsandComprehensiveLoss" xlink:type="simple" xlink:href="xfor-20221231.xsd#ConsolidatedStatementsofOperationsandComprehensiveLoss"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/ConsolidatedStatementsofOperationsandComprehensiveLoss" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingExpenses_778df5d6-edc6-4883-9d7f-d674d80169b3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingExpenses"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GeneralAndAdministrativeExpense_9d5b9609-35b5-4781-a31a-a69856cc18c3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GeneralAndAdministrativeExpense"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_778df5d6-edc6-4883-9d7f-d674d80169b3" xlink:to="loc_us-gaap_GeneralAndAdministrativeExpense_9d5b9609-35b5-4781-a31a-a69856cc18c3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpense_84ea8129-f97d-4c2b-9451-4c68bee88a40" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ResearchAndDevelopmentExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_778df5d6-edc6-4883-9d7f-d674d80169b3" xlink:to="loc_us-gaap_ResearchAndDevelopmentExpense_84ea8129-f97d-4c2b-9451-4c68bee88a40" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnDispositionOfIntangibleAssets_ce42cdc4-7788-45f7-a1d2-f034f75e567c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GainLossOnDispositionOfIntangibleAssets"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_778df5d6-edc6-4883-9d7f-d674d80169b3" xlink:to="loc_us-gaap_GainLossOnDispositionOfIntangibleAssets_ce42cdc4-7788-45f7-a1d2-f034f75e567c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillImpairmentLoss_1179f53f-aeb6-411c-8597-377b571da8f0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillImpairmentLoss"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingExpenses_778df5d6-edc6-4883-9d7f-d674d80169b3" xlink:to="loc_us-gaap_GoodwillImpairmentLoss_1179f53f-aeb6-411c-8597-377b571da8f0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_99f7a21a-3204-4d0f-8b2e-41e38fc0c61d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_e86d9aaf-4800-42ac-9ad8-f835a638fc53" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_99f7a21a-3204-4d0f-8b2e-41e38fc0c61d" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_e86d9aaf-4800-42ac-9ad8-f835a638fc53" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_917ed40e-ff0e-46c9-a229-c8501ca4daa8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_99f7a21a-3204-4d0f-8b2e-41e38fc0c61d" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_917ed40e-ff0e-46c9-a229-c8501ca4daa8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_30e47676-b659-47b2-bcd4-2389de41e9f5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_6ad227d5-d488-4bdd-a8a7-514aeeade64e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_30e47676-b659-47b2-bcd4-2389de41e9f5" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_6ad227d5-d488-4bdd-a8a7-514aeeade64e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_5c05d887-69d1-46a3-8349-2cee81df00aa" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InterestExpense"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_30e47676-b659-47b2-bcd4-2389de41e9f5" xlink:to="loc_us-gaap_InterestExpense_5c05d887-69d1-46a3-8349-2cee81df00aa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainsLossesOnExtinguishmentOfDebt_463dc3dc-691c-4863-80f6-ebcf9bd24856" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GainsLossesOnExtinguishmentOfDebt"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_30e47676-b659-47b2-bcd4-2389de41e9f5" xlink:to="loc_us-gaap_GainsLossesOnExtinguishmentOfDebt_463dc3dc-691c-4863-80f6-ebcf9bd24856" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_d9f50b5e-4146-420b-8a29-0cdccfbe61b6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_30e47676-b659-47b2-bcd4-2389de41e9f5" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_d9f50b5e-4146-420b-8a29-0cdccfbe61b6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInterest_5448703e-6db2-4c34-a631-a6f3131ec06d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InvestmentIncomeInterest"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_30e47676-b659-47b2-bcd4-2389de41e9f5" xlink:to="loc_us-gaap_InvestmentIncomeInterest_5448703e-6db2-4c34-a631-a6f3131ec06d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_3f22e950-040b-4164-83ba-af95e63d805e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingExpenses_d10f7aa0-7694-4b90-9790-a3b8e8fe4635" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingExpenses"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_3f22e950-040b-4164-83ba-af95e63d805e" xlink:to="loc_us-gaap_OperatingExpenses_d10f7aa0-7694-4b90-9790-a3b8e8fe4635" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_2972ea57-f891-47b9-a848-4924a1c69347" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_3f22e950-040b-4164-83ba-af95e63d805e" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_2972ea57-f891-47b9-a848-4924a1c69347" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAvailableToCommonStockholdersBasic_d722ee7f-eb62-4823-a943-ca2aa0f94ed3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLossAvailableToCommonStockholdersBasic"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_01571856-a8a0-4518-99cc-ffa3066b4b78" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAvailableToCommonStockholdersBasic_d722ee7f-eb62-4823-a943-ca2aa0f94ed3" xlink:to="loc_us-gaap_NetIncomeLoss_01571856-a8a0-4518-99cc-ffa3066b4b78" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_TemporaryEquityRepurchaseOfConvertiblePreferredStock_2a36e37a-7aa8-4c48-8d49-6a3c02ff3250" xlink:href="xfor-20221231.xsd#xfor_TemporaryEquityRepurchaseOfConvertiblePreferredStock"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAvailableToCommonStockholdersBasic_d722ee7f-eb62-4823-a943-ca2aa0f94ed3" xlink:to="loc_xfor_TemporaryEquityRepurchaseOfConvertiblePreferredStock_2a36e37a-7aa8-4c48-8d49-6a3c02ff3250" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f1f127dc-b459-4d3c-9579-44f3c2fed1fd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_1d32d68d-d9b4-4422-9231-57c09f3b3889" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f1f127dc-b459-4d3c-9579-44f3c2fed1fd" xlink:to="loc_us-gaap_OperatingIncomeLoss_1d32d68d-d9b4-4422-9231-57c09f3b3889" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_32b6a5f0-f838-45f8-9c55-f7e8ab2ffa3d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_f1f127dc-b459-4d3c-9579-44f3c2fed1fd" xlink:to="loc_us-gaap_NonoperatingIncomeExpense_32b6a5f0-f838-45f8-9c55-f7e8ab2ffa3d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/ConsolidatedStatementsofCashFlows" xlink:type="simple" xlink:href="xfor-20221231.xsd#ConsolidatedStatementsofCashFlows"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/ConsolidatedStatementsofCashFlows" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_f16a74a3-0d8d-4502-88a3-0faa45fc447f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_40e793c6-3f7f-4300-9b5c-0e0d52dbbd23" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_f16a74a3-0d8d-4502-88a3-0faa45fc447f" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_40e793c6-3f7f-4300-9b5c-0e0d52dbbd23" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_7f5f4e13-44b5-476b-9ad4-add76e39b014" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_f16a74a3-0d8d-4502-88a3-0faa45fc447f" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_7f5f4e13-44b5-476b-9ad4-add76e39b014" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_75c4e354-b61c-4127-ab34-6bd62d8b6dfc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_f16a74a3-0d8d-4502-88a3-0faa45fc447f" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_75c4e354-b61c-4127-ab34-6bd62d8b6dfc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_5eb0fb80-888b-44db-b125-f3ae9a201e9c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_f16a74a3-0d8d-4502-88a3-0faa45fc447f" xlink:to="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_5eb0fb80-888b-44db-b125-f3ae9a201e9c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_24833a4e-01d8-47b4-b9fe-393712c4ce04" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireProductiveAssets_ec0d5b7a-d900-4e54-9b8a-6f69bb9ad26e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PaymentsToAcquireProductiveAssets"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_24833a4e-01d8-47b4-b9fe-393712c4ce04" xlink:to="loc_us-gaap_PaymentsToAcquireProductiveAssets_ec0d5b7a-d900-4e54-9b8a-6f69bb9ad26e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_e8d2dc3b-33e7-431f-9807-e03ac3528df3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_e8d2dc3b-33e7-431f-9807-e03ac3528df3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfitLoss_e73d4faa-2f31-4598-b653-784e35b48c35" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ProfitLoss"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_ProfitLoss_e73d4faa-2f31-4598-b653-784e35b48c35" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IncreaseDecreaseInLeaseLiabilities_9058265d-76e9-49bf-8dab-7ee9e7e26e4d" xlink:href="xfor-20221231.xsd#xfor_IncreaseDecreaseInLeaseLiabilities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_xfor_IncreaseDecreaseInLeaseLiabilities_9058265d-76e9-49bf-8dab-7ee9e7e26e4d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ChangeInFairValueOfConvertiblePreferredStockWarrantLiability_ff3544cb-718e-4aef-af78-c2ec282434ff" xlink:href="xfor-20221231.xsd#xfor_ChangeInFairValueOfConvertiblePreferredStockWarrantLiability"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_xfor_ChangeInFairValueOfConvertiblePreferredStockWarrantLiability_ff3544cb-718e-4aef-af78-c2ec282434ff" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationDepletionAndAmortization_b4c93a98-4a6b-468d-bb39-d7343c93defa" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DepreciationDepletionAndAmortization"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_DepreciationDepletionAndAmortization_b4c93a98-4a6b-468d-bb39-d7343c93defa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_NonCashLeaseExpense_e1759b9c-a80a-41a1-9761-6fd969ee6507" xlink:href="xfor-20221231.xsd#xfor_NonCashLeaseExpense"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_xfor_NonCashLeaseExpense_e1759b9c-a80a-41a1-9761-6fd969ee6507" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_NonCashInterestExpense_88101af7-fae1-46d8-aaec-8b160926df8d" xlink:href="xfor-20221231.xsd#xfor_NonCashInterestExpense"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_xfor_NonCashInterestExpense_88101af7-fae1-46d8-aaec-8b160926df8d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities_96591a7a-da9f-4be5-9073-bea3ca585580" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilities"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities_96591a7a-da9f-4be5-9073-bea3ca585580" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainsLossesOnExtinguishmentOfDebt_de8544a5-badb-4c6b-8696-f36fc3248c8e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GainsLossesOnExtinguishmentOfDebt"/>
    <link:calculationArc order="9" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_GainsLossesOnExtinguishmentOfDebt_de8544a5-badb-4c6b-8696-f36fc3248c8e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation_f2ff36a4-aa31-451a-998b-56d08fe4d532" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensation"/>
    <link:calculationArc order="10" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_ShareBasedCompensation_f2ff36a4-aa31-451a-998b-56d08fe4d532" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayable_477bd3b8-4368-4bf4-b513-bf9c609f190a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInAccountsPayable"/>
    <link:calculationArc order="11" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayable_477bd3b8-4368-4bf4-b513-bf9c609f190a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNoncashIncomeExpense_09df1c7f-de6e-4007-8191-561d0b0b22b3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherNoncashIncomeExpense"/>
    <link:calculationArc order="12" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_OtherNoncashIncomeExpense_09df1c7f-de6e-4007-8191-561d0b0b22b3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IncreaseDecreaseInOperatingLeaseRightOfUseAssetNonCashPotion_12ad8eee-b196-44ab-baf5-3a8dcca8bd22" xlink:href="xfor-20221231.xsd#xfor_IncreaseDecreaseInOperatingLeaseRightOfUseAssetNonCashPotion"/>
    <link:calculationArc order="13" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_xfor_IncreaseDecreaseInOperatingLeaseRightOfUseAssetNonCashPotion_12ad8eee-b196-44ab-baf5-3a8dcca8bd22" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillImpairmentLoss_744f9e4e-4c2c-420f-8e77-2dd0a0b2517c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillImpairmentLoss"/>
    <link:calculationArc order="14" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_5535cfc8-04e1-4d1f-88c4-78aaf4ffbaf5" xlink:to="loc_us-gaap_GoodwillImpairmentLoss_744f9e4e-4c2c-420f-8e77-2dd0a0b2517c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5ee330e2-4e95-4e45-a86a-f2e0a5f8fb3a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfLongTermDebt_88538113-071f-4b2a-8665-c961990b90e1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RepaymentsOfLongTermDebt"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5ee330e2-4e95-4e45-a86a-f2e0a5f8fb3a" xlink:to="loc_us-gaap_RepaymentsOfLongTermDebt_88538113-071f-4b2a-8665-c961990b90e1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ProceedsFromIssuanceOrSaleOfEquityNetOfIssuanceCosts_a6660ef6-c52a-4edf-b47e-43e53ea3a931" xlink:href="xfor-20221231.xsd#xfor_ProceedsFromIssuanceOrSaleOfEquityNetOfIssuanceCosts"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5ee330e2-4e95-4e45-a86a-f2e0a5f8fb3a" xlink:to="loc_xfor_ProceedsFromIssuanceOrSaleOfEquityNetOfIssuanceCosts_a6660ef6-c52a-4edf-b47e-43e53ea3a931" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ProceedsFromExerciseOfStockOptionsAndWarrants_83993659-7b2c-422d-904b-e778db2fcea3" xlink:href="xfor-20221231.xsd#xfor_ProceedsFromExerciseOfStockOptionsAndWarrants"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5ee330e2-4e95-4e45-a86a-f2e0a5f8fb3a" xlink:to="loc_xfor_ProceedsFromExerciseOfStockOptionsAndWarrants_83993659-7b2c-422d-904b-e778db2fcea3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfOtherLongTermDebt_0de73dbd-da9e-4f95-8afc-0d2cc6819e26" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ProceedsFromIssuanceOfOtherLongTermDebt"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5ee330e2-4e95-4e45-a86a-f2e0a5f8fb3a" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfOtherLongTermDebt_0de73dbd-da9e-4f95-8afc-0d2cc6819e26" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_d0ef5cf2-3c75-49b4-aec6-a7da0f5523b0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5ee330e2-4e95-4e45-a86a-f2e0a5f8fb3a" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_d0ef5cf2-3c75-49b4-aec6-a7da0f5523b0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_c88cd9d8-4d60-4639-bd26-1f5ab12c9e85" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5ee330e2-4e95-4e45-a86a-f2e0a5f8fb3a" xlink:to="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_c88cd9d8-4d60-4639-bd26-1f5ab12c9e85" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceCostsRelatedToSaleOfWarrantsAndFeesPaidForAmendmentsToLoanAndSecurityAgreement_6e8ceffe-1f95-4d14-bba0-e3165647819e" xlink:href="xfor-20221231.xsd#xfor_IssuanceCostsRelatedToSaleOfWarrantsAndFeesPaidForAmendmentsToLoanAndSecurityAgreement"/>
    <link:calculationArc order="7" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5ee330e2-4e95-4e45-a86a-f2e0a5f8fb3a" xlink:to="loc_xfor_IssuanceCostsRelatedToSaleOfWarrantsAndFeesPaidForAmendmentsToLoanAndSecurityAgreement_6e8ceffe-1f95-4d14-bba0-e3165647819e" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/SummaryofSignificantAccountingPoliciesScheduleofCashCashEquivalentsandRestrictedCashDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#SummaryofSignificantAccountingPoliciesScheduleofCashCashEquivalentsandRestrictedCashDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/SummaryofSignificantAccountingPoliciesScheduleofCashCashEquivalentsandRestrictedCashDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_eb79aeba-5783-45e6-bab4-40b7aec43f02" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedCashNoncurrent_8ebb996e-4fbd-4143-a3ea-9368e105ce49" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestrictedCashNoncurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_eb79aeba-5783-45e6-bab4-40b7aec43f02" xlink:to="loc_us-gaap_RestrictedCashNoncurrent_8ebb996e-4fbd-4143-a3ea-9368e105ce49" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_090ec846-8a53-4df7-b9fd-78a64090d6bc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_eb79aeba-5783-45e6-bab4-40b7aec43f02" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_090ec846-8a53-4df7-b9fd-78a64090d6bc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedCashCurrent_04a1aec4-98f9-4b42-906f-0f3de8ab5448" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestrictedCashCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_eb79aeba-5783-45e6-bab4-40b7aec43f02" xlink:to="loc_us-gaap_RestrictedCashCurrent_04a1aec4-98f9-4b42-906f-0f3de8ab5448" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesGoodwillRollforwardDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#FairValueofFinancialAssetsandLiabilitiesGoodwillRollforwardDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesGoodwillRollforwardDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_65989e4d-83e6-4229-9c32-0f50738f7d1b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Goodwill"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillGross_5754a3e2-588f-413d-a129-07fcf21a39a8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Goodwill_65989e4d-83e6-4229-9c32-0f50738f7d1b" xlink:to="loc_us-gaap_GoodwillGross_5754a3e2-588f-413d-a129-07fcf21a39a8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillImpairedAccumulatedImpairmentLoss_a8dca6b4-5ae7-4879-82ea-c41356c889e8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_GoodwillImpairedAccumulatedImpairmentLoss"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Goodwill_65989e4d-83e6-4229-9c32-0f50738f7d1b" xlink:to="loc_us-gaap_GoodwillImpairedAccumulatedImpairmentLoss_a8dca6b4-5ae7-4879-82ea-c41356c889e8" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/PropertyandEquipmentNetDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#PropertyandEquipmentNetDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/PropertyandEquipmentNetDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_b5a81761-877e-40bc-a4d2-55f5685ce4c7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_c93c915a-c8f7-4f54-a845-aa4d8ddf49b1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet_b5a81761-877e-40bc-a4d2-55f5685ce4c7" xlink:to="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_c93c915a-c8f7-4f54-a845-aa4d8ddf49b1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross_5c723744-8c12-40e2-b4c2-c4e610fdcc2c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PropertyPlantAndEquipmentGross"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet_b5a81761-877e-40bc-a4d2-55f5685ce4c7" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentGross_5c723744-8c12-40e2-b4c2-c4e610fdcc2c" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/AccruedExpensesDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#AccruedExpensesDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/AccruedExpensesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_77d5b00c-431f-47cc-a7cd-6a61f3096f9b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeRelatedLiabilitiesCurrent_3b85da3d-241e-474f-91db-7ab30170f83f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeRelatedLiabilitiesCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_77d5b00c-431f-47cc-a7cd-6a61f3096f9b" xlink:to="loc_us-gaap_EmployeeRelatedLiabilitiesCurrent_3b85da3d-241e-474f-91db-7ab30170f83f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_AccruedExternalResearchAndDevelopmentExpenses_584d369e-b2c2-4ad0-868c-3c9c1d39088c" xlink:href="xfor-20221231.xsd#xfor_AccruedExternalResearchAndDevelopmentExpenses"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_77d5b00c-431f-47cc-a7cd-6a61f3096f9b" xlink:to="loc_xfor_AccruedExternalResearchAndDevelopmentExpenses_584d369e-b2c2-4ad0-868c-3c9c1d39088c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedProfessionalFeesCurrent_6ef3513c-dd2a-4d90-91a9-263bdff418cf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccruedProfessionalFeesCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_77d5b00c-431f-47cc-a7cd-6a61f3096f9b" xlink:to="loc_us-gaap_AccruedProfessionalFeesCurrent_6ef3513c-dd2a-4d90-91a9-263bdff418cf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_AccruedDeferredFinancingFeesCurrent_25e7cc74-1cc9-4ac2-8a58-6e49d10f95d1" xlink:href="xfor-20221231.xsd#xfor_AccruedDeferredFinancingFeesCurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_77d5b00c-431f-47cc-a7cd-6a61f3096f9b" xlink:to="loc_xfor_AccruedDeferredFinancingFeesCurrent_25e7cc74-1cc9-4ac2-8a58-6e49d10f95d1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAccruedLiabilitiesCurrent_54b5a0e3-f036-4aee-98c3-e3f03860ebc2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherAccruedLiabilitiesCurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent_77d5b00c-431f-47cc-a7cd-6a61f3096f9b" xlink:to="loc_us-gaap_OtherAccruedLiabilitiesCurrent_54b5a0e3-f036-4aee-98c3-e3f03860ebc2" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LongTermDebtScheduleofLongTermDebtDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#LongTermDebtScheduleofLongTermDebtDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/LongTermDebtScheduleofLongTermDebtDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LongTermDebtIncludingAccretion_ecf8399a-4e7b-4bf3-8d46-ced9e973fddf" xlink:href="xfor-20221231.xsd#xfor_LongTermDebtIncludingAccretion"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_d9597424-abaa-4557-978b-febb64fa3293" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebt"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_xfor_LongTermDebtIncludingAccretion_ecf8399a-4e7b-4bf3-8d46-ced9e973fddf" xlink:to="loc_us-gaap_LongTermDebt_d9597424-abaa-4557-978b-febb64fa3293" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_AccretionOnLongTermDebt_48f6ec9e-1b3b-4671-8dc3-086cf24b4270" xlink:href="xfor-20221231.xsd#xfor_AccretionOnLongTermDebt"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_xfor_LongTermDebtIncludingAccretion_ecf8399a-4e7b-4bf3-8d46-ced9e973fddf" xlink:to="loc_xfor_AccretionOnLongTermDebt_48f6ec9e-1b3b-4671-8dc3-086cf24b4270" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentUnamortizedDiscountPremiumNet_e3c29750-5da4-4375-800d-52c1c692dc40" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtInstrumentUnamortizedDiscountPremiumNet"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_xfor_LongTermDebtIncludingAccretion_ecf8399a-4e7b-4bf3-8d46-ced9e973fddf" xlink:to="loc_us-gaap_DebtInstrumentUnamortizedDiscountPremiumNet_e3c29750-5da4-4375-800d-52c1c692dc40" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LongTermDebtFuturePrincipalPaymentsDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#LongTermDebtFuturePrincipalPaymentsDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/LongTermDebtFuturePrincipalPaymentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LongTermDebtAndEOTPayment_70e3b6df-81d2-4ba6-a9c9-fce6a588757e" xlink:href="xfor-20221231.xsd#xfor_LongTermDebtAndEOTPayment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths_ea3ddea6-059b-418a-a557-62a5668f3370" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_xfor_LongTermDebtAndEOTPayment_70e3b6df-81d2-4ba6-a9c9-fce6a588757e" xlink:to="loc_us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths_ea3ddea6-059b-418a-a557-62a5668f3370" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo_fa24532a-9f1c-470b-a315-7d7bb059839f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_xfor_LongTermDebtAndEOTPayment_70e3b6df-81d2-4ba6-a9c9-fce6a588757e" xlink:to="loc_us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo_fa24532a-9f1c-470b-a315-7d7bb059839f" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LeasesScheduleofComponentsofLeaseExpenseDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#LeasesScheduleofComponentsofLeaseExpenseDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/LeasesScheduleofComponentsofLeaseExpenseDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LeaseCost_883ea724-72ae-4347-a72d-9f77f010c5b8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LeaseCost"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseCost_719e385a-7bc5-4b15-81d5-cbc665174e5e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseCost"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LeaseCost_883ea724-72ae-4347-a72d-9f77f010c5b8" xlink:to="loc_us-gaap_OperatingLeaseCost_719e385a-7bc5-4b15-81d5-cbc665174e5e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermLeaseCost_86bd7c6c-ca22-452c-ad48-904521509e94" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShortTermLeaseCost"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LeaseCost_883ea724-72ae-4347-a72d-9f77f010c5b8" xlink:to="loc_us-gaap_ShortTermLeaseCost_86bd7c6c-ca22-452c-ad48-904521509e94" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail" xlink:type="simple" xlink:href="xfor-20221231.xsd#LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_84d6b9d2-42b5-44be-9d99-3b00e5d1429f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_ec35d43b-8db8-48c8-8d9c-419f2894bece" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_84d6b9d2-42b5-44be-9d99-3b00e5d1429f" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_ec35d43b-8db8-48c8-8d9c-419f2894bece" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_6f177b3f-aae7-44fc-8c96-d96476341b6c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_84d6b9d2-42b5-44be-9d99-3b00e5d1429f" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_6f177b3f-aae7-44fc-8c96-d96476341b6c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_a3795c16-13da-4ade-8a18-c1ccfd80ca7e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_84d6b9d2-42b5-44be-9d99-3b00e5d1429f" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_a3795c16-13da-4ade-8a18-c1ccfd80ca7e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_438ce989-a655-45e2-976e-4ac7d775804d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_84d6b9d2-42b5-44be-9d99-3b00e5d1429f" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_438ce989-a655-45e2-976e-4ac7d775804d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_2c9fe3f1-0ff7-4f05-986f-28fe415ba8e6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_84d6b9d2-42b5-44be-9d99-3b00e5d1429f" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_2c9fe3f1-0ff7-4f05-986f-28fe415ba8e6" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail_1" xlink:type="simple" xlink:href="xfor-20221231.xsd#LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail_1"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail_1" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_dfa75fef-7c6d-4a9d-baa8-2ce3b82daf8e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiability_2a933a8d-f32a-4ffc-808d-8f07e087e134" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseLiability"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_dfa75fef-7c6d-4a9d-baa8-2ce3b82daf8e" xlink:to="loc_us-gaap_OperatingLeaseLiability_2a933a8d-f32a-4ffc-808d-8f07e087e134" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_9aa6f2f3-cd17-4db4-96e9-593cf595ec2d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_dfa75fef-7c6d-4a9d-baa8-2ce3b82daf8e" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_9aa6f2f3-cd17-4db4-96e9-593cf595ec2d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/IncomeTaxesScheduleofIncomeLossBeforeIncomeTaxesDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#IncomeTaxesScheduleofIncomeLossBeforeIncomeTaxesDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/IncomeTaxesScheduleofIncomeLossBeforeIncomeTaxesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_adf035d9-a6d5-4472-8bd3-e478b14b4a5c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign_9106be14-5bc5-453b-be6e-5dabc63e86f8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_adf035d9-a6d5-4472-8bd3-e478b14b4a5c" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign_9106be14-5bc5-453b-be6e-5dabc63e86f8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic_21008af9-000f-4455-a6e2-bad5a73f3907" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_adf035d9-a6d5-4472-8bd3-e478b14b4a5c" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic_21008af9-000f-4455-a6e2-bad5a73f3907" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/IncomeTaxesReconciliationofEffectiveIncomeTaxRateDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#IncomeTaxesReconciliationofEffectiveIncomeTaxRateDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/IncomeTaxesReconciliationofEffectiveIncomeTaxRateDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_1010beb0-ab99-4ef5-8865-bcf821a119bc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCreditsResearch_f68cb5f3-37c8-41f2-b893-0ad713d14c4f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationTaxCreditsResearch"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_1010beb0-ab99-4ef5-8865-bcf821a119bc" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCreditsResearch_f68cb5f3-37c8-41f2-b893-0ad713d14c4f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInDeferredTaxAssetsValuationAllowance_a32098d8-e0b9-4209-97d6-0b7740ccda58" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationChangeInDeferredTaxAssetsValuationAllowance"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_1010beb0-ab99-4ef5-8865-bcf821a119bc" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInDeferredTaxAssetsValuationAllowance_a32098d8-e0b9-4209-97d6-0b7740ccda58" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_4230eb55-2ba2-47c3-a9a3-1eb9f09a714b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_1010beb0-ab99-4ef5-8865-bcf821a119bc" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_4230eb55-2ba2-47c3-a9a3-1eb9f09a714b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_a4832ddf-a33b-48ce-89ad-5a7147042513" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_1010beb0-ab99-4ef5-8865-bcf821a119bc" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_a4832ddf-a33b-48ce-89ad-5a7147042513" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_EffectiveIncomeTaxRateReconciliationOtherPermanentDifferences_bafdfd85-879c-450a-84db-9b330735b4f2" xlink:href="xfor-20221231.xsd#xfor_EffectiveIncomeTaxRateReconciliationOtherPermanentDifferences"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_1010beb0-ab99-4ef5-8865-bcf821a119bc" xlink:to="loc_xfor_EffectiveIncomeTaxRateReconciliationOtherPermanentDifferences_bafdfd85-879c-450a-84db-9b330735b4f2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_1ca62a39-1df8-4219-b521-f4dfee14f24b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_1010beb0-ab99-4ef5-8865-bcf821a119bc" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_1ca62a39-1df8-4219-b521-f4dfee14f24b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/IncomeTaxesDeferredIncomeTaxAssetDetails" xlink:type="simple" xlink:href="xfor-20221231.xsd#IncomeTaxesDeferredIncomeTaxAssetDetails"/>
  <link:calculationLink xlink:role="http://www.x4pharma.com/role/IncomeTaxesDeferredIncomeTaxAssetDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_2cfa0fa5-2d1d-460c-b427-42154697c63a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsLiabilitiesNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities_6205146a-5b46-4276-82cf-69eae6474137" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredIncomeTaxLiabilities"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_2cfa0fa5-2d1d-460c-b427-42154697c63a" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilities_6205146a-5b46-4276-82cf-69eae6474137" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsNet_73dfac3d-66de-4afc-bf35-f5900b8f8a21" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsNet"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_2cfa0fa5-2d1d-460c-b427-42154697c63a" xlink:to="loc_us-gaap_DeferredTaxAssetsNet_73dfac3d-66de-4afc-bf35-f5900b8f8a21" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities_dc193e9c-3b30-428d-b302-944524310435" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredIncomeTaxLiabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_DeferredTaxLiabilityRightOfUseAsset_4e45810b-1048-4451-9793-e1e20ca3318a" xlink:href="xfor-20221231.xsd#xfor_DeferredTaxLiabilityRightOfUseAsset"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_dc193e9c-3b30-428d-b302-944524310435" xlink:to="loc_xfor_DeferredTaxLiabilityRightOfUseAsset_4e45810b-1048-4451-9793-e1e20ca3318a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGross_2340a842-470c-49dd-b399-f1f5cfcd339c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsGross"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOther_063ee02c-5aca-40dd-8b7d-6a506c5e3d6b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsOther"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_2340a842-470c-49dd-b399-f1f5cfcd339c" xlink:to="loc_us-gaap_DeferredTaxAssetsOther_063ee02c-5aca-40dd-8b7d-6a506c5e3d6b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_6396f291-4bcd-4a86-873e-82d1bd946ae3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwards"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_2340a842-470c-49dd-b399-f1f5cfcd339c" xlink:to="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_6396f291-4bcd-4a86-873e-82d1bd946ae3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_DeferredTaxAssetLeaseLiability_d4493ccb-06cf-45a4-93fb-827c85f112b8" xlink:href="xfor-20221231.xsd#xfor_DeferredTaxAssetLeaseLiability"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_2340a842-470c-49dd-b399-f1f5cfcd339c" xlink:to="loc_xfor_DeferredTaxAssetLeaseLiability_d4493ccb-06cf-45a4-93fb-827c85f112b8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_DeferredTaxAssetsTaxDeferredExpenseCapitalizedResearchAndDevelopmentCosts_8b5ff53c-6cec-491b-a088-53a6d62089fd" xlink:href="xfor-20221231.xsd#xfor_DeferredTaxAssetsTaxDeferredExpenseCapitalizedResearchAndDevelopmentCosts"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_2340a842-470c-49dd-b399-f1f5cfcd339c" xlink:to="loc_xfor_DeferredTaxAssetsTaxDeferredExpenseCapitalizedResearchAndDevelopmentCosts_8b5ff53c-6cec-491b-a088-53a6d62089fd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch_36929c32-f70a-457b-92ef-490b0b979d75" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_2340a842-470c-49dd-b399-f1f5cfcd339c" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch_36929c32-f70a-457b-92ef-490b0b979d75" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsNet_0a70e141-844f-43de-9a23-d3bb72191ee0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance_769927b1-3f89-443a-8517-7f83a255d264" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsValuationAllowance"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsNet_0a70e141-844f-43de-9a23-d3bb72191ee0" xlink:to="loc_us-gaap_DeferredTaxAssetsValuationAllowance_769927b1-3f89-443a-8517-7f83a255d264" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGross_1d05ebd1-fd97-4ed5-9b2e-03378453ea68" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsGross"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsNet_0a70e141-844f-43de-9a23-d3bb72191ee0" xlink:to="loc_us-gaap_DeferredTaxAssetsGross_1d05ebd1-fd97-4ed5-9b2e-03378453ea68" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
