<?xml version="1.0" encoding="us-ascii"?>
<!-- DFIN ActiveDisclosure(SM) XBRL Linkbase Document - http://www.dfinsolutions.com/ -->
<!-- Creation Date      : 2021-10-27T15:16:37.4750666+00:00 -->
<!-- Version            : 5.0.1.702 -->
<!-- Package ID         : 0b96e136185e40c0afbfbee2fc76f274 -->
<!-- Copyright (c) 2021 Donnelley Financial Solutions, Inc. All Rights Reserved. -->
<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 xlink:type="simple" xlink:href="unf-20210828.xsd#TemplateLink" roleURI="http://unifirst.com/20210828/role/TemplateLink" />
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/StatementConsolidatedStatementsOfIncome" xlink:href="unf-20210828.xsd#Role_StatementConsolidatedStatementsOfIncome" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/StatementConsolidatedStatementsOfIncome">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DepreciationDepletionAndAmortization" xlink:type="locator" xlink:label="us-gaap_DepreciationDepletionAndAmortization" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SellingGeneralAndAdministrativeExpense" xlink:type="locator" xlink:label="us-gaap_SellingGeneralAndAdministrativeExpense" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostOfRevenue" xlink:type="locator" xlink:label="us-gaap_CostOfRevenue" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostsAndExpenses" xlink:type="locator" xlink:label="us-gaap_CostsAndExpenses" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:type="locator" xlink:label="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherNonoperatingIncomeExpense" xlink:type="locator" xlink:label="us-gaap_OtherNonoperatingIncomeExpense" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InterestIncomeExpenseNet" xlink:type="locator" xlink:label="us-gaap_InterestIncomeExpenseNet" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NonoperatingIncomeExpense" xlink:type="locator" xlink:label="us-gaap_NonoperatingIncomeExpense" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingIncomeLoss" xlink:type="locator" xlink:label="us-gaap_OperatingIncomeLoss" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_IncomeTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:type="locator" xlink:label="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss" xlink:type="locator" xlink:label="us-gaap_NetIncomeLoss" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetIncomeLoss" xlink:to="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetIncomeLoss" xlink:to="us-gaap_IncomeTaxExpenseBenefit" order="10020.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:to="us-gaap_OperatingIncomeLoss" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:to="us-gaap_NonoperatingIncomeExpense" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NonoperatingIncomeExpense" xlink:to="us-gaap_InterestIncomeExpenseNet" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NonoperatingIncomeExpense" xlink:to="us-gaap_OtherNonoperatingIncomeExpense" order="10060.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_OperatingIncomeLoss" xlink:to="us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" order="10070.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_OperatingIncomeLoss" xlink:to="us-gaap_CostsAndExpenses" order="10080.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CostsAndExpenses" xlink:to="us-gaap_CostOfRevenue" order="10090.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CostsAndExpenses" xlink:to="us-gaap_SellingGeneralAndAdministrativeExpense" order="10100.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CostsAndExpenses" xlink:to="us-gaap_DepreciationDepletionAndAmortization" order="10110.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/StatementConsolidatedStatementsOfComprehensiveIncome" xlink:href="unf-20210828.xsd#Role_StatementConsolidatedStatementsOfComprehensiveIncome" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/StatementConsolidatedStatementsOfComprehensiveIncome">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIOnDerivativesNetOfTax" xlink:type="locator" xlink:label="us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIOnDerivativesNetOfTax" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodNetOfTax" xlink:type="locator" xlink:label="us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodNetOfTax" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeDefinedBenefitPlansAdjustmentNetOfTaxPortionAttributableToParent" xlink:type="locator" xlink:label="us-gaap_OtherComprehensiveIncomeDefinedBenefitPlansAdjustmentNetOfTaxPortionAttributableToParent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent" xlink:type="locator" xlink:label="us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:type="locator" xlink:label="us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss" xlink:type="locator" xlink:label="us-gaap_NetIncomeLoss" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ComprehensiveIncomeNetOfTax" xlink:type="locator" xlink:label="us-gaap_ComprehensiveIncomeNetOfTax" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_ComprehensiveIncomeNetOfTax" xlink:to="us-gaap_NetIncomeLoss" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_ComprehensiveIncomeNetOfTax" xlink:to="us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:to="us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:to="us-gaap_OtherComprehensiveIncomeDefinedBenefitPlansAdjustmentNetOfTaxPortionAttributableToParent" order="10040.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:to="us-gaap_OtherComprehensiveIncomeUnrealizedGainLossOnDerivativesArisingDuringPeriodNetOfTax" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:to="us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIOnDerivativesNetOfTax" order="10060.00" priority="2" use="optional" weight="-1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/StatementConsolidatedBalanceSheets" xlink:href="unf-20210828.xsd#Role_StatementConsolidatedBalanceSheets" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/StatementConsolidatedBalanceSheets">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:type="locator" xlink:label="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" />
    <link:loc xlink:href="unf-20210828.xsd#unf_PrepaidTaxesCurrent" xlink:type="locator" xlink:label="unf_PrepaidTaxesCurrent" />
    <link:loc xlink:href="unf-20210828.xsd#unf_RentalMerchandiseInService" xlink:type="locator" xlink:label="unf_RentalMerchandiseInService" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryNet" xlink:type="locator" xlink:label="us-gaap_InventoryNet" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ReceivablesNetCurrent" xlink:type="locator" xlink:label="us-gaap_ReceivablesNetCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsAndShortTermInvestments" xlink:type="locator" xlink:label="us-gaap_CashCashEquivalentsAndShortTermInvestments" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAssetsNoncurrent" xlink:type="locator" xlink:label="us-gaap_OtherAssetsNoncurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:type="locator" xlink:label="us-gaap_OperatingLeaseRightOfUseAsset" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxAssetsNet" xlink:type="locator" xlink:label="us-gaap_DeferredIncomeTaxAssetsNet" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherIntangibleAssetsNet" xlink:type="locator" xlink:label="us-gaap_OtherIntangibleAssetsNet" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ContractWithCustomerAssetNetNoncurrent" xlink:type="locator" xlink:label="us-gaap_ContractWithCustomerAssetNetNoncurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill" xlink:type="locator" xlink:label="us-gaap_Goodwill" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:type="locator" xlink:label="us-gaap_PropertyPlantAndEquipmentNet" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsCurrent" xlink:type="locator" xlink:label="us-gaap_AssetsCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Assets" xlink:type="locator" xlink:label="us-gaap_Assets" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiabilityCurrent" xlink:type="locator" xlink:label="us-gaap_OperatingLeaseLiabilityCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedIncomeTaxesCurrent" xlink:type="locator" xlink:label="us-gaap_AccruedIncomeTaxesCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedLiabilitiesCurrent" xlink:type="locator" xlink:label="us-gaap_AccruedLiabilitiesCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableCurrent" xlink:type="locator" xlink:label="us-gaap_AccountsPayableCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:type="locator" xlink:label="us-gaap_OperatingLeaseLiabilityNoncurrent" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccruedAndDeferredIncomeTaxesLongTerm" xlink:type="locator" xlink:label="unf_AccruedAndDeferredIncomeTaxesLongTerm" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" xlink:type="locator" xlink:label="us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesCurrent" xlink:type="locator" xlink:label="us-gaap_LiabilitiesCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:type="locator" xlink:label="us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetainedEarningsAccumulatedDeficit" xlink:type="locator" xlink:label="us-gaap_RetainedEarningsAccumulatedDeficit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdditionalPaidInCapital" xlink:type="locator" xlink:label="us-gaap_AdditionalPaidInCapital" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockValue" xlink:type="locator" xlink:label="us-gaap_CommonStockValue" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockValue" xlink:type="locator" xlink:label="us-gaap_PreferredStockValue" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquity" xlink:type="locator" xlink:label="us-gaap_StockholdersEquity" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommitmentsAndContingencies" xlink:type="locator" xlink:label="us-gaap_CommitmentsAndContingencies" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Liabilities" xlink:type="locator" xlink:label="us-gaap_Liabilities" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquity" xlink:type="locator" xlink:label="us-gaap_LiabilitiesAndStockholdersEquity" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesAndStockholdersEquity" xlink:to="us-gaap_Liabilities" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesAndStockholdersEquity" xlink:to="us-gaap_CommitmentsAndContingencies" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesAndStockholdersEquity" xlink:to="us-gaap_StockholdersEquity" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_PreferredStockValue" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_CommonStockValue" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_AdditionalPaidInCapital" order="10070.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_RetainedEarningsAccumulatedDeficit" order="10080.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_StockholdersEquity" xlink:to="us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" order="10090.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_LiabilitiesCurrent" order="10100.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" order="10110.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="unf_AccruedAndDeferredIncomeTaxesLongTerm" order="10120.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Liabilities" xlink:to="us-gaap_OperatingLeaseLiabilityNoncurrent" order="10130.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="us-gaap_AccountsPayableCurrent" order="10140.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="us-gaap_AccruedLiabilitiesCurrent" order="10150.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="us-gaap_AccruedIncomeTaxesCurrent" order="10160.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LiabilitiesCurrent" xlink:to="us-gaap_OperatingLeaseLiabilityCurrent" order="10170.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_AssetsCurrent" order="10180.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_PropertyPlantAndEquipmentNet" order="10190.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_Goodwill" order="10200.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_ContractWithCustomerAssetNetNoncurrent" order="10210.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_OtherIntangibleAssetsNet" order="10220.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_DeferredIncomeTaxAssetsNet" order="10230.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_OperatingLeaseRightOfUseAsset" order="10240.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_Assets" xlink:to="us-gaap_OtherAssetsNoncurrent" order="10250.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_CashCashEquivalentsAndShortTermInvestments" order="10260.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_ReceivablesNetCurrent" order="10270.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_InventoryNet" order="10280.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="unf_RentalMerchandiseInService" order="10290.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="unf_PrepaidTaxesCurrent" order="10300.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsCurrent" xlink:to="us-gaap_PrepaidExpenseAndOtherAssetsCurrent" order="10310.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/StatementConsolidatedStatementsOfCashFlows" xlink:href="unf-20210828.xsd#Role_StatementConsolidatedStatementsOfCashFlows" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/StatementConsolidatedStatementsOfCashFlows">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable" xlink:type="locator" xlink:label="us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilities" xlink:type="locator" xlink:label="us-gaap_IncreaseDecreaseInAccruedLiabilities" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsPayable" xlink:type="locator" xlink:label="us-gaap_IncreaseDecreaseInAccountsPayable" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:type="locator" xlink:label="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" />
    <link:loc xlink:href="unf-20210828.xsd#unf_IncreaseDecreaseInRentalMerchandiseInService" xlink:type="locator" xlink:label="unf_IncreaseDecreaseInRentalMerchandiseInService" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInInventories" xlink:type="locator" xlink:label="us-gaap_IncreaseDecreaseInInventories" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInReceivables" xlink:type="locator" xlink:label="us-gaap_IncreaseDecreaseInReceivables" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxesAndTaxCredits" xlink:type="locator" xlink:label="us-gaap_DeferredIncomeTaxesAndTaxCredits" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherNoncashIncomeExpense" xlink:type="locator" xlink:label="us-gaap_OtherNoncashIncomeExpense" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetRetirementObligationAccretionExpense" xlink:type="locator" xlink:label="us-gaap_AssetRetirementObligationAccretionExpense" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccretionOnEnvironmentalContingencies" xlink:type="locator" xlink:label="unf_AccretionOnEnvironmentalContingencies" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensation" xlink:type="locator" xlink:label="us-gaap_ShareBasedCompensation" />
    <link:loc xlink:href="unf-20210828.xsd#unf_ForgivenessOfLiability" xlink:type="locator" xlink:label="unf_ForgivenessOfLiability" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AmortizationOfFinancingCostsAndDiscounts" xlink:type="locator" xlink:label="us-gaap_AmortizationOfFinancingCostsAndDiscounts" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DepreciationDepletionAndAmortization" xlink:type="locator" xlink:label="us-gaap_DepreciationDepletionAndAmortization" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProfitLoss" xlink:type="locator" xlink:label="us-gaap_ProfitLoss" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" xlink:type="locator" xlink:label="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:type="locator" xlink:label="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired" xlink:type="locator" xlink:label="us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsOfDividends" xlink:type="locator" xlink:label="us-gaap_PaymentsOfDividends" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:type="locator" xlink:label="us-gaap_PaymentsForRepurchaseOfCommonStock" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation" xlink:type="locator" xlink:label="us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromStockOptionsExercised" xlink:type="locator" xlink:label="us-gaap_ProceedsFromStockOptionsExercised" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsOfFinancingCosts" xlink:type="locator" xlink:label="us-gaap_PaymentsOfFinancingCosts" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations" xlink:type="locator" xlink:label="us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:type="locator" xlink:label="us-gaap_NetCashProvidedByUsedInFinancingActivities" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:type="locator" xlink:label="us-gaap_NetCashProvidedByUsedInInvestingActivities" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:type="locator" xlink:label="us-gaap_NetCashProvidedByUsedInOperatingActivities" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:type="locator" xlink:label="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="us-gaap_NetCashProvidedByUsedInOperatingActivities" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="us-gaap_NetCashProvidedByUsedInInvestingActivities" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="us-gaap_NetCashProvidedByUsedInFinancingActivities" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsIncludingDisposalGroupAndDiscontinuedOperations" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_PaymentsOfFinancingCosts" order="10050.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_ProceedsFromStockOptionsExercised" order="10060.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation" order="10070.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_PaymentsForRepurchaseOfCommonStock" order="10080.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="us-gaap_PaymentsOfDividends" order="10090.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired" order="10100.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" order="10110.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="us-gaap_ProceedsFromSaleOfPropertyPlantAndEquipment" order="10120.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_ProfitLoss" order="10130.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_DepreciationDepletionAndAmortization" order="10140.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_AmortizationOfFinancingCostsAndDiscounts" order="10150.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="unf_ForgivenessOfLiability" order="10160.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_ShareBasedCompensation" order="10170.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="unf_AccretionOnEnvironmentalContingencies" order="10180.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_AssetRetirementObligationAccretionExpense" order="10190.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_OtherNoncashIncomeExpense" order="10200.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_DeferredIncomeTaxesAndTaxCredits" order="10210.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInReceivables" order="10220.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInInventories" order="10230.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="unf_IncreaseDecreaseInRentalMerchandiseInService" order="10240.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" order="10250.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInAccountsPayable" order="10260.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInAccruedLiabilities" order="10270.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable" order="10280.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureSummaryOfSignificantAccountingPoliciesScheduleOfComponentsOfInventoryDetails" xlink:href="unf-20210828.xsd#Role_DisclosureSummaryOfSignificantAccountingPoliciesScheduleOfComponentsOfInventoryDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureSummaryOfSignificantAccountingPoliciesScheduleOfComponentsOfInventoryDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryFinishedGoodsNetOfReserves" xlink:type="locator" xlink:label="us-gaap_InventoryFinishedGoodsNetOfReserves" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryWorkInProcessNetOfReserves" xlink:type="locator" xlink:label="us-gaap_InventoryWorkInProcessNetOfReserves" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryRawMaterialsNetOfReserves" xlink:type="locator" xlink:label="us-gaap_InventoryRawMaterialsNetOfReserves" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryNet" xlink:type="locator" xlink:label="us-gaap_InventoryNet" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_InventoryNet" xlink:to="us-gaap_InventoryRawMaterialsNetOfReserves" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_InventoryNet" xlink:to="us-gaap_InventoryWorkInProcessNetOfReserves" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_InventoryNet" xlink:to="us-gaap_InventoryFinishedGoodsNetOfReserves" order="10030.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureSummaryOfSignificantAccountingPoliciesScheduleOfComponentsOfPropertyPlantAndEquipmentDetails" xlink:href="unf-20210828.xsd#Role_DisclosureSummaryOfSignificantAccountingPoliciesScheduleOfComponentsOfPropertyPlantAndEquipmentDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureSummaryOfSignificantAccountingPoliciesScheduleOfComponentsOfPropertyPlantAndEquipmentDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:type="locator" xlink:label="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:type="locator" xlink:label="us-gaap_PropertyPlantAndEquipmentGross" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:type="locator" xlink:label="us-gaap_PropertyPlantAndEquipmentNet" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_PropertyPlantAndEquipmentNet" xlink:to="us-gaap_PropertyPlantAndEquipmentGross" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_PropertyPlantAndEquipmentNet" xlink:to="us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" order="10020.00" priority="2" use="optional" weight="-1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureAcquisitionsScheduleOfAcquisitionOfBusinessDetails" xlink:href="unf-20210828.xsd#Role_DisclosureAcquisitionsScheduleOfAcquisitionOfBusinessDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureAcquisitionsScheduleOfAcquisitionOfBusinessDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities" xlink:type="locator" xlink:label="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill" xlink:type="locator" xlink:label="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill" />
    <link:loc xlink:href="unf-20210828.xsd#unf_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCustomerContracts" xlink:type="locator" xlink:label="unf_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCustomerContracts" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill" xlink:type="locator" xlink:label="us-gaap_Goodwill" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedAssets" xlink:type="locator" xlink:label="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedAssets" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet" xlink:type="locator" xlink:label="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet" xlink:to="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedAssets" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet" xlink:to="us-gaap_Goodwill" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet" xlink:to="unf_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCustomerContracts" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet" xlink:to="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedNet" xlink:to="us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities" order="10050.00" priority="2" use="optional" weight="-1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureFairValueMeasurementsScheduleOfAssetsOrLiabilitiesMeasuredAtFairValueOnRecurringBasisDetails" xlink:href="unf-20210828.xsd#Role_DisclosureFairValueMeasurementsScheduleOfAssetsOrLiabilitiesMeasuredAtFairValueOnRecurringBasisDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureFairValueMeasurementsScheduleOfAssetsOrLiabilitiesMeasuredAtFairValueOnRecurringBasisDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignCurrencyContractAssetFairValueDisclosure" xlink:type="locator" xlink:label="us-gaap_ForeignCurrencyContractAssetFairValueDisclosure" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanFairValueOfPlanAssets" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanFairValueOfPlanAssets" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashAndCashEquivalentsFairValueDisclosure" xlink:type="locator" xlink:label="us-gaap_CashAndCashEquivalentsFairValueDisclosure" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsFairValueDisclosure" xlink:type="locator" xlink:label="us-gaap_AssetsFairValueDisclosure" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsFairValueDisclosure" xlink:to="us-gaap_CashAndCashEquivalentsFairValueDisclosure" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsFairValueDisclosure" xlink:to="us-gaap_DefinedBenefitPlanFairValueOfPlanAssets" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AssetsFairValueDisclosure" xlink:to="us-gaap_ForeignCurrencyContractAssetFairValueDisclosure" order="10030.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureIncomeTaxesProvisionBenefitForIncomeTaxesDetails" xlink:href="unf-20210828.xsd#Role_DisclosureIncomeTaxesProvisionBenefitForIncomeTaxesDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureIncomeTaxesProvisionBenefitForIncomeTaxesDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_CurrentStateAndLocalTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentForeignTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_CurrentForeignTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentFederalTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_CurrentFederalTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredForeignIncomeTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_DeferredForeignIncomeTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_DeferredFederalIncomeTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_DeferredIncomeTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_CurrentIncomeTaxExpenseBenefit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:type="locator" xlink:label="us-gaap_IncomeTaxExpenseBenefit" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_CurrentIncomeTaxExpenseBenefit" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_IncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredIncomeTaxExpenseBenefit" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredFederalIncomeTaxExpenseBenefit" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredForeignIncomeTaxExpenseBenefit" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:to="us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:to="us-gaap_CurrentFederalTaxExpenseBenefit" order="10060.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:to="us-gaap_CurrentForeignTaxExpenseBenefit" order="10070.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:to="us-gaap_CurrentStateAndLocalTaxExpenseBenefit" order="10080.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureIncomeTaxesReconciliationOfProvisionForIncomeTaxesDetails" xlink:href="unf-20210828.xsd#Role_DisclosureIncomeTaxesReconciliationOfProvisionForIncomeTaxesDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureIncomeTaxesReconciliationOfProvisionForIncomeTaxesDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" xlink:type="locator" xlink:label="us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes" xlink:type="locator" xlink:label="us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" xlink:type="locator" xlink:label="us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:type="locator" xlink:label="us-gaap_EffectiveIncomeTaxRateContinuingOperations" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:to="us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:to="us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:to="us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" order="10030.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureIncomeTaxesComponentsOfDeferredIncomeTaxesDetails" xlink:href="unf-20210828.xsd#Role_DisclosureIncomeTaxesComponentsOfDeferredIncomeTaxesDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureIncomeTaxesComponentsOfDeferredIncomeTaxesDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsOther" xlink:type="locator" xlink:label="us-gaap_DeferredTaxAssetsOther" />
    <link:loc xlink:href="unf-20210828.xsd#unf_DeferredTaxAssetsTaxDeferredExpenseOperatingLeaseLiabilities" xlink:type="locator" xlink:label="unf_DeferredTaxAssetsTaxDeferredExpenseOperatingLeaseLiabilities" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAccruedLiabilities" xlink:type="locator" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAccruedLiabilities" />
    <link:loc xlink:href="unf-20210828.xsd#unf_DeferredTaxAssetsTaxDeferredExpenseEnvironmental" xlink:type="locator" xlink:label="unf_DeferredTaxAssetsTaxDeferredExpenseEnvironmental" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsSelfInsurance" xlink:type="locator" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsSelfInsurance" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsEmployeeCompensation" xlink:type="locator" xlink:label="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsEmployeeCompensation" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesOther" xlink:type="locator" xlink:label="us-gaap_DeferredTaxLiabilitiesOther" />
    <link:loc xlink:href="unf-20210828.xsd#unf_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" xlink:type="locator" xlink:label="unf_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesLeasingArrangements" xlink:type="locator" xlink:label="us-gaap_DeferredTaxLiabilitiesLeasingArrangements" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets" xlink:type="locator" xlink:label="us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesPropertyPlantAndEquipment" xlink:type="locator" xlink:label="us-gaap_DeferredTaxLiabilitiesPropertyPlantAndEquipment" />
    <link:loc xlink:href="unf-20210828.xsd#unf_DeferredTaxLiabilitiesTaxDeferredExpenseCompensationAndBenefitsEmployeeCompensation" xlink:type="locator" xlink:label="unf_DeferredTaxLiabilitiesTaxDeferredExpenseCompensationAndBenefitsEmployeeCompensation" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilities" xlink:type="locator" xlink:label="us-gaap_DeferredIncomeTaxLiabilities" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsGross" xlink:type="locator" xlink:label="us-gaap_DeferredTaxAssetsGross" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilities" xlink:type="locator" xlink:label="us-gaap_DeferredTaxLiabilities" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxLiabilities" xlink:to="us-gaap_DeferredTaxAssetsGross" order="10010.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxLiabilities" xlink:to="us-gaap_DeferredIncomeTaxLiabilities" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="unf_DeferredTaxLiabilitiesTaxDeferredExpenseCompensationAndBenefitsEmployeeCompensation" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="us-gaap_DeferredTaxLiabilitiesPropertyPlantAndEquipment" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="us-gaap_DeferredTaxLiabilitiesLeasingArrangements" order="10060.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="unf_DeferredTaxLiabilitiesOperatingLeaseRightOfUseAssets" order="10070.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredIncomeTaxLiabilities" xlink:to="us-gaap_DeferredTaxLiabilitiesOther" order="10080.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsEmployeeCompensation" order="10090.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsSelfInsurance" order="10100.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="unf_DeferredTaxAssetsTaxDeferredExpenseEnvironmental" order="10110.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAccruedLiabilities" order="10120.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="unf_DeferredTaxAssetsTaxDeferredExpenseOperatingLeaseLiabilities" order="10130.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DeferredTaxAssetsGross" xlink:to="us-gaap_DeferredTaxAssetsOther" order="10140.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureEmployeeBenefitPlansComponentsOfNetPeriodicBenefitCostDetails" xlink:href="unf-20210828.xsd#Role_DisclosureEmployeeBenefitPlansComponentsOfNetPeriodicBenefitCostDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureEmployeeBenefitPlansComponentsOfNetPeriodicBenefitCostDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanOtherCosts" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanOtherCosts" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanInterestCost" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanInterestCost" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanServiceCost" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanServiceCost" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost" xlink:to="us-gaap_DefinedBenefitPlanServiceCost" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost" xlink:to="us-gaap_DefinedBenefitPlanInterestCost" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost" xlink:to="us-gaap_DefinedBenefitPlanExpectedReturnOnPlanAssets" order="10030.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost" xlink:to="us-gaap_DefinedBenefitPlanAmortizationOfPriorServiceCostCredit" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost" xlink:to="us-gaap_DefinedBenefitPlanAmortizationOfGainsLosses" order="10050.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanNetPeriodicBenefitCost" xlink:to="us-gaap_DefinedBenefitPlanOtherCosts" order="10060.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureEmployeeBenefitPlansObligationsAndFundedStatusDetails" xlink:href="unf-20210828.xsd#Role_DisclosureEmployeeBenefitPlansObligationsAndFundedStatusDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureEmployeeBenefitPlansObligationsAndFundedStatusDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanFairValueOfPlanAssets" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanFairValueOfPlanAssets" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanBenefitObligation" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanBenefitObligation" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanFundedStatusOfPlan" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanFundedStatusOfPlan" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanFundedStatusOfPlan" xlink:to="us-gaap_DefinedBenefitPlanBenefitObligation" order="10010.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanFundedStatusOfPlan" xlink:to="us-gaap_DefinedBenefitPlanFairValueOfPlanAssets" order="10020.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureEmployeeBenefitPlansAmountsRecognizedInAccumulatedOtherComprehensiveLossDetails" xlink:href="unf-20210828.xsd#Role_DisclosureEmployeeBenefitPlansAmountsRecognizedInAccumulatedOtherComprehensiveLossDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureEmployeeBenefitPlansAmountsRecognizedInAccumulatedOtherComprehensiveLossDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeNetPriorServiceCostCreditBeforeTax" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeNetPriorServiceCostCreditBeforeTax" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeNetGainsLossesBeforeTax" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeNetGainsLossesBeforeTax" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeBeforeTax" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeBeforeTax" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeBeforeTax" xlink:to="us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeNetGainsLossesBeforeTax" order="10010.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeBeforeTax" xlink:to="us-gaap_DefinedBenefitPlanAccumulatedOtherComprehensiveIncomeNetPriorServiceCostCreditBeforeTax" order="10020.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureEmployeeBenefitPlansExpectedBenefitPaymentsDetails" xlink:href="unf-20210828.xsd#Role_DisclosureEmployeeBenefitPlansExpectedBenefitPaymentsDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureEmployeeBenefitPlansExpectedBenefitPaymentsDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsFiveFiscalYearsThereafter" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsFiveFiscalYearsThereafter" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearFive" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearFive" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearFour" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearFour" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearThree" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearThree" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearTwo" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearTwo" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsNextTwelveMonths" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsNextTwelveMonths" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedBenefitPlanBenefitObligation" xlink:type="locator" xlink:label="us-gaap_DefinedBenefitPlanBenefitObligation" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanBenefitObligation" xlink:to="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsNextTwelveMonths" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanBenefitObligation" xlink:to="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearTwo" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanBenefitObligation" xlink:to="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearThree" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanBenefitObligation" xlink:to="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearFour" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanBenefitObligation" xlink:to="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsYearFive" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_DefinedBenefitPlanBenefitObligation" xlink:to="us-gaap_DefinedBenefitPlanExpectedFutureBenefitPaymentsFiveFiscalYearsThereafter" order="10060.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureGoodwillAndOtherIntangibleAssetsScheduleOfIntangibleAssetsNetDetails" xlink:href="unf-20210828.xsd#Role_DisclosureGoodwillAndOtherIntangibleAssetsScheduleOfIntangibleAssetsNetDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureGoodwillAndOtherIntangibleAssetsScheduleOfIntangibleAssetsNetDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsGross" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsGross" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsNet" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="us-gaap_FiniteLivedIntangibleAssetsGross" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" order="10020.00" priority="2" use="optional" weight="-1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureGoodwillAndOtherIntangibleAssetsScheduleOfEstimatedFutureAmortizationExpenseDetails" xlink:href="unf-20210828.xsd#Role_DisclosureGoodwillAndOtherIntangibleAssetsScheduleOfEstimatedFutureAmortizationExpenseDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureGoodwillAndOtherIntangibleAssetsScheduleOfEstimatedFutureAmortizationExpenseDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet" xlink:type="locator" xlink:label="us-gaap_FiniteLivedIntangibleAssetsNet" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive" order="10060.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureAccruedLiabilitiesScheduleOfAccruedLiabilitiesDetails" xlink:href="unf-20210828.xsd#Role_DisclosureAccruedLiabilitiesScheduleOfAccruedLiabilitiesDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureAccruedLiabilitiesScheduleOfAccruedLiabilitiesDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAccruedLiabilitiesCurrent" xlink:type="locator" xlink:label="us-gaap_OtherAccruedLiabilitiesCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedEnvironmentalLossContingenciesCurrent" xlink:type="locator" xlink:label="us-gaap_AccruedEnvironmentalLossContingenciesCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedInsuranceCurrent" xlink:type="locator" xlink:label="us-gaap_AccruedInsuranceCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedBonusesCurrent" xlink:type="locator" xlink:label="us-gaap_AccruedBonusesCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeRelatedLiabilitiesCurrent" xlink:type="locator" xlink:label="us-gaap_EmployeeRelatedLiabilitiesCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedInsuranceNoncurrent" xlink:type="locator" xlink:label="us-gaap_AccruedInsuranceNoncurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetRetirementObligationsNoncurrent" xlink:type="locator" xlink:label="us-gaap_AssetRetirementObligationsNoncurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedEnvironmentalLossContingenciesNoncurrent" xlink:type="locator" xlink:label="us-gaap_AccruedEnvironmentalLossContingenciesNoncurrent" />
    <link:loc xlink:href="unf-20210828.xsd#unf_EmployeeRelatedLiabilitiesNoncurrent" xlink:type="locator" xlink:label="unf_EmployeeRelatedLiabilitiesNoncurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" xlink:type="locator" xlink:label="us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedLiabilitiesCurrent" xlink:type="locator" xlink:label="us-gaap_AccruedLiabilitiesCurrent" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent" xlink:type="locator" xlink:label="us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent" xlink:to="us-gaap_AccruedLiabilitiesCurrent" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent" xlink:to="us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" xlink:to="unf_EmployeeRelatedLiabilitiesNoncurrent" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" xlink:to="us-gaap_AccruedEnvironmentalLossContingenciesNoncurrent" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" xlink:to="us-gaap_AssetRetirementObligationsNoncurrent" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccountsPayableAndAccruedLiabilitiesNoncurrent" xlink:to="us-gaap_AccruedInsuranceNoncurrent" order="10060.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccruedLiabilitiesCurrent" xlink:to="us-gaap_EmployeeRelatedLiabilitiesCurrent" order="10070.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccruedLiabilitiesCurrent" xlink:to="us-gaap_AccruedBonusesCurrent" order="10080.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccruedLiabilitiesCurrent" xlink:to="us-gaap_AccruedInsuranceCurrent" order="10090.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccruedLiabilitiesCurrent" xlink:to="us-gaap_AccruedEnvironmentalLossContingenciesCurrent" order="10100.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccruedLiabilitiesCurrent" xlink:to="us-gaap_OtherAccruedLiabilitiesCurrent" order="10110.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureCommitmentsAndContingenciesScheduleOfContractualFutureMinimumLeasePaymentsOfOperatingLeaseLiabilitiesDetails" xlink:href="unf-20210828.xsd#Role_DisclosureCommitmentsAndContingenciesScheduleOfContractualFutureMinimumLeasePaymentsOfOperatingLeaseLiabilitiesDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureCommitmentsAndContingenciesScheduleOfContractualFutureMinimumLeasePaymentsOfOperatingLeaseLiabilitiesDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" order="10030.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" order="10060.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureCommitmentsAndContingenciesScheduleOfContractualFutureMinimumLeasePaymentsOfOperatingLeaseLiabilitiesDetails2" xlink:href="unf-20210828.xsd#Role_DisclosureCommitmentsAndContingenciesScheduleOfContractualFutureMinimumLeasePaymentsOfOperatingLeaseLiabilitiesDetails2" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureCommitmentsAndContingenciesScheduleOfContractualFutureMinimumLeasePaymentsOfOperatingLeaseLiabilitiesDetails2">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiability" xlink:type="locator" xlink:label="us-gaap_OperatingLeaseLiability" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:type="locator" xlink:label="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="us-gaap_OperatingLeaseLiability" order="10020.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
  <link:roleRef roleURI="http://unifirst.com/20210828/taxonomy/role/DisclosureCommitmentsAndContingenciesAnticipatedPaymentsAndInsuranceProceedsOfIdentifiedEnvironmentalRemediationLiabilitiesDetails" xlink:href="unf-20210828.xsd#Role_DisclosureCommitmentsAndContingenciesAnticipatedPaymentsAndInsuranceProceedsOfIdentifiedEnvironmentalRemediationLiabilitiesDetails" xlink:type="simple" />
  <link:calculationLink xlink:type="extended" xlink:role="http://unifirst.com/20210828/taxonomy/role/DisclosureCommitmentsAndContingenciesAnticipatedPaymentsAndInsuranceProceedsOfIdentifiedEnvironmentalRemediationLiabilitiesDetails">
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYear" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYear" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFifthYear" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFifthYear" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourthYear" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourthYear" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThirdYear" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThirdYear" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInSecondYear" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInSecondYear" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesGross" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingenciesGross" />
    <link:loc xlink:href="unf-20210828.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYear" xlink:type="locator" xlink:label="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYear" />
    <link:loc xlink:href="unf-20210828.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInFifthYear" xlink:type="locator" xlink:label="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInFifthYear" />
    <link:loc xlink:href="unf-20210828.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInFourthYear" xlink:type="locator" xlink:label="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInFourthYear" />
    <link:loc xlink:href="unf-20210828.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInThirdYear" xlink:type="locator" xlink:label="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInThirdYear" />
    <link:loc xlink:href="unf-20210828.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInSecondYear" xlink:type="locator" xlink:label="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInSecondYear" />
    <link:loc xlink:href="unf-20210828.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear" xlink:type="locator" xlink:label="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear" />
    <link:loc xlink:href="unf-20210828.xsd#unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross" xlink:type="locator" xlink:label="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYearNetOfEstimatedInsuranceProceeds" xlink:type="locator" xlink:label="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYearNetOfEstimatedInsuranceProceeds" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFiveYearsNetOfEstimatedInsuranceProceeds" xlink:type="locator" xlink:label="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFiveYearsNetOfEstimatedInsuranceProceeds" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourYearsNetOfEstimatedInsuranceProceeds" xlink:type="locator" xlink:label="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourYearsNetOfEstimatedInsuranceProceeds" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThreeYearsNetOfEstimatedInsuranceProceeds" xlink:type="locator" xlink:label="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThreeYearsNetOfEstimatedInsuranceProceeds" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInTwoYearsNetOfEstimatedInsuranceProceeds" xlink:type="locator" xlink:label="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInTwoYearsNetOfEstimatedInsuranceProceeds" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYearNetOfEstimatedInsuranceProceeds" xlink:type="locator" xlink:label="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYearNetOfEstimatedInsuranceProceeds" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingenciesDiscount" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingenciesDiscount" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccrualForEnvironmentalLossContingenciesEffectOfInflation" xlink:type="locator" xlink:label="unf_AccrualForEnvironmentalLossContingenciesEffectOfInflation" />
    <link:loc xlink:href="unf-20210828.xsd#unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" xlink:type="locator" xlink:label="unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" />
    <link:loc xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccrualForEnvironmentalLossContingencies" xlink:type="locator" xlink:label="us-gaap_AccrualForEnvironmentalLossContingencies" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingencies" xlink:to="unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" order="10010.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingencies" xlink:to="unf_AccrualForEnvironmentalLossContingenciesEffectOfInflation" order="10020.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingencies" xlink:to="us-gaap_AccrualForEnvironmentalLossContingenciesDiscount" order="10030.00" priority="2" use="optional" weight="-1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" xlink:to="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYearNetOfEstimatedInsuranceProceeds" order="10040.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" xlink:to="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInTwoYearsNetOfEstimatedInsuranceProceeds" order="10050.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" xlink:to="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThreeYearsNetOfEstimatedInsuranceProceeds" order="10060.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" xlink:to="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourYearsNetOfEstimatedInsuranceProceeds" order="10070.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" xlink:to="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFiveYearsNetOfEstimatedInsuranceProceeds" order="10080.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_AccrualForEnvironmentalLossContingenciesNetOfEstimatedInsuranceProceeds" xlink:to="unf_AccrualForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYearNetOfEstimatedInsuranceProceeds" order="10090.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross" xlink:to="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear" order="10100.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross" xlink:to="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInSecondYear" order="10110.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross" xlink:to="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInThirdYear" order="10120.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross" xlink:to="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInFourthYear" order="10130.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross" xlink:to="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueInFifthYear" order="10140.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesGross" xlink:to="unf_EstimatedInsuranceProceedsForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYear" order="10150.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingenciesGross" xlink:to="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueWithinOneYear" order="10160.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingenciesGross" xlink:to="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInSecondYear" order="10170.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingenciesGross" xlink:to="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInThirdYear" order="10180.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingenciesGross" xlink:to="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFourthYear" order="10190.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingenciesGross" xlink:to="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueInFifthYear" order="10200.00" priority="2" use="optional" weight="1.00" />
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="us-gaap_AccrualForEnvironmentalLossContingenciesGross" xlink:to="us-gaap_AccrualForEnvironmentalLossContingenciesUndiscountedDueAfterFifthYear" order="10210.00" priority="2" use="optional" weight="1.00" />
  </link:calculationLink>
</link:linkbase>
