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

<!--XBRL Document Created with the Workiva Platform-->
<!--Copyright 2026 Workiva-->
<!--r:019e217b-bdc4-7536-b7f9-714a75d6f30b,g:01b152cb-7d11-4b6b-9289-451a2d7a80b7-->
<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:arcroleRef arcroleURI="https://xbrl.org/2023/arcrole/summation-item" xlink:type="simple" xlink:href="https://www.xbrl.org/2023/calculation-1.1.xsd#summation-item"/>
  <link:roleRef roleURI="http://unifirst.com/role/ConsolidatedStatementsofIncome" xlink:type="simple" xlink:href="unf-20260530.xsd#ConsolidatedStatementsofIncome"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/ConsolidatedStatementsofIncome" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_019e217b-be8f-7fa5-b1b6-58d7ea7e85df" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CostsAndExpenses"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfRevenue_019e217b-be8f-7caf-a319-36291c22b9e4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CostOfRevenue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_019e217b-be8f-7fa5-b1b6-58d7ea7e85df" xlink:to="loc_us-gaap_CostOfRevenue_019e217b-be8f-7caf-a319-36291c22b9e4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense_019e217b-be8f-7263-9044-8c19c464914e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_019e217b-be8f-7fa5-b1b6-58d7ea7e85df" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpense_019e217b-be8f-7263-9044-8c19c464914e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationDepletionAndAmortization_019e217b-be8f-7042-b6f5-169495438b59" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DepreciationDepletionAndAmortization"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_019e217b-be8f-7fa5-b1b6-58d7ea7e85df" xlink:to="loc_us-gaap_DepreciationDepletionAndAmortization_019e217b-be8f-7042-b6f5-169495438b59" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_019e217b-be8f-7ec3-81c1-03c753f26cb2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e217b-be8f-7fde-af12-20a318e18879" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_019e217b-be8f-7ec3-81c1-03c753f26cb2" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e217b-be8f-7fde-af12-20a318e18879" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_019e217b-be8f-7cf2-af1b-38beaeac62c9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_019e217b-be8f-7ec3-81c1-03c753f26cb2" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_019e217b-be8f-7cf2-af1b-38beaeac62c9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e217b-be8f-70e0-96be-2b771f81c503" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_019e217b-be8f-71a2-81da-01aba95efc2a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e217b-be8f-70e0-96be-2b771f81c503" xlink:to="loc_us-gaap_OperatingIncomeLoss_019e217b-be8f-71a2-81da-01aba95efc2a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_019e217b-be8f-7b4f-a6d3-08476c911805" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e217b-be8f-70e0-96be-2b771f81c503" xlink:to="loc_us-gaap_NonoperatingIncomeExpense_019e217b-be8f-7b4f-a6d3-08476c911805" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_019e217b-be8f-7ce6-ab4d-48d4fd99962a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_019e4e70-6819-7ab9-92eb-3cfd203ebc3d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InterestIncomeExpenseNonoperatingNet"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_019e217b-be8f-7ce6-ab4d-48d4fd99962a" xlink:to="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_019e4e70-6819-7ab9-92eb-3cfd203ebc3d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_019e217b-be8f-77fb-b8f3-f1c5d651c1aa" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NonoperatingIncomeExpense_019e217b-be8f-7ce6-ab4d-48d4fd99962a" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_019e217b-be8f-77fb-b8f3-f1c5d651c1aa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_019e217b-be8f-79ee-b079-c74d4ecd66a2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019e217b-be8f-7cd7-98d8-4d4e0dd76630" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_019e217b-be8f-79ee-b079-c74d4ecd66a2" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_019e217b-be8f-7cd7-98d8-4d4e0dd76630" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_019e217b-be8f-7b7f-8f90-f4cc1aa25678" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CostsAndExpenses"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_019e217b-be8f-79ee-b079-c74d4ecd66a2" xlink:to="loc_us-gaap_CostsAndExpenses_019e217b-be8f-7b7f-8f90-f4cc1aa25678" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/ConsolidatedStatementsofComprehensiveIncome" xlink:type="simple" xlink:href="unf-20260530.xsd#ConsolidatedStatementsofComprehensiveIncome"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/ConsolidatedStatementsofComprehensiveIncome" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019e4e74-ddc6-7ef3-80e1-a820abfc2449" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_019e4e74-ddc6-7d27-addd-975cc4a73bef" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019e4e74-ddc6-7ef3-80e1-a820abfc2449" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_019e4e74-ddc6-7d27-addd-975cc4a73bef" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax_019e4e74-ddc6-7ca8-b441-22fc3d4bfd06" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019e4e74-ddc6-7ef3-80e1-a820abfc2449" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossCashFlowHedgeGainLossAfterReclassificationAndTax_019e4e74-ddc6-7ca8-b441-22fc3d4bfd06" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_019e4e75-21e6-7237-afec-f16defa081a3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_019e4e75-21e6-7d16-a88f-a8c69032ff9f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_019e4e75-21e6-7237-afec-f16defa081a3" xlink:to="loc_us-gaap_NetIncomeLoss_019e4e75-21e6-7d16-a88f-a8c69032ff9f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019e4e75-21e6-7627-8a57-826e2c5094b7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_019e4e75-21e6-7237-afec-f16defa081a3" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_019e4e75-21e6-7627-8a57-826e2c5094b7" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/ConsolidatedBalanceSheets" xlink:type="simple" xlink:href="unf-20260530.xsd#ConsolidatedBalanceSheets"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/ConsolidatedBalanceSheets" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_019e217b-be90-7374-8db6-8eed573d126b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetsCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_019e217b-be90-725d-afd8-9bf54f3b636f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019e217b-be90-7374-8db6-8eed573d126b" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_019e217b-be90-725d-afd8-9bf54f3b636f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermInvestments_019e217b-be90-79c1-9605-d665092d22b2" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShortTermInvestments"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019e217b-be90-7374-8db6-8eed573d126b" xlink:to="loc_us-gaap_ShortTermInvestments_019e217b-be90-79c1-9605-d665092d22b2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReceivablesNetCurrent_019e217b-be90-7061-8fd9-0b436088bec9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ReceivablesNetCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019e217b-be90-7374-8db6-8eed573d126b" xlink:to="loc_us-gaap_ReceivablesNetCurrent_019e217b-be90-7061-8fd9-0b436088bec9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_019e217b-be90-764f-8edd-718f5659ab7e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InventoryNet"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019e217b-be90-7374-8db6-8eed573d126b" xlink:to="loc_us-gaap_InventoryNet_019e217b-be90-764f-8edd-718f5659ab7e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_RentalMerchandiseInService_019e217b-be90-722d-977a-839162474346" xlink:href="unf-20260530.xsd#unf_RentalMerchandiseInService"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019e217b-be90-7374-8db6-8eed573d126b" xlink:to="loc_unf_RentalMerchandiseInService_019e217b-be90-722d-977a-839162474346" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_PrepaidTaxesCurrent_019e217b-be90-70ee-a7dc-44133660d7a7" xlink:href="unf-20260530.xsd#unf_PrepaidTaxesCurrent"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019e217b-be90-7374-8db6-8eed573d126b" xlink:to="loc_unf_PrepaidTaxesCurrent_019e217b-be90-70ee-a7dc-44133660d7a7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_019e217b-be90-7a6c-a56d-e82ba0f19be8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_019e217b-be90-7374-8db6-8eed573d126b" xlink:to="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_019e217b-be90-7a6c-a56d-e82ba0f19be8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_019e217b-be90-7430-beaf-6bfa4768096b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Liabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_019e217b-be90-7d73-b00b-af802ec2a7a9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_019e217b-be90-7430-beaf-6bfa4768096b" xlink:to="loc_us-gaap_LiabilitiesCurrent_019e217b-be90-7d73-b00b-af802ec2a7a9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent_019e217b-be90-77dd-9ff8-bcbc43ea5782" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_019e217b-be90-7430-beaf-6bfa4768096b" xlink:to="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent_019e217b-be90-77dd-9ff8-bcbc43ea5782" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccruedAndDeferredIncomeTaxesLongTerm_019e217b-be90-7740-b65a-51511073e913" xlink:href="unf-20260530.xsd#unf_AccruedAndDeferredIncomeTaxesLongTerm"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_019e217b-be90-7430-beaf-6bfa4768096b" xlink:to="loc_unf_AccruedAndDeferredIncomeTaxesLongTerm_019e217b-be90-7740-b65a-51511073e913" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_019e217b-be90-7113-9edb-f9bacc490834" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_019e217b-be90-7430-beaf-6bfa4768096b" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_019e217b-be90-7113-9edb-f9bacc490834" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_019e217b-be90-7be1-ba85-4c541e570c64" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockValue_019e217b-be90-7bba-ac4d-b457b2d63502" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PreferredStockValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_019e217b-be90-7be1-ba85-4c541e570c64" xlink:to="loc_us-gaap_PreferredStockValue_019e217b-be90-7bba-ac4d-b457b2d63502" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValue_019e217b-be90-74d4-b1a5-21a2fde16994" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommonStockValue"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_019e217b-be90-7be1-ba85-4c541e570c64" xlink:to="loc_us-gaap_CommonStockValue_019e217b-be90-74d4-b1a5-21a2fde16994" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_019e217b-be90-7e8a-8398-22e317773342" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AdditionalPaidInCapital"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_019e217b-be90-7be1-ba85-4c541e570c64" xlink:to="loc_us-gaap_AdditionalPaidInCapital_019e217b-be90-7e8a-8398-22e317773342" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_019e217b-be90-766c-bb55-b568d4b1c8bd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_019e217b-be90-7be1-ba85-4c541e570c64" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_019e217b-be90-766c-bb55-b568d4b1c8bd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_019e217b-be90-7d13-9d4c-f757d2490ca4" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_019e217b-be90-7be1-ba85-4c541e570c64" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_019e217b-be90-7d13-9d4c-f757d2490ca4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_019e217b-be90-7511-b56d-287a8bd02d18" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_019e217b-be90-7150-92a2-2e778e526777" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Liabilities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_019e217b-be90-7511-b56d-287a8bd02d18" xlink:to="loc_us-gaap_Liabilities_019e217b-be90-7150-92a2-2e778e526777" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingencies_019e217b-be90-7479-bdb3-86f1eae17b22" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CommitmentsAndContingencies"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_019e217b-be90-7511-b56d-287a8bd02d18" xlink:to="loc_us-gaap_CommitmentsAndContingencies_019e217b-be90-7479-bdb3-86f1eae17b22" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_019e217b-be90-77bd-aefd-44132e22c6e8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_StockholdersEquity"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_019e217b-be90-7511-b56d-287a8bd02d18" xlink:to="loc_us-gaap_StockholdersEquity_019e217b-be90-77bd-aefd-44132e22c6e8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_019e217b-be90-7f07-a44e-2ec8e3cb2f32" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetsCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:to="loc_us-gaap_AssetsCurrent_019e217b-be90-7f07-a44e-2ec8e3cb2f32" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_019e217b-be90-7601-b676-73cdbc1696a9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_019e217b-be90-7601-b676-73cdbc1696a9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_019e217b-be90-7a7e-a78c-2c87930ce1e6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Goodwill"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:to="loc_us-gaap_Goodwill_019e217b-be90-7a7e-a78c-2c87930ce1e6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ContractWithCustomerAssetNetNoncurrent_019e217b-be90-70aa-b5e1-5c90d8fae00e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ContractWithCustomerAssetNetNoncurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:to="loc_us-gaap_ContractWithCustomerAssetNetNoncurrent_019e217b-be90-70aa-b5e1-5c90d8fae00e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherIntangibleAssetsNet_019e217b-be90-7404-9494-a0c62c5f1b70" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherIntangibleAssetsNet"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:to="loc_us-gaap_OtherIntangibleAssetsNet_019e217b-be90-7404-9494-a0c62c5f1b70" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_019e217b-be90-745a-99ca-4f55c3e043f5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DeferredIncomeTaxAssetsNet"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_019e217b-be90-745a-99ca-4f55c3e043f5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_019e217b-be90-743f-a1a8-977d65603488" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_019e217b-be90-743f-a1a8-977d65603488" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent_019e217b-be90-7147-80af-d14628cacc0c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_019e217b-be90-758b-9377-550eeccf1677" xlink:to="loc_us-gaap_OtherAssetsNoncurrent_019e217b-be90-7147-80af-d14628cacc0c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_019e217b-be90-73fc-a966-48dc8ae625f9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent_019e217b-be90-77ff-986c-a44b410b465d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019e217b-be90-73fc-a966-48dc8ae625f9" xlink:to="loc_us-gaap_AccountsPayableCurrent_019e217b-be90-77ff-986c-a44b410b465d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_019e217b-be90-769b-bba8-4fd61ba1c82a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019e217b-be90-73fc-a966-48dc8ae625f9" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent_019e217b-be90-769b-bba8-4fd61ba1c82a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesCurrent_019e217b-be90-7410-b95b-5a06a8c09cd7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccruedIncomeTaxesCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019e217b-be90-73fc-a966-48dc8ae625f9" xlink:to="loc_us-gaap_AccruedIncomeTaxesCurrent_019e217b-be90-7410-b95b-5a06a8c09cd7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_019e217b-be90-73f4-a670-2b157068928f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_019e217b-be90-73fc-a966-48dc8ae625f9" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_019e217b-be90-73f4-a670-2b157068928f" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/ConsolidatedStatementsofCashFlows" xlink:type="simple" xlink:href="unf-20260530.xsd#ConsolidatedStatementsofCashFlows"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/ConsolidatedStatementsofCashFlows" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019e217b-bf60-74a1-a961-e72d7d36189e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_PaymentsForProceedsFromExerciseOfShareBasedAwards_019e217b-bf60-7c30-bf74-b1bc56eb209e" xlink:href="unf-20260530.xsd#unf_PaymentsForProceedsFromExerciseOfShareBasedAwards"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019e217b-bf60-74a1-a961-e72d7d36189e" xlink:to="loc_unf_PaymentsForProceedsFromExerciseOfShareBasedAwards_019e217b-bf60-7c30-bf74-b1bc56eb209e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_019e217b-bf60-7aca-b50f-6894ce2415d3" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019e217b-bf60-74a1-a961-e72d7d36189e" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_019e217b-bf60-7aca-b50f-6894ce2415d3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_019e217b-bf60-7fcd-9af4-4448f5d3c2fd" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019e217b-bf60-74a1-a961-e72d7d36189e" xlink:to="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_019e217b-bf60-7fcd-9af4-4448f5d3c2fd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDividends_019e217b-bf60-7758-b14c-41b0ebab538c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsOfDividends"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019e217b-bf60-74a1-a961-e72d7d36189e" xlink:to="loc_us-gaap_PaymentsOfDividends_019e217b-bf60-7758-b14c-41b0ebab538c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities_019f127c-f65f-7daf-942e-5f5d733eae41" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019e217b-bf60-74a1-a961-e72d7d36189e" xlink:to="loc_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities_019f127c-f65f-7daf-942e-5f5d733eae41" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019e217b-bf60-715b-815d-7d46dc5a048a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired_019e217b-bf60-79a7-905a-dbd70b8da4ad" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019e217b-bf60-715b-815d-7d46dc5a048a" xlink:to="loc_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired_019e217b-bf60-79a7-905a-dbd70b8da4ad" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_019e217b-bf60-7276-9daa-1d40509b2f71" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019e217b-bf60-715b-815d-7d46dc5a048a" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_019e217b-bf60-7276-9daa-1d40509b2f71" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireInvestments_019e217b-bf60-7f2c-b3ce-c350cb47eb51" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_PaymentsToAcquireInvestments"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019e217b-bf60-715b-815d-7d46dc5a048a" xlink:to="loc_us-gaap_PaymentsToAcquireInvestments_019e217b-bf60-7f2c-b3ce-c350cb47eb51" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments_019e217b-bf60-74c9-b02c-f868f2b6a516" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019e217b-bf60-715b-815d-7d46dc5a048a" xlink:to="loc_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments_019e217b-bf60-74c9-b02c-f868f2b6a516" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_019e217b-bf60-7646-ae2d-c824f7aa60be" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019e217b-bf60-715b-815d-7d46dc5a048a" xlink:to="loc_us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment_019e217b-bf60-7646-ae2d-c824f7aa60be" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019e217b-bf60-737a-ad8d-0bf7419bc95f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7ee3-87fe-d30290289906" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019e217b-bf60-737a-ad8d-0bf7419bc95f" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7ee3-87fe-d30290289906" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019e217b-bf60-7218-b188-41d35593bbec" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019e217b-bf60-737a-ad8d-0bf7419bc95f" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_019e217b-bf60-7218-b188-41d35593bbec" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019e217b-bf60-7fce-a532-918bb5fc4970" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019e217b-bf60-737a-ad8d-0bf7419bc95f" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_019e217b-bf60-7fce-a532-918bb5fc4970" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations_019e217b-bf60-702f-9a90-b0c0dda30c4a" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_019e217b-bf60-737a-ad8d-0bf7419bc95f" xlink:to="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations_019e217b-bf60-702f-9a90-b0c0dda30c4a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_019e217b-bf60-7d65-b833-1227d1142de8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_NetIncomeLoss_019e217b-bf60-7d65-b833-1227d1142de8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationDepletionAndAmortization_019e217b-bf60-79ad-a280-45cb45d633bc" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DepreciationDepletionAndAmortization"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_DepreciationDepletionAndAmortization_019e217b-bf60-79ad-a280-45cb45d633bc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation_019e217b-bf60-76f5-aed9-37dd831a7986" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ShareBasedCompensation"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_ShareBasedCompensation_019e217b-bf60-76f5-aed9-37dd831a7986" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccretionOnEnvironmentalContingencies_019e217b-bf60-7930-8102-c73003897270" xlink:href="unf-20260530.xsd#unf_AccretionOnEnvironmentalContingencies"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_unf_AccretionOnEnvironmentalContingencies_019e217b-bf60-7930-8102-c73003897270" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetRetirementObligationAccretionExpense_019e217b-bf60-7400-8a61-a196c908697b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AssetRetirementObligationAccretionExpense"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_AssetRetirementObligationAccretionExpense_019e217b-bf60-7400-8a61-a196c908697b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfPropertyPlantEquipment_019e217b-bf60-79ae-ad31-c0c2d846e741" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_GainLossOnSaleOfPropertyPlantEquipment"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_GainLossOnSaleOfPropertyPlantEquipment_019e217b-bf60-79ae-ad31-c0c2d846e741" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_019e217b-bf60-75ce-8c95-9336e795aca9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DeferredIncomeTaxesAndTaxCredits"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_019e217b-bf60-75ce-8c95-9336e795aca9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNoncashIncomeExpense_019e217b-bf60-7428-bcfb-e2959a576421" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherNoncashIncomeExpense"/>
    <link:calculationArc order="8" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_OtherNoncashIncomeExpense_019e217b-bf60-7428-bcfb-e2959a576421" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInReceivables_019e217b-bf60-7f05-abd5-0a5729016359" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInReceivables"/>
    <link:calculationArc order="9" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_IncreaseDecreaseInReceivables_019e217b-bf60-7f05-abd5-0a5729016359" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInInventories_019e217b-bf60-7921-8693-8dc11516a027" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInInventories"/>
    <link:calculationArc order="10" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_IncreaseDecreaseInInventories_019e217b-bf60-7921-8693-8dc11516a027" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_IncreaseDecreaseInRentalMerchandiseInService_019e217b-bf60-74a0-a845-9f7c30c5e6e1" xlink:href="unf-20260530.xsd#unf_IncreaseDecreaseInRentalMerchandiseInService"/>
    <link:calculationArc order="11" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_unf_IncreaseDecreaseInRentalMerchandiseInService_019e217b-bf60-74a0-a845-9f7c30c5e6e1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_019e217b-bf60-78b1-a8d4-13f58f8a3404" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="12" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_019e217b-bf60-78b1-a8d4-13f58f8a3404" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayable_019e217b-bf60-78bd-98de-cb5130f9329f" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInAccountsPayable"/>
    <link:calculationArc order="13" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayable_019e217b-bf60-78bd-98de-cb5130f9329f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities_019e217b-bf60-736c-8ae9-9f3583f44b03" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilities"/>
    <link:calculationArc order="14" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities_019e217b-bf60-736c-8ae9-9f3583f44b03" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable_019e217b-bf60-7748-bd6c-50446a90512d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable"/>
    <link:calculationArc order="15" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_019e217b-bf60-7897-aca5-4924d963f890" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable_019e217b-bf60-7748-bd6c-50446a90512d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/AcquisitionsScheduleofAcquisitionofBusinessesDetails" xlink:type="simple" xlink:href="unf-20260530.xsd#AcquisitionsScheduleofAcquisitionofBusinessesDetails"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/AcquisitionsScheduleofAcquisitionofBusinessesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e4a21-255b-74ef-a123-3a41638554a5" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCashAndEquivalents_019e4a21-255b-726c-b1ee-e2adc5a7b7d9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCashAndEquivalents"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e4a21-255b-74ef-a123-3a41638554a5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCashAndEquivalents_019e4a21-255b-726c-b1ee-e2adc5a7b7d9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIndefiniteLivedIntangibleAssets_019e4a21-255b-7c5f-be45-c30072d6bcc7" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIndefiniteLivedIntangibleAssets"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e4a21-255b-74ef-a123-3a41638554a5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIndefiniteLivedIntangibleAssets_019e4a21-255b-7c5f-be45-c30072d6bcc7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_019e4a21-255b-7ff4-b44b-cc7e93f0a605" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_Goodwill"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e4a21-255b-74ef-a123-3a41638554a5" xlink:to="loc_us-gaap_Goodwill_019e4a21-255b-7ff4-b44b-cc7e93f0a605" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCustomerContracts_019e4a21-255b-7198-80c0-0393c239bc75" xlink:href="unf-20260530.xsd#unf_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCustomerContracts"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e4a21-255b-74ef-a123-3a41638554a5" xlink:to="loc_unf_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCustomerContracts_019e4a21-255b-7198-80c0-0393c239bc75" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill_019e4a21-255b-752f-89e0-586bb9c28e15" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e4a21-255b-74ef-a123-3a41638554a5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill_019e4a21-255b-752f-89e0-586bb9c28e15" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities_019e4a21-255b-722e-a6cf-7efc18a4ad2c" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e4a21-255b-74ef-a123-3a41638554a5" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities_019e4a21-255b-722e-a6cf-7efc18a4ad2c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_BusinessCombinationRecognizedAssetAcquiredToLiabilityAssumedExcessLessAndGoodwillExcludingHoldbacks_019e8897-0167-727c-9bb0-92f7a7361178" xlink:href="unf-20260530.xsd#unf_BusinessCombinationRecognizedAssetAcquiredToLiabilityAssumedExcessLessAndGoodwillExcludingHoldbacks"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e8897-0167-7a70-aa23-a87d7585f910" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_BusinessCombinationRecognizedAssetAcquiredToLiabilityAssumedExcessLessAndGoodwillExcludingHoldbacks_019e8897-0167-727c-9bb0-92f7a7361178" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_019e8897-0167-7a70-aa23-a87d7585f910" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_BusinessCombinationConsiderationContingentHoldbacks_019e8897-0167-79f3-8be2-f4f89f9787e1" xlink:href="unf-20260530.xsd#unf_BusinessCombinationConsiderationContingentHoldbacks"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_BusinessCombinationRecognizedAssetAcquiredToLiabilityAssumedExcessLessAndGoodwillExcludingHoldbacks_019e8897-0167-727c-9bb0-92f7a7361178" xlink:to="loc_unf_BusinessCombinationConsiderationContingentHoldbacks_019e8897-0167-79f3-8be2-f4f89f9787e1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_019f1c84-5dbe-7d57-9adb-eb15d39eb05d" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_BusinessCombinationRecognizedAssetAcquiredToLiabilityAssumedExcessLessAndGoodwillExcludingHoldbacks_019e8897-0167-727c-9bb0-92f7a7361178" xlink:to="loc_us-gaap_BusinessCombinationContingentConsiderationLiability_019f1c84-5dbe-7d57-9adb-eb15d39eb05d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/IncomePerShareScheduleofComputationofDilutedIncomePerShareDetails" xlink:type="simple" xlink:href="unf-20260530.xsd#IncomePerShareScheduleofComputationofDilutedIncomePerShareDetails"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/IncomePerShareScheduleofComputationofDilutedIncomePerShareDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAvailableToCommonStockholdersDiluted_019e217b-bf60-7ebd-ad9e-dba2459cc5df" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLossAvailableToCommonStockholdersDiluted"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DilutiveSecurities_019e217b-bf60-7323-99cd-5cb109d49ce8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_DilutiveSecurities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAvailableToCommonStockholdersDiluted_019e217b-bf60-7ebd-ad9e-dba2459cc5df" xlink:to="loc_us-gaap_DilutiveSecurities_019e217b-bf60-7323-99cd-5cb109d49ce8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAvailableToCommonStockholdersBasic_019e217b-bf60-76c8-be89-e4b0b4d6179b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_NetIncomeLossAvailableToCommonStockholdersBasic"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAvailableToCommonStockholdersDiluted_019e217b-bf60-7ebd-ad9e-dba2459cc5df" xlink:to="loc_us-gaap_NetIncomeLossAvailableToCommonStockholdersBasic_019e217b-bf60-76c8-be89-e4b0b4d6179b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_019e217b-bf60-75c4-bbd1-bb66c224a10b" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_019e217b-bf60-7cba-8435-efb8bc187527" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_019e217b-bf60-75c4-bbd1-bb66c224a10b" xlink:to="loc_us-gaap_IncrementalCommonSharesAttributableToShareBasedPaymentArrangements_019e217b-bf60-7cba-8435-efb8bc187527" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_019e217b-bf60-72aa-8f65-26dc430e5d40" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_019e217b-bf60-75c4-bbd1-bb66c224a10b" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_019e217b-bf60-72aa-8f65-26dc430e5d40" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/InventoriesDetails" xlink:type="simple" xlink:href="unf-20260530.xsd#InventoriesDetails"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/InventoriesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_019e217b-bf60-7b59-957a-dfe577350f58" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InventoryNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryRawMaterialsNetOfReserves_019e217b-bf60-796b-a5f0-22498ef078fe" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InventoryRawMaterialsNetOfReserves"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_019e217b-bf60-7b59-957a-dfe577350f58" xlink:to="loc_us-gaap_InventoryRawMaterialsNetOfReserves_019e217b-bf60-796b-a5f0-22498ef078fe" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryWorkInProcessNetOfReserves_019e217b-bf60-74b2-963f-f6bcfcfb30e8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InventoryWorkInProcessNetOfReserves"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_019e217b-bf60-7b59-957a-dfe577350f58" xlink:to="loc_us-gaap_InventoryWorkInProcessNetOfReserves_019e217b-bf60-74b2-963f-f6bcfcfb30e8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryFinishedGoodsNetOfReserves_019e217b-bf60-79d2-b465-1d8e1a359ab6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InventoryFinishedGoodsNetOfReserves"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_019e217b-bf60-7b59-957a-dfe577350f58" xlink:to="loc_us-gaap_InventoryFinishedGoodsNetOfReserves_019e217b-bf60-79d2-b465-1d8e1a359ab6" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/GoodwillandOtherIntangibleAssetsScheduleofIntangibleAssetsNetDetails" xlink:type="simple" xlink:href="unf-20260530.xsd#GoodwillandOtherIntangibleAssetsScheduleofIntangibleAssetsNetDetails"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/GoodwillandOtherIntangibleAssetsScheduleofIntangibleAssetsNetDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_019e217b-bf60-7b95-b4ae-5ce9eec53628" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross_019e217b-bf60-7960-9aa2-dc7e346024af" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_019e217b-bf60-7b95-b4ae-5ce9eec53628" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsGross_019e217b-bf60-7960-9aa2-dc7e346024af" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_019e217b-bf60-7e0e-b3c0-ec33a6becab9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_019e217b-bf60-7b95-b4ae-5ce9eec53628" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_019e217b-bf60-7e0e-b3c0-ec33a6becab9" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/CommitmentsandContingenciesScheduleofAnticipatedPaymentsandInsuranceProceedsofCurrentlyIdentifiedEnvironmentalRemediationLiabilitiesDetails" xlink:type="simple" xlink:href="unf-20260530.xsd#CommitmentsandContingenciesScheduleofAnticipatedPaymentsandInsuranceProceedsofCurrentlyIdentifiedEnvironmentalRemediationLiabilitiesDetails"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/CommitmentsandContingenciesScheduleofAnticipatedPaymentsandInsuranceProceedsofCurrentlyIdentifiedEnvironmentalRemediationLiabilitiesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingencies_019e217b-bf60-7ecc-b0f2-333443365579" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingencies"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7528-a512-d26270d825ff" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingencies_019e217b-bf60-7ecc-b0f2-333443365579" xlink:to="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7528-a512-d26270d825ff" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesEffectOfInflation_019e217b-bf60-7298-8551-07328779e27d" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesEffectOfInflation"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingencies_019e217b-bf60-7ecc-b0f2-333443365579" xlink:to="loc_unf_AccrualForEnvironmentalLossContingenciesEffectOfInflation_019e217b-bf60-7298-8551-07328779e27d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingenciesDiscount_019e217b-bf60-72c4-9a6e-b20db3fec2a9" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesDiscount"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingencies_019e217b-bf60-7ecc-b0f2-333443365579" xlink:to="loc_us-gaap_AccrualForEnvironmentalLossContingenciesDiscount_019e217b-bf60-72c4-9a6e-b20db3fec2a9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e2c00-9825-7de6-9c54-9124c8ee9aee" xlink:href="unf-20260530.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidRemainderOfFiscalYear_019e2c00-9825-7e3c-afb3-7cb0a14c1c92" xlink:href="unf-20260530.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidRemainderOfFiscalYear"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e2c00-9825-7de6-9c54-9124c8ee9aee" xlink:to="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidRemainderOfFiscalYear_019e2c00-9825-7e3c-afb3-7cb0a14c1c92" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearOne_019e2c00-9825-7fb7-bfaf-73d1331a90ee" xlink:href="unf-20260530.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearOne"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e2c00-9825-7de6-9c54-9124c8ee9aee" xlink:to="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearOne_019e2c00-9825-7fb7-bfaf-73d1331a90ee" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearTwo_019e2c00-9825-7baa-b39f-9c00dc109ee8" xlink:href="unf-20260530.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearTwo"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e2c00-9825-7de6-9c54-9124c8ee9aee" xlink:to="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearTwo_019e2c00-9825-7baa-b39f-9c00dc109ee8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearThree_019e2c00-9825-71e4-9ad0-1d20e05e65df" xlink:href="unf-20260530.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearThree"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e2c00-9825-7de6-9c54-9124c8ee9aee" xlink:to="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearThree_019e2c00-9825-71e4-9ad0-1d20e05e65df" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearFour_019e2c00-9825-7aa3-9841-94097b4d7b38" xlink:href="unf-20260530.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearFour"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e2c00-9825-7de6-9c54-9124c8ee9aee" xlink:to="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidYearFour_019e2c00-9825-7aa3-9841-94097b4d7b38" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidAfterYearFour_019e2c00-9825-7d5f-8952-81e8e8397c60" xlink:href="unf-20260530.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidAfterYearFour"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e2c00-9825-7de6-9c54-9124c8ee9aee" xlink:to="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedToBePaidAfterYearFour_019e2c00-9825-7d5f-8952-81e8e8397c60" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e4f24-f035-71f6-b281-6d51e15c554f" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e4f24-f035-702b-8225-4252c08ecb11" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e4f24-f035-71f6-b281-6d51e15c554f" xlink:to="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e4f24-f035-702b-8225-4252c08ecb11" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e4f24-f035-7b2f-b508-6e561fbf948b" xlink:href="unf-20260530.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e4f24-f035-71f6-b281-6d51e15c554f" xlink:to="loc_unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross_019e4f24-f035-7b2f-b508-6e561fbf948b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e2c00-6d8a-7ce1-a412-605701b51319" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesGross"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInRemainderOfFiscalYear_019ed9d5-3884-734c-8e25-7b8cbec45211" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInRemainderOfFiscalYear"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e2c00-6d8a-7ce1-a412-605701b51319" xlink:to="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInRemainderOfFiscalYear_019ed9d5-3884-734c-8e25-7b8cbec45211" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear_019e2c00-6d8a-7747-b53b-3d5011eb5e71" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e2c00-6d8a-7ce1-a412-605701b51319" xlink:to="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear_019e2c00-6d8a-7747-b53b-3d5011eb5e71" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInSecondYear_019e2c00-6d8a-7e50-8279-4931bbd62e85" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInSecondYear"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e2c00-6d8a-7ce1-a412-605701b51319" xlink:to="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInSecondYear_019e2c00-6d8a-7e50-8279-4931bbd62e85" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThirdYear_019e2c00-6d8a-783a-8ff1-1d093fdeea84" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThirdYear"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e2c00-6d8a-7ce1-a412-605701b51319" xlink:to="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThirdYear_019e2c00-6d8a-783a-8ff1-1d093fdeea84" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourthYear_019e2c00-6d8a-7ba3-a209-fef0967aeeed" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourthYear"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e2c00-6d8a-7ce1-a412-605701b51319" xlink:to="loc_us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourthYear_019e2c00-6d8a-7ba3-a209-fef0967aeeed" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingencyUndiscountedToBePaidAfterYearFour_019e2c00-6d8a-75d6-b29d-914dc64c674d" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingencyUndiscountedToBePaidAfterYearFour"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_AccrualForEnvironmentalLossContingenciesGross_019e2c00-6d8a-7ce1-a412-605701b51319" xlink:to="loc_unf_AccrualForEnvironmentalLossContingencyUndiscountedToBePaidAfterYearFour_019e2c00-6d8a-75d6-b29d-914dc64c674d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/CommitmentsandContingenciesScheduleofAnticipatedPaymentsandInsuranceProceedsofCurrentlyIdentifiedEnvironmentalRemediationLiabilitiesDetails_1" xlink:type="simple" xlink:href="unf-20260530.xsd#CommitmentsandContingenciesScheduleofAnticipatedPaymentsandInsuranceProceedsofCurrentlyIdentifiedEnvironmentalRemediationLiabilitiesDetails_1"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/CommitmentsandContingenciesScheduleofAnticipatedPaymentsandInsuranceProceedsofCurrentlyIdentifiedEnvironmentalRemediationLiabilitiesDetails_1" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7153-8bed-27c7e2fc1cc5" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidRemainderOfFiscalYearNetOfEstimatedInsuranceProceeds_019e217b-bf60-72f2-b0ef-a38f1227e7d5" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidRemainderOfFiscalYearNetOfEstimatedInsuranceProceeds"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7153-8bed-27c7e2fc1cc5" xlink:to="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidRemainderOfFiscalYearNetOfEstimatedInsuranceProceeds_019e217b-bf60-72f2-b0ef-a38f1227e7d5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearOneNetOfEstimatedInsuranceProceeds_019e217b-bf60-75e5-8ac2-391bbba332f4" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearOneNetOfEstimatedInsuranceProceeds"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7153-8bed-27c7e2fc1cc5" xlink:to="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearOneNetOfEstimatedInsuranceProceeds_019e217b-bf60-75e5-8ac2-391bbba332f4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearTwoNetOfEstimatedInsuranceProceeds_019e217b-bf60-7199-b855-2ed77140ac16" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearTwoNetOfEstimatedInsuranceProceeds"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7153-8bed-27c7e2fc1cc5" xlink:to="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearTwoNetOfEstimatedInsuranceProceeds_019e217b-bf60-7199-b855-2ed77140ac16" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearThreeNetOfEstimatedInsuranceProceeds_019e217b-bf60-7aa0-a377-0523c5ca90e9" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearThreeNetOfEstimatedInsuranceProceeds"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7153-8bed-27c7e2fc1cc5" xlink:to="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearThreeNetOfEstimatedInsuranceProceeds_019e217b-bf60-7aa0-a377-0523c5ca90e9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearFourNetOfEstimatedInsuranceProceeds_019e217b-bf60-7c6f-80d5-c5730c3ecf9b" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearFourNetOfEstimatedInsuranceProceeds"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7153-8bed-27c7e2fc1cc5" xlink:to="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidYearFourNetOfEstimatedInsuranceProceeds_019e217b-bf60-7c6f-80d5-c5730c3ecf9b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidAfterYearFourNetOfEstimatedInsuranceProceeds_019e217b-bf60-7c4e-8eed-09533a1c93ff" xlink:href="unf-20260530.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidAfterYearFourNetOfEstimatedInsuranceProceeds"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds_019e217b-bf60-7153-8bed-27c7e2fc1cc5" xlink:to="loc_unf_AccrualForEnvironmentalLossContingenciesUndiscountedToBePaidAfterYearFourNetOfEstimatedInsuranceProceeds_019e217b-bf60-7c4e-8eed-09533a1c93ff" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/AccumulatedOtherComprehensiveLossComponentsofAccumulatedOtherComprehensiveLossNetofTaxDetails" xlink:type="simple" xlink:href="unf-20260530.xsd#AccumulatedOtherComprehensiveLossComponentsofAccumulatedOtherComprehensiveLossNetofTaxDetails"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/AccumulatedOtherComprehensiveLossComponentsofAccumulatedOtherComprehensiveLossNetofTaxDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_019e217b-bf60-74c6-aca7-dcecccb89bd6" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OciBeforeReclassificationsNetOfTaxAttributableToParent_019e217b-bf60-7ef4-b034-85b3b9816f28" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OciBeforeReclassificationsNetOfTaxAttributableToParent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_019e217b-bf60-74c6-aca7-dcecccb89bd6" xlink:to="loc_us-gaap_OciBeforeReclassificationsNetOfTaxAttributableToParent_019e217b-bf60-7ef4-b034-85b3b9816f28" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReclassificationFromAociCurrentPeriodNetOfTaxAttributableToParent_019e217b-bf60-7681-97a7-386497e64980" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_ReclassificationFromAociCurrentPeriodNetOfTaxAttributableToParent"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_019e217b-bf60-74c6-aca7-dcecccb89bd6" xlink:to="loc_us-gaap_ReclassificationFromAociCurrentPeriodNetOfTaxAttributableToParent_019e217b-bf60-7681-97a7-386497e64980" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/role/SegmentReportingScheduleofReconciliationofTotalSegmentOperatingIncometoConsolidatedNetIncomeDetails" xlink:type="simple" xlink:href="unf-20260530.xsd#SegmentReportingScheduleofReconciliationofTotalSegmentOperatingIncometoConsolidatedNetIncomeDetails"/>
  <link:calculationLink xlink:role="http://unifirst.com/role/SegmentReportingScheduleofReconciliationofTotalSegmentOperatingIncometoConsolidatedNetIncomeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e3a24-cd32-7685-953d-1c39a04ea232" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_019e3a24-cd32-75c9-a8cf-5d25773a73e0" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e3a24-cd32-7685-953d-1c39a04ea232" xlink:to="loc_us-gaap_OperatingIncomeLoss_019e3a24-cd32-75c9-a8cf-5d25773a73e0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_019e3a24-cd32-70e5-99cf-96bcd4545ad8" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e3a24-cd32-7685-953d-1c39a04ea232" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_019e3a24-cd32-70e5-99cf-96bcd4545ad8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_019e4ffd-c71a-7988-bc76-e8cc1700606e" xlink:href="https://xbrl.fasb.org/us-gaap/2026/elts/us-gaap-2026.xsd#us-gaap_InterestIncomeExpenseNonoperatingNet"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="https://xbrl.org/2023/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_019e3a24-cd32-7685-953d-1c39a04ea232" xlink:to="loc_us-gaap_InterestIncomeExpenseNonoperatingNet_019e4ffd-c71a-7988-bc76-e8cc1700606e" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
