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

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2021 Workiva-->
<!--r:a87039c4-2fcc-45c9-b365-4bab5f3d8573,g:1b6fd14f-8b43-42ad-82c9-d667f6dff3d6-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:roleRef roleURI="http://www.cognex.com/role/CoverPage" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CoverPage"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CoverPage" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedStatementsofOperations" xlink:type="simple" xlink:href="cgnx-20210404.xsd#ConsolidatedStatementsofOperations"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/ConsolidatedStatementsofOperations" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_12cd9949-00ee-49b7-ae15-b29d5af1f1bd" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GrossProfit"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_14f27ae4-6951-433b-98d9-a89e290dc784" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_GrossProfit_12cd9949-00ee-49b7-ae15-b29d5af1f1bd" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_14f27ae4-6951-433b-98d9-a89e290dc784" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsAndServicesSold_5c1fac23-5333-448e-b487-8bdd302eb186" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CostOfGoodsAndServicesSold"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_GrossProfit_12cd9949-00ee-49b7-ae15-b29d5af1f1bd" xlink:to="loc_us-gaap_CostOfGoodsAndServicesSold_5c1fac23-5333-448e-b487-8bdd302eb186" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments_60e75cf4-ec9e-4a6d-abbf-3fae7106feca" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_430771c4-24a7-47a1-b3a8-c00dc66872bc" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments_60e75cf4-ec9e-4a6d-abbf-3fae7106feca" xlink:to="loc_us-gaap_OperatingIncomeLoss_430771c4-24a7-47a1-b3a8-c00dc66872bc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax_87f44974-dc24-4f3d-947e-3fb446a06122" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ForeignCurrencyTransactionGainLossBeforeTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments_60e75cf4-ec9e-4a6d-abbf-3fae7106feca" xlink:to="loc_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax_87f44974-dc24-4f3d-947e-3fb446a06122" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeNonoperating_29516495-1d60-4500-91f1-c57c710b52c9" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InvestmentIncomeNonoperating"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments_60e75cf4-ec9e-4a6d-abbf-3fae7106feca" xlink:to="loc_us-gaap_InvestmentIncomeNonoperating_29516495-1d60-4500-91f1-c57c710b52c9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_aac89555-046d-46ff-9848-d745ea10a1bc" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments_60e75cf4-ec9e-4a6d-abbf-3fae7106feca" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_aac89555-046d-46ff-9848-d745ea10a1bc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_850f44c9-e7b5-4165-aee8-8a74ceffa8a5" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit_9a3785c4-71b8-452f-891f-0c86af89a539" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GrossProfit"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_850f44c9-e7b5-4165-aee8-8a74ceffa8a5" xlink:to="loc_us-gaap_GrossProfit_9a3785c4-71b8-452f-891f-0c86af89a539" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpense_4b5ea057-36aa-4a45-8349-f1a9f000095d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ResearchAndDevelopmentExpense"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_850f44c9-e7b5-4165-aee8-8a74ceffa8a5" xlink:to="loc_us-gaap_ResearchAndDevelopmentExpense_4b5ea057-36aa-4a45-8349-f1a9f000095d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense_9a6acaf9-5e0f-44b2-b1e9-3f5a8b7563cb" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingIncomeLoss_850f44c9-e7b5-4165-aee8-8a74ceffa8a5" xlink:to="loc_us-gaap_SellingGeneralAndAdministrativeExpense_9a6acaf9-5e0f-44b2-b1e9-3f5a8b7563cb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_59935666-1f53-4e37-865d-138a7285b1ee" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments_881645ee-c149-497f-a238-d7bf215c032d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_59935666-1f53-4e37-865d-138a7285b1ee" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments_881645ee-c149-497f-a238-d7bf215c032d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_2ddfc342-3cc3-41f2-a049-f1c15c5ed63b" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_59935666-1f53-4e37-865d-138a7285b1ee" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_2ddfc342-3cc3-41f2-a049-f1c15c5ed63b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedStatementsofComprehensiveIncome" xlink:type="simple" xlink:href="cgnx-20210404.xsd#ConsolidatedStatementsofComprehensiveIncome"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/ConsolidatedStatementsofComprehensiveIncome" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_b04cf210-d0d9-430d-af69-3f687e5a4684" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_b051d892-3e3c-443a-bf99-3cd7f02e7f30" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_b04cf210-d0d9-430d-af69-3f687e5a4684" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_b051d892-3e3c-443a-bf99-3cd7f02e7f30" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossFinancialLiabilityFairValueOptionReclassificationAdjustmentFromAociForDerecognitionAfterTax_36ab3ad3-9c6a-4ac5-9c34-9bb45e004d0d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossFinancialLiabilityFairValueOptionReclassificationAdjustmentFromAociForDerecognitionAfterTax"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_b04cf210-d0d9-430d-af69-3f687e5a4684" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossFinancialLiabilityFairValueOptionReclassificationAdjustmentFromAociForDerecognitionAfterTax_36ab3ad3-9c6a-4ac5-9c34-9bb45e004d0d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_be8796ab-65f3-4a78-b849-a2a85d5ee216" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_b04cf210-d0d9-430d-af69-3f687e5a4684" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_be8796ab-65f3-4a78-b849-a2a85d5ee216" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_2f1e1107-386a-4335-a3a4-9aa06dd57e93" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_fc509c88-ea31-479f-a0fc-4419a1374386" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_2f1e1107-386a-4335-a3a4-9aa06dd57e93" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_fc509c88-ea31-479f-a0fc-4419a1374386" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_877b864d-8705-45fa-b701-236e7c887560" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_2f1e1107-386a-4335-a3a4-9aa06dd57e93" xlink:to="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_877b864d-8705-45fa-b701-236e7c887560" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_bf0d6456-4be9-417b-9993-a56b8c50b4bf" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_d2f3d1f6-da02-4f83-943f-d7afb917811f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_bf0d6456-4be9-417b-9993-a56b8c50b4bf" xlink:to="loc_us-gaap_NetIncomeLoss_d2f3d1f6-da02-4f83-943f-d7afb917811f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_d642ad36-d2d1-4916-b44d-dff2285e229d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_bf0d6456-4be9-417b-9993-a56b8c50b4bf" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_d642ad36-d2d1-4916-b44d-dff2285e229d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedStatementsofComprehensiveIncomeParenthetical" xlink:type="simple" xlink:href="cgnx-20210404.xsd#ConsolidatedStatementsofComprehensiveIncomeParenthetical"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/ConsolidatedStatementsofComprehensiveIncomeParenthetical" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedBalanceSheets" xlink:type="simple" xlink:href="cgnx-20210404.xsd#ConsolidatedBalanceSheets"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/ConsolidatedBalanceSheets" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_c93948a4-89ec-445f-82bd-d6c7516ba568" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalCommonStock_e74aed7a-a9be-4db4-b4bf-c99a0fb57727" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AdditionalPaidInCapitalCommonStock"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_c93948a4-89ec-445f-82bd-d6c7516ba568" xlink:to="loc_us-gaap_AdditionalPaidInCapitalCommonStock_e74aed7a-a9be-4db4-b4bf-c99a0fb57727" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_88591063-4468-46b9-95aa-7cde5b5fdbf6" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_c93948a4-89ec-445f-82bd-d6c7516ba568" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_88591063-4468-46b9-95aa-7cde5b5fdbf6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_2bf9507d-a7de-4542-9bec-a7556e9cb242" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_c93948a4-89ec-445f-82bd-d6c7516ba568" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_2bf9507d-a7de-4542-9bec-a7556e9cb242" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockValueOutstanding_3a328c7d-7f73-43b5-ae4c-8888c78a920d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PreferredStockValueOutstanding"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_c93948a4-89ec-445f-82bd-d6c7516ba568" xlink:to="loc_us-gaap_PreferredStockValueOutstanding_3a328c7d-7f73-43b5-ae4c-8888c78a920d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValueOutstanding_ae9da7cb-ae46-481e-b4eb-b950ac2e7b5c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CommonStockValueOutstanding"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_c93948a4-89ec-445f-82bd-d6c7516ba568" xlink:to="loc_us-gaap_CommonStockValueOutstanding_ae9da7cb-ae46-481e-b4eb-b950ac2e7b5c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_497f3e83-68a0-4442-923e-a9ac000feda2" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AssetsCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:to="loc_us-gaap_AssetsCurrent_497f3e83-68a0-4442-923e-a9ac000feda2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermInvestments_fb4b54cf-2509-4873-8a09-c6fcf9f146d0" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LongTermInvestments"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:to="loc_us-gaap_LongTermInvestments_fb4b54cf-2509-4873-8a09-c6fcf9f146d0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_674dbacd-efdb-4a14-83bc-daa90f2b14b6" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_674dbacd-efdb-4a14-83bc-daa90f2b14b6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_bbb68873-804d-4f27-a293-8d4932ec015c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_bbb68873-804d-4f27-a293-8d4932ec015c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_633cf655-25e3-4ca5-a9b0-b4ec8f6e5e79" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Goodwill"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:to="loc_us-gaap_Goodwill_633cf655-25e3-4ca5-a9b0-b4ec8f6e5e79" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_ad4abd2c-a33f-40d3-a069-4e08ff741759" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsNet_ad4abd2c-a33f-40d3-a069-4e08ff741759" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_a11a6e7c-81c9-4294-a6af-2e433714499c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DeferredIncomeTaxAssetsNet"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_a11a6e7c-81c9-4294-a6af-2e433714499c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent_0287147c-63aa-4c3b-8e33-d39be47bb1db" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c814c70f-c6f5-47b9-b375-675787c77c4f" xlink:to="loc_us-gaap_OtherAssetsNoncurrent_0287147c-63aa-4c3b-8e33-d39be47bb1db" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_9645aeff-6335-49ef-99d2-8ae04a4a7bcb" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent_2eafa233-87f4-476c-bf90-1358fe3dd017" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9645aeff-6335-49ef-99d2-8ae04a4a7bcb" xlink:to="loc_us-gaap_AccountsPayableCurrent_2eafa233-87f4-476c-bf90-1358fe3dd017" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent_50712068-4ba1-4c0f-a27a-0af7f4ac4eda" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9645aeff-6335-49ef-99d2-8ae04a4a7bcb" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrent_50712068-4ba1-4c0f-a27a-0af7f4ac4eda" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesCurrent_18f7a4c3-6b3c-4bb7-bcb1-fd64ff1f61e6" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccruedIncomeTaxesCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9645aeff-6335-49ef-99d2-8ae04a4a7bcb" xlink:to="loc_us-gaap_AccruedIncomeTaxesCurrent_18f7a4c3-6b3c-4bb7-bcb1-fd64ff1f61e6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ContractWithCustomerLiabilityCurrent_52cb1fbf-ed37-491a-af25-0233571d996f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ContractWithCustomerLiabilityCurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9645aeff-6335-49ef-99d2-8ae04a4a7bcb" xlink:to="loc_us-gaap_ContractWithCustomerLiabilityCurrent_52cb1fbf-ed37-491a-af25-0233571d996f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent_a120aee2-4b3e-4957-911c-10e693292f6a" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesCurrent_9645aeff-6335-49ef-99d2-8ae04a4a7bcb" xlink:to="loc_us-gaap_OperatingLeaseLiabilityCurrent_a120aee2-4b3e-4957-911c-10e693292f6a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent_93a7b1e9-f5a7-45ad-b796-1b1664059034" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AssetsCurrent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_ee24a1d8-a178-44f3-b0d7-18c16b8a2a36" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_93a7b1e9-f5a7-45ad-b796-1b1664059034" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_ee24a1d8-a178-44f3-b0d7-18c16b8a2a36" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_c16f1b42-a14e-44c2-8929-aaa32f302ca0" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_93a7b1e9-f5a7-45ad-b796-1b1664059034" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_c16f1b42-a14e-44c2-8929-aaa32f302ca0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsReceivableNetCurrent_bcce04b3-946b-4133-8ac2-41f959a491f5" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccountsReceivableNetCurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_93a7b1e9-f5a7-45ad-b796-1b1664059034" xlink:to="loc_us-gaap_AccountsReceivableNetCurrent_bcce04b3-946b-4133-8ac2-41f959a491f5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnbilledReceivablesCurrent_080042ed-1904-4da7-9b93-16af6da84138" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_UnbilledReceivablesCurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_93a7b1e9-f5a7-45ad-b796-1b1664059034" xlink:to="loc_us-gaap_UnbilledReceivablesCurrent_080042ed-1904-4da7-9b93-16af6da84138" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_899c57e3-7fe5-45ca-be71-6e6bdff96d54" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InventoryNet"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_93a7b1e9-f5a7-45ad-b796-1b1664059034" xlink:to="loc_us-gaap_InventoryNet_899c57e3-7fe5-45ca-be71-6e6bdff96d54" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_b9186d6c-6f09-4cdd-a190-e59fe7113ef3" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsCurrent_93a7b1e9-f5a7-45ad-b796-1b1664059034" xlink:to="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_b9186d6c-6f09-4cdd-a190-e59fe7113ef3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_435e006e-7e6f-4560-bba9-caa07a655a3b" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Liabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent_37381380-90ff-402a-9b2a-8f791be6608b" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_435e006e-7e6f-4560-bba9-caa07a655a3b" xlink:to="loc_us-gaap_LiabilitiesCurrent_37381380-90ff-402a-9b2a-8f791be6608b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_7b4d7183-9176-4e19-928b-49175d74677a" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_435e006e-7e6f-4560-bba9-caa07a655a3b" xlink:to="loc_us-gaap_OperatingLeaseLiabilityNoncurrent_7b4d7183-9176-4e19-928b-49175d74677a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_73915f0a-3868-4193-a9d1-2cb6cac2aae1" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_435e006e-7e6f-4560-bba9-caa07a655a3b" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_73915f0a-3868-4193-a9d1-2cb6cac2aae1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent_f958415e-bf64-48ee-890e-afa92bc20853" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LiabilityForUncertainTaxPositionsNoncurrent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_435e006e-7e6f-4560-bba9-caa07a655a3b" xlink:to="loc_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent_f958415e-bf64-48ee-890e-afa92bc20853" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxes_4940bc8e-4ee3-4f36-8f61-3c2296628e7d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccruedIncomeTaxes"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_435e006e-7e6f-4560-bba9-caa07a655a3b" xlink:to="loc_us-gaap_AccruedIncomeTaxes_4940bc8e-4ee3-4f36-8f61-3c2296628e7d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesNoncurrent_e75c2be7-149f-418e-b81e-2bc82c1994f6" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_OtherLiabilitiesNoncurrent"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_435e006e-7e6f-4560-bba9-caa07a655a3b" xlink:to="loc_us-gaap_OtherLiabilitiesNoncurrent_e75c2be7-149f-418e-b81e-2bc82c1994f6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_22f5166d-3dbb-4ba1-8028-8417225aea8b" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_c6fb2975-7a38-4ce1-8238-d18c49bdb5f6" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Liabilities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_22f5166d-3dbb-4ba1-8028-8417225aea8b" xlink:to="loc_us-gaap_Liabilities_c6fb2975-7a38-4ce1-8238-d18c49bdb5f6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_59170cde-4213-48e8-b5f1-a54daaefb533" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockholdersEquity"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_22f5166d-3dbb-4ba1-8028-8417225aea8b" xlink:to="loc_us-gaap_StockholdersEquity_59170cde-4213-48e8-b5f1-a54daaefb533" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedBalanceSheetsParenthetical" xlink:type="simple" xlink:href="cgnx-20210404.xsd#ConsolidatedBalanceSheetsParenthetical"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/ConsolidatedBalanceSheetsParenthetical" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedStatementsofCashFlows" xlink:type="simple" xlink:href="cgnx-20210404.xsd#ConsolidatedStatementsofCashFlows"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/ConsolidatedStatementsofCashFlows" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_d001af45-77de-4e3e-b203-a984a30a9934" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_edf857a7-4449-4d04-b3b2-ee86419847cc" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_d001af45-77de-4e3e-b203-a984a30a9934" xlink:to="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_edf857a7-4449-4d04-b3b2-ee86419847cc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDividendsCommonStock_a060369e-66b2-4467-91cf-7dfa7dd0b877" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PaymentsOfDividendsCommonStock"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_d001af45-77de-4e3e-b203-a984a30a9934" xlink:to="loc_us-gaap_PaymentsOfDividendsCommonStock_a060369e-66b2-4467-91cf-7dfa7dd0b877" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_7f2db601-f951-4bc8-8ac5-1d9ef7787eb6" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_d001af45-77de-4e3e-b203-a984a30a9934" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_7f2db601-f951-4bc8-8ac5-1d9ef7787eb6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_9eaffbdf-5ee4-4d87-8a0a-3d5e63ffd108" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_NetIncomeLoss_9eaffbdf-5ee4-4d87-8a0a-3d5e63ffd108" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet_28f2b5c5-98a7-4f0e-8b47-f385c792d72f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet_28f2b5c5-98a7-4f0e-8b47-f385c792d72f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Depreciation_0cbdcdd7-4480-405c-80ab-806b31aa01da" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Depreciation"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_Depreciation_0cbdcdd7-4480-405c-80ab-806b31aa01da" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredRevenue_bb36b6e6-134c-419f-ac13-6f8c885868d6" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInDeferredRevenue"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredRevenue_bb36b6e6-134c-419f-ac13-6f8c885868d6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_03dc60e8-a299-4c3d-a3d6-05a03d87f85d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_03dc60e8-a299-4c3d-a3d6-05a03d87f85d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfIntangibleAssets_077c2608-93b8-497e-85c0-0604aef003db" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AmortizationOfIntangibleAssets"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_AmortizationOfIntangibleAssets_077c2608-93b8-497e-85c0-0604aef003db" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfInvestments_e2464bcd-4c7f-4bcd-9628-a29e838c6000" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GainLossOnSaleOfInvestments"/>
    <link:calculationArc order="7" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_GainLossOnSaleOfInvestments_e2464bcd-4c7f-4bcd-9628-a29e838c6000" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInContractWithCustomerLiability_e41ef6bf-7989-432f-99ac-7ed7d922d692" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInContractWithCustomerLiability"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInContractWithCustomerLiability_e41ef6bf-7989-432f-99ac-7ed7d922d692" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MarketableSecuritiesRealizedGainLossExcludingOtherThanTemporaryImpairments_2bcc0baf-d2b6-4525-ba5e-90d7abf95a77" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_MarketableSecuritiesRealizedGainLossExcludingOtherThanTemporaryImpairments"/>
    <link:calculationArc order="9" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_MarketableSecuritiesRealizedGainLossExcludingOtherThanTemporaryImpairments_2bcc0baf-d2b6-4525-ba5e-90d7abf95a77" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayable_3a263ecf-a27d-40a3-9c02-37695811a49d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsPayable"/>
    <link:calculationArc order="10" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayable_3a263ecf-a27d-40a3-9c02-37695811a49d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities_31aaefc0-4015-4d6f-a05c-632365a9475a" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilities"/>
    <link:calculationArc order="11" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities_31aaefc0-4015-4d6f-a05c-632365a9475a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsReceivable_8bcde83a-4eff-49d4-bc2b-70bbdec7d596" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsReceivable"/>
    <link:calculationArc order="12" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsReceivable_8bcde83a-4eff-49d4-bc2b-70bbdec7d596" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedTaxesPayable_41fe0a9d-bc86-4562-b143-86254860942d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedTaxesPayable"/>
    <link:calculationArc order="13" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedTaxesPayable_41fe0a9d-bc86-4562-b143-86254860942d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_8aec368c-f57b-432f-954a-786e14824ac2" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="14" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_8aec368c-f57b-432f-954a-786e14824ac2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockOptionPlanExpense_218799c8-c9f4-458c-ac7c-ff5dc136ab85" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_StockOptionPlanExpense"/>
    <link:calculationArc order="15" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_StockOptionPlanExpense_218799c8-c9f4-458c-ac7c-ff5dc136ab85" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInInventories_791ad18c-2c0d-4436-9ce0-69f79a36776b" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInInventories"/>
    <link:calculationArc order="16" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInInventories_791ad18c-2c0d-4436-9ce0-69f79a36776b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ExcessAndObsoleteInventoryCharges_fb2549ab-72c3-46bd-ad0a-eaf95e093e50" xlink:href="cgnx-20210404.xsd#cgnx_ExcessAndObsoleteInventoryCharges"/>
    <link:calculationArc order="17" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_cgnx_ExcessAndObsoleteInventoryCharges_fb2549ab-72c3-46bd-ad0a-eaf95e093e50" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes_413a9439-dd66-4c2b-8e81-70257ef51dc3" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_IncreaseDecreaseInDeferredIncomeTaxes"/>
    <link:calculationArc order="18" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes_413a9439-dd66-4c2b-8e81-70257ef51dc3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnDispositionOfAssets1_dd419ba6-bb0b-4080-abff-9135c7f041a6" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_GainLossOnDispositionOfAssets1"/>
    <link:calculationArc order="19" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_7a9bce98-b308-418a-aff8-70baf8af710e" xlink:to="loc_us-gaap_GainLossOnDispositionOfAssets1_dd419ba6-bb0b-4080-abff-9135c7f041a6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_d7916e90-4b68-4210-bf13-2bdf932ab3e2" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_4c70100f-358c-4edb-9e23-882fd08260ca" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_d7916e90-4b68-4210-bf13-2bdf932ab3e2" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_4c70100f-358c-4edb-9e23-882fd08260ca" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_442f4f68-0f2d-4efc-acf4-683be9779e81" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_d7916e90-4b68-4210-bf13-2bdf932ab3e2" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_442f4f68-0f2d-4efc-acf4-683be9779e81" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_c6ce8ac3-9ecb-4811-b273-b41c842f8be3" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_d7916e90-4b68-4210-bf13-2bdf932ab3e2" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_c6ce8ac3-9ecb-4811-b273-b41c842f8be3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_83fc840d-4dc7-4663-ab4e-ee1e125b6221" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_d7916e90-4b68-4210-bf13-2bdf932ab3e2" xlink:to="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_83fc840d-4dc7-4663-ab4e-ee1e125b6221" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_030d68cf-08fb-4c4f-bfa3-c61d4b9d6980" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments_3734d2b7-b415-4f19-8ee6-b0cc5aefd5dd" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_030d68cf-08fb-4c4f-bfa3-c61d4b9d6980" xlink:to="loc_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments_3734d2b7-b415-4f19-8ee6-b0cc5aefd5dd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireInvestments_9624a0fd-bdde-405e-81fa-89ce8f9b88a8" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PaymentsToAcquireInvestments"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_030d68cf-08fb-4c4f-bfa3-c61d4b9d6980" xlink:to="loc_us-gaap_PaymentsToAcquireInvestments_9624a0fd-bdde-405e-81fa-89ce8f9b88a8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_a7f9a53d-4b86-43b1-b873-42048d22403a" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_030d68cf-08fb-4c4f-bfa3-c61d4b9d6980" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_a7f9a53d-4b86-43b1-b873-42048d22403a" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedStatementofShareholdersEquity" xlink:type="simple" xlink:href="cgnx-20210404.xsd#ConsolidatedStatementofShareholdersEquity"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/ConsolidatedStatementofShareholdersEquity" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedStatementofShareholdersEquityParenthetical" xlink:type="simple" xlink:href="cgnx-20210404.xsd#ConsolidatedStatementofShareholdersEquityParenthetical"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/ConsolidatedStatementofShareholdersEquityParenthetical" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/SummaryofSignificantAccountingPolicies" xlink:type="simple" xlink:href="cgnx-20210404.xsd#SummaryofSignificantAccountingPolicies"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/SummaryofSignificantAccountingPolicies" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/SummaryofSignificantAccountingPoliciesPolicies" xlink:type="simple" xlink:href="cgnx-20210404.xsd#SummaryofSignificantAccountingPoliciesPolicies"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/SummaryofSignificantAccountingPoliciesPolicies" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/NewPronouncements" xlink:type="simple" xlink:href="cgnx-20210404.xsd#NewPronouncements"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/NewPronouncements" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/FairValueMeasurements" xlink:type="simple" xlink:href="cgnx-20210404.xsd#FairValueMeasurements"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/FairValueMeasurements" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/FairValueMeasurementsTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#FairValueMeasurementsTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/FairValueMeasurementsTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/FairValueMeasurementsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#FairValueMeasurementsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/FairValueMeasurementsDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestments" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CashCashEquivalentsandInvestments"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestments" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CashCashEquivalentsandInvestmentsTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CashCashEquivalentsandInvestmentsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_c3e1bea1-89b3-4c48-bc7f-a2a8368bc96e" xlink:href="cgnx-20210404.xsd#cgnx_CashCashEquivalentsShortTermAndLongTermInvestments"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_76f9587f-3694-40c5-9c37-bd8b8f9a25e9" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_c3e1bea1-89b3-4c48-bc7f-a2a8368bc96e" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_76f9587f-3694-40c5-9c37-bd8b8f9a25e9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_746ae1a1-57e7-45fa-893f-12cf57ce804a" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_c3e1bea1-89b3-4c48-bc7f-a2a8368bc96e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_746ae1a1-57e7-45fa-893f-12cf57ce804a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermInvestments_4fc52140-2254-4232-917a-a43860162e1f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LongTermInvestments"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_c3e1bea1-89b3-4c48-bc7f-a2a8368bc96e" xlink:to="loc_us-gaap_LongTermInvestments_4fc52140-2254-4232-917a-a43860162e1f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_bdc33e7f-d9d8-40fc-95ab-25de2a820f38" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPaperAtCarryingValue_d35f34fc-6538-4568-9ef7-c7f741241f76" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_CommercialPaperAtCarryingValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_bdc33e7f-d9d8-40fc-95ab-25de2a820f38" xlink:to="loc_us-gaap_CommercialPaperAtCarryingValue_d35f34fc-6538-4568-9ef7-c7f741241f76" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MoneyMarketFundsAtCarryingValue_fad1e22e-9e63-4f25-8f5d-6ec347b57270" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_MoneyMarketFundsAtCarryingValue"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_bdc33e7f-d9d8-40fc-95ab-25de2a820f38" xlink:to="loc_us-gaap_MoneyMarketFundsAtCarryingValue_fad1e22e-9e63-4f25-8f5d-6ec347b57270" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Cash_6cbb8ef1-cb91-4f5e-9aeb-430dde1dff29" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_Cash"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_bdc33e7f-d9d8-40fc-95ab-25de2a820f38" xlink:to="loc_us-gaap_Cash_6cbb8ef1-cb91-4f5e-9aeb-430dde1dff29" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_2a9fd957-04fb-41dc-b8fd-c684a568597f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_38f0116e-16bb-46af-a167-ce101b5a6908" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_2a9fd957-04fb-41dc-b8fd-c684a568597f" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_38f0116e-16bb-46af-a167-ce101b5a6908" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_6d2b8af2-5c88-43f9-af99-d3e323cc1fc9" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_2a9fd957-04fb-41dc-b8fd-c684a568597f" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_6d2b8af2-5c88-43f9-af99-d3e323cc1fc9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_8247562e-fe57-408b-8fc3-f2952bf47d08" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_2a9fd957-04fb-41dc-b8fd-c684a568597f" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_8247562e-fe57-408b-8fc3-f2952bf47d08" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_4659aafa-3ea7-4f30-af25-f416c752853f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_f6a96a25-6907-4ed8-a151-ed2bad044d74" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_4659aafa-3ea7-4f30-af25-f416c752853f" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_f6a96a25-6907-4ed8-a151-ed2bad044d74" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_6c125b0f-ab45-4836-8c9a-8b776311ae58" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_4659aafa-3ea7-4f30-af25-f416c752853f" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_6c125b0f-ab45-4836-8c9a-8b776311ae58" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_d617dbce-0e97-4b1d-807b-f050721c64ee" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_0db8c25b-6874-4cb0-a831-04a5458abfbe" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_d617dbce-0e97-4b1d-807b-f050721c64ee" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_0db8c25b-6874-4cb0-a831-04a5458abfbe" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_b696f37a-73cb-45ea-84de-46474059038c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_d617dbce-0e97-4b1d-807b-f050721c64ee" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_b696f37a-73cb-45ea-84de-46474059038c" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsCashCashEquivalentsandInvestmentsScheduleofAllowanceforCreditLossActivityDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CashCashEquivalentsandInvestmentsCashCashEquivalentsandInvestmentsScheduleofAllowanceforCreditLossActivityDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsCashCashEquivalentsandInvestmentsScheduleofAllowanceforCreditLossActivityDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_3bd685c4-0b66-4b75-aa0b-7dbb46c415ac" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_87bcd413-72c8-4190-8bee-4a1f67ce8942" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_3bd685c4-0b66-4b75-aa0b-7dbb46c415ac" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_87bcd413-72c8-4190-8bee-4a1f67ce8942" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_6920bec5-9713-48d7-9487-8d22d367bf10" xlink:href="cgnx-20210404.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_3bd685c4-0b66-4b75-aa0b-7dbb46c415ac" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_6920bec5-9713-48d7-9487-8d22d367bf10" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_db787d9f-8016-4266-9c00-ba829b1670bc" xlink:href="cgnx-20210404.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_3bd685c4-0b66-4b75-aa0b-7dbb46c415ac" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_db787d9f-8016-4266-9c00-ba829b1670bc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_d31abd45-d941-419a-ad14-6875d7e62a99" xlink:href="cgnx-20210404.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_3bd685c4-0b66-4b75-aa0b-7dbb46c415ac" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_d31abd45-d941-419a-ad14-6875d7e62a99" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_c50b874f-ae20-44da-ba40-90f997755189" xlink:href="cgnx-20210404.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_3bd685c4-0b66-4b75-aa0b-7dbb46c415ac" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_c50b874f-ae20-44da-ba40-90f997755189" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/Inventories" xlink:type="simple" xlink:href="cgnx-20210404.xsd#Inventories"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/Inventories" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/InventoriesTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#InventoriesTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/InventoriesTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/InventoriesScheduleofInventoriesDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#InventoriesScheduleofInventoriesDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/InventoriesScheduleofInventoriesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet_ce49942c-f4e3-4414-aaa4-4ad4f23e0f72" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InventoryNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryRawMaterialsNetOfReserves_75761f73-7ee9-49b0-8be6-1c0849d9a87a" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InventoryRawMaterialsNetOfReserves"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_ce49942c-f4e3-4414-aaa4-4ad4f23e0f72" xlink:to="loc_us-gaap_InventoryRawMaterialsNetOfReserves_75761f73-7ee9-49b0-8be6-1c0849d9a87a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryWorkInProcessNetOfReserves_580e64f0-3cf5-415e-9d15-51f9b418c638" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InventoryWorkInProcessNetOfReserves"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_ce49942c-f4e3-4414-aaa4-4ad4f23e0f72" xlink:to="loc_us-gaap_InventoryWorkInProcessNetOfReserves_580e64f0-3cf5-415e-9d15-51f9b418c638" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryFinishedGoodsNetOfReserves_48fb1bba-65d7-4b65-8d4f-d5e19b30140c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_InventoryFinishedGoodsNetOfReserves"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InventoryNet_ce49942c-f4e3-4414-aaa4-4ad4f23e0f72" xlink:to="loc_us-gaap_InventoryFinishedGoodsNetOfReserves_48fb1bba-65d7-4b65-8d4f-d5e19b30140c" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/Leases" xlink:type="simple" xlink:href="cgnx-20210404.xsd#Leases"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/Leases" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/LeasesTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#LeasesTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/LeasesTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/LeasesNarrativeDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#LeasesNarrativeDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/LeasesNarrativeDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/LeasesFutureMinimumLeasePaymentObligationsUnderOperatingLeasesDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#LeasesFutureMinimumLeasePaymentObligationsUnderOperatingLeasesDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/LeasesFutureMinimumLeasePaymentObligationsUnderOperatingLeasesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_37a8ea83-7b82-4b24-b6f2-537697e0f5e1" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsRemainderOfFiscalYear_6c5520fc-dc13-4908-ac9d-8c0e414c7513" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsRemainderOfFiscalYear"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_37a8ea83-7b82-4b24-b6f2-537697e0f5e1" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsRemainderOfFiscalYear_6c5520fc-dc13-4908-ac9d-8c0e414c7513" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_be9d49f7-c9dd-4df8-9f16-83387919dfce" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_37a8ea83-7b82-4b24-b6f2-537697e0f5e1" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_be9d49f7-c9dd-4df8-9f16-83387919dfce" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_e29f2307-3af9-4b0c-9e8e-4dc35fc2b4a8" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_37a8ea83-7b82-4b24-b6f2-537697e0f5e1" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_e29f2307-3af9-4b0c-9e8e-4dc35fc2b4a8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_ec76677b-dc90-49ce-b50c-4750f6b2c84f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_37a8ea83-7b82-4b24-b6f2-537697e0f5e1" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_ec76677b-dc90-49ce-b50c-4750f6b2c84f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_7572bf40-b92f-4707-a944-39f733f0efcb" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_37a8ea83-7b82-4b24-b6f2-537697e0f5e1" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_7572bf40-b92f-4707-a944-39f733f0efcb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_f80776ff-0dd1-49a0-9217-448fe7590d0b" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_37a8ea83-7b82-4b24-b6f2-537697e0f5e1" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_f80776ff-0dd1-49a0-9217-448fe7590d0b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_5bfbecc1-3cf3-42dd-b2b0-73670a4f60d2" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_37a8ea83-7b82-4b24-b6f2-537697e0f5e1" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_5bfbecc1-3cf3-42dd-b2b0-73670a4f60d2" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/GoodwillNotes" xlink:type="simple" xlink:href="cgnx-20210404.xsd#GoodwillNotes"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/GoodwillNotes" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/GoodwillTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#GoodwillTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/GoodwillTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/GoodwillDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#GoodwillDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/GoodwillDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/IntangibleAssets" xlink:type="simple" xlink:href="cgnx-20210404.xsd#IntangibleAssets"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/IntangibleAssets" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/IntangibleAssetsTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#IntangibleAssetsTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/IntangibleAssetsTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/IntangibleAssetsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#IntangibleAssetsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/IntangibleAssetsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_3c6c5b9b-813e-46a5-91cc-4b79602399f2" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross_38416d03-bc1c-4aad-9338-4b3bd9842b50" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_3c6c5b9b-813e-46a5-91cc-4b79602399f2" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsGross_38416d03-bc1c-4aad-9338-4b3bd9842b50" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_b73b9d8b-8aa7-445d-94b5-d01cef202603" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_3c6c5b9b-813e-46a5-91cc-4b79602399f2" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_b73b9d8b-8aa7-445d-94b5-d01cef202603" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/IntangibleAssetsDetails_1" xlink:type="simple" xlink:href="cgnx-20210404.xsd#IntangibleAssetsDetails_1"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/IntangibleAssetsDetails_1" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_b12e0e26-7cb1-4ad1-bb0c-0a859bcc0c4b" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseRemainderOfFiscalYear_f42d0486-9177-4326-a443-fff8e41cf4a4" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseRemainderOfFiscalYear"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_b12e0e26-7cb1-4ad1-bb0c-0a859bcc0c4b" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseRemainderOfFiscalYear_f42d0486-9177-4326-a443-fff8e41cf4a4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_65328362-c6c6-49ef-ad69-209677a4058c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_b12e0e26-7cb1-4ad1-bb0c-0a859bcc0c4b" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_65328362-c6c6-49ef-ad69-209677a4058c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_866d17e4-fd4b-48ed-940a-05e535f4c75a" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_b12e0e26-7cb1-4ad1-bb0c-0a859bcc0c4b" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_866d17e4-fd4b-48ed-940a-05e535f4c75a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_72cd040b-2e45-4f8f-bcd0-083553b44778" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_b12e0e26-7cb1-4ad1-bb0c-0a859bcc0c4b" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_72cd040b-2e45-4f8f-bcd0-083553b44778" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_3cade863-8b42-49ca-8698-39e5a3909b2b" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_b12e0e26-7cb1-4ad1-bb0c-0a859bcc0c4b" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_3cade863-8b42-49ca-8698-39e5a3909b2b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_88d033f3-7121-4676-9a2c-7d920080925d" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_b12e0e26-7cb1-4ad1-bb0c-0a859bcc0c4b" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_88d033f3-7121-4676-9a2c-7d920080925d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive_8d10605f-958e-44be-a13d-83f1725d2814" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet_b12e0e26-7cb1-4ad1-bb0c-0a859bcc0c4b" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive_8d10605f-958e-44be-a13d-83f1725d2814" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/WarrantyObligations" xlink:type="simple" xlink:href="cgnx-20210404.xsd#WarrantyObligations"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/WarrantyObligations" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/WarrantyObligationsTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#WarrantyObligationsTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/WarrantyObligationsTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/WarrantyObligationsChangesinWarrantyObligationsDetail" xlink:type="simple" xlink:href="cgnx-20210404.xsd#WarrantyObligationsChangesinWarrantyObligationsDetail"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/WarrantyObligationsChangesinWarrantyObligationsDetail" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstruments" xlink:type="simple" xlink:href="cgnx-20210404.xsd#DerivativeInstruments"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/DerivativeInstruments" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#DerivativeInstrumentsTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#DerivativeInstrumentsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsOutstandingForwardContractsTableDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#DerivativeInstrumentsOutstandingForwardContractsTableDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsOutstandingForwardContractsTableDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsOffsettingAssetsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#DerivativeInstrumentsOffsettingAssetsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsOffsettingAssetsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_33598bbf-e29c-4853-b8c0-aabc8f341a5c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeLiabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeLiability_c5205bef-730e-4a86-a6a6-e33329430db7" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeFairValueOfDerivativeLiability"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DerivativeLiabilities_33598bbf-e29c-4853-b8c0-aabc8f341a5c" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeLiability_c5205bef-730e-4a86-a6a6-e33329430db7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset_304cc912-ef8f-48ac-9237-cd260db98666" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DerivativeLiabilities_33598bbf-e29c-4853-b8c0-aabc8f341a5c" xlink:to="loc_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset_304cc912-ef8f-48ac-9237-cd260db98666" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_3d408f92-ea58-4c53-8a3f-db723d0bd741" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeAssets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeAsset_9cfee607-d0e2-43f0-a9cf-058fe639be8f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeFairValueOfDerivativeAsset"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DerivativeAssets_3d408f92-ea58-4c53-8a3f-db723d0bd741" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeAsset_9cfee607-d0e2-43f0-a9cf-058fe639be8f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset_ef1b8dcf-d4f4-4e27-918c-3bcd1916c02c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DerivativeAssets_3d408f92-ea58-4c53-8a3f-db723d0bd741" xlink:to="loc_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset_ef1b8dcf-d4f4-4e27-918c-3bcd1916c02c" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsDerivativeInstrumentsGainLossDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#DerivativeInstrumentsDerivativeInstrumentsGainLossDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsDerivativeInstrumentsGainLossDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognition" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RevenueRecognition"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RevenueRecognition" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognitionTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RevenueRecognitionTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RevenueRecognitionTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyGeographyDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RevenueRecognitionRevenueDisaggregatedbyGeographyDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyGeographyDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognitionAdditionalInformationDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RevenueRecognitionAdditionalInformationDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RevenueRecognitionAdditionalInformationDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognitionScheduleofAllowanceforCreditLossDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RevenueRecognitionScheduleofAllowanceforCreditLossDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RevenueRecognitionScheduleofAllowanceforCreditLossDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognitionDeferredRevenueActivityDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RevenueRecognitionDeferredRevenueActivityDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RevenueRecognitionDeferredRevenueActivityDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpense" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockBasedCompensationExpense"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpense" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockBasedCompensationExpenseTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockBasedCompensationExpenseDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseSummaryofStockOptionActivityDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockBasedCompensationExpenseSummaryofStockOptionActivityDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseSummaryofStockOptionActivityDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseWeightedAverageAssumptionsUsedinEstimatingFairValuesofStockOptionsGrantedDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockBasedCompensationExpenseWeightedAverageAssumptionsUsedinEstimatingFairValuesofStockOptionsGrantedDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseWeightedAverageAssumptionsUsedinEstimatingFairValuesofStockOptionsGrantedDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockRepurchaseProgram" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockRepurchaseProgram"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockRepurchaseProgram" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/StockRepurchaseProgramDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#StockRepurchaseProgramDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/StockRepurchaseProgramDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/Taxes" xlink:type="simple" xlink:href="cgnx-20210404.xsd#Taxes"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/Taxes" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/IncomeTaxesTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#IncomeTaxesTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/IncomeTaxesTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/IncomeTaxesReconciliationofUnitedStatesFederalStatutoryCorporateTaxRatetoCompanysEffectiveTaxRateorIncomeTaxProvisionDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#IncomeTaxesReconciliationofUnitedStatesFederalStatutoryCorporateTaxRatetoCompanysEffectiveTaxRateorIncomeTaxProvisionDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/IncomeTaxesReconciliationofUnitedStatesFederalStatutoryCorporateTaxRatetoCompanysEffectiveTaxRateorIncomeTaxProvisionDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_ae478cba-78bd-43cc-a606-2f528c25b09c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_1da3b880-3394-4ad0-bf19-81042e435af2" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_ae478cba-78bd-43cc-a606-2f528c25b09c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_1da3b880-3394-4ad0-bf19-81042e435af2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits_0e2dfc1a-eb82-423f-8825-b75931681b0f" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_ae478cba-78bd-43cc-a606-2f528c25b09c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits_0e2dfc1a-eb82-423f-8825-b75931681b0f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential_8866ffae-ce28-4037-b2ff-0a95844e3491" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_ae478cba-78bd-43cc-a606-2f528c25b09c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential_8866ffae-ce28-4037-b2ff-0a95844e3491" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent_4a8fc0ab-ad73-4651-9f2b-85595d77ee56" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_ae478cba-78bd-43cc-a606-2f528c25b09c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent_4a8fc0ab-ad73-4651-9f2b-85595d77ee56" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_d37dbb8a-0c15-4e0e-afa3-2f2f52d48208" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_ae478cba-78bd-43cc-a606-2f528c25b09c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_d37dbb8a-0c15-4e0e-afa3-2f2f52d48208" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_495c4272-ecd5-43ed-bfb5-9eb99a343d91" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_ae478cba-78bd-43cc-a606-2f528c25b09c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_495c4272-ecd5-43ed-bfb5-9eb99a343d91" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent_7e14e2d5-ea85-42de-a4e5-3fb719fac81c" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent"/>
    <link:calculationArc order="7" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_ae478cba-78bd-43cc-a606-2f528c25b09c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent_7e14e2d5-ea85-42de-a4e5-3fb719fac81c" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/IncomeTaxesDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#IncomeTaxesDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/IncomeTaxesDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/WeightedAverageShares" xlink:type="simple" xlink:href="cgnx-20210404.xsd#WeightedAverageShares"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/WeightedAverageShares" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/WeightedAverageSharesTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#WeightedAverageSharesTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/WeightedAverageSharesTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/WeightedAverageSharesCalculationofWeightedAverageSharesDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#WeightedAverageSharesCalculationofWeightedAverageSharesDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/WeightedAverageSharesCalculationofWeightedAverageSharesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_c461dd2c-8e36-4004-abc7-6381d5307064" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_ddb34cf2-b2b0-434d-9b78-1ce2ccb8b283" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_c461dd2c-8e36-4004-abc7-6381d5307064" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_ddb34cf2-b2b0-434d-9b78-1ce2ccb8b283" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_3b73efb3-d892-4778-a93e-167315b90622" xlink:href="http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_c461dd2c-8e36-4004-abc7-6381d5307064" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_3b73efb3-d892-4778-a93e-167315b90622" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.cognex.com/role/WeightedAverageSharesDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#WeightedAverageSharesDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/WeightedAverageSharesDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RestructuringCharges" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RestructuringCharges"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RestructuringCharges" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RestructuringChargesTables" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RestructuringChargesTables"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RestructuringChargesTables" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RestructuringChargesNarrativeDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RestructuringChargesNarrativeDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RestructuringChargesNarrativeDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/RestructuringChargesActivityinRestructuringReserveDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#RestructuringChargesActivityinRestructuringReserveDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/RestructuringChargesActivityinRestructuringReserveDetails" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/SubsequentEvents" xlink:type="simple" xlink:href="cgnx-20210404.xsd#SubsequentEvents"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/SubsequentEvents" xlink:type="extended"/>
  <link:roleRef roleURI="http://www.cognex.com/role/SubsequentEventsDetails" xlink:type="simple" xlink:href="cgnx-20210404.xsd#SubsequentEventsDetails"/>
  <link:calculationLink xlink:role="http://www.cognex.com/role/SubsequentEventsDetails" xlink:type="extended"/>
</link:linkbase>
