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

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2022 Workiva-->
<!--r:9a42c90f-1f2c-4255-874b-46c5c1bc9b83,g:47439a38-1ffc-44c5-b2f0-e902fcc31613-->
<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" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/all" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member"/>
  <link:roleRef roleURI="http://www.cognex.com/role/ConsolidatedStatementofShareholdersEquity" xlink:type="simple" xlink:href="cgnx-20221002.xsd#ConsolidatedStatementofShareholdersEquity"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/ConsolidatedStatementofShareholdersEquity" xlink:type="extended" id="ia9298cb2f5324ccf84d32ee9a472a778_ConsolidatedStatementofShareholdersEquity">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_27ce875a-39c9-46e4-932b-dad489bd7915" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInStockholdersEquityRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_27ce875a-39c9-46e4-932b-dad489bd7915" xlink:to="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_5a19396c-c838-4b9c-a818-bda7501a9c38" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_StockholdersEquity_5a19396c-c838-4b9c-a818-bda7501a9c38" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesIssued_385591e0-57e0-4b96-b44c-2933e19d9f34" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_CommonStockSharesIssued_385591e0-57e0-4b96-b44c-2933e19d9f34" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_e72af9ce-6253-45a6-88c7-b923ed66f606" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_e72af9ce-6253-45a6-88c7-b923ed66f606" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod_acc6454d-be55-430a-82cc-b0cab8fc7b3b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod_acc6454d-be55-430a-82cc-b0cab8fc7b3b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue_859edc61-98bd-40b4-a0e2-0dc69f364eef" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodValue_859edc61-98bd-40b4-a0e2-0dc69f364eef" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodShares_e210ef79-658f-4c13-b258-f9c92a1dca34" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRepurchasedDuringPeriodShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodShares_e210ef79-658f-4c13-b258-f9c92a1dca34" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_0100315b-4562-4ac0-9548-0a97daa3df3c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_0100315b-4562-4ac0-9548-0a97daa3df3c" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCash_84ad27d0-079c-4fe9-bfba-33ba92769ca4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DividendsCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_DividendsCash_84ad27d0-079c-4fe9-bfba-33ba92769ca4" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_1cc752b3-830a-4671-b905-80733e4c3acf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_NetIncomeLoss_1cc752b3-830a-4671-b905-80733e4c3acf" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_d7359217-2183-4695-a9b3-22d13b68294e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_d7359217-2183-4695-a9b3-22d13b68294e" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_30c59c43-15f3-4321-8e00-b14d980b6a2f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_30c59c43-15f3-4321-8e00-b14d980b6a2f" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_722defdd-8aa3-4dad-bba8-58024e27b4fe" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_74b4c501-d44c-4bc7-87dc-1d9a8cf4a79c" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_722defdd-8aa3-4dad-bba8-58024e27b4fe" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_53901ad3-a76e-41d5-9dc9-4c43736f7b74" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesIssued_0b0cb90b-e6ae-4ecb-b478-ccc54c3c7ca7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockSharesIssued"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_fdac151d-f6ba-4a7b-b87b-2572cbb8fa8f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_27ce875a-39c9-46e4-932b-dad489bd7915" xlink:to="loc_us-gaap_StatementTable_fdac151d-f6ba-4a7b-b87b-2572cbb8fa8f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_8b391d01-ccf7-45ed-9f3d-c96554ce964b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_fdac151d-f6ba-4a7b-b87b-2572cbb8fa8f" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_8b391d01-ccf7-45ed-9f3d-c96554ce964b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_8b391d01-ccf7-45ed-9f3d-c96554ce964b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_8b391d01-ccf7-45ed-9f3d-c96554ce964b" xlink:to="loc_us-gaap_EquityComponentDomain_8b391d01-ccf7-45ed-9f3d-c96554ce964b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_1307b285-d6db-42b8-80b3-dcba93078131" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_8b391d01-ccf7-45ed-9f3d-c96554ce964b" xlink:to="loc_us-gaap_EquityComponentDomain_1307b285-d6db-42b8-80b3-dcba93078131" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_908ad7dd-555b-498f-ab71-348e279472a3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_1307b285-d6db-42b8-80b3-dcba93078131" xlink:to="loc_us-gaap_CommonStockMember_908ad7dd-555b-498f-ab71-348e279472a3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalMember_8b2e35c3-5aeb-4c7c-ba45-f0dc6d44467c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AdditionalPaidInCapitalMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_1307b285-d6db-42b8-80b3-dcba93078131" xlink:to="loc_us-gaap_AdditionalPaidInCapitalMember_8b2e35c3-5aeb-4c7c-ba45-f0dc6d44467c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsMember_d74b1f14-eb61-4a56-9645-42380fef09bf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RetainedEarningsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_1307b285-d6db-42b8-80b3-dcba93078131" xlink:to="loc_us-gaap_RetainedEarningsMember_d74b1f14-eb61-4a56-9645-42380fef09bf" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_ce0d9f5b-4ad6-4879-abea-3ad41c245360" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_1307b285-d6db-42b8-80b3-dcba93078131" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_ce0d9f5b-4ad6-4879-abea-3ad41c245360" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails" xlink:type="extended" id="if92a8f8f8dbb4ca6a95e06d8f1067514_FairValueMeasurementsAssetsandLiabilitiesMeasuredatFairValueonaRecurringBasisDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_05ee3a7c-e777-4bfd-8f56-b97845bc9ff6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsFairValueDisclosureAbstract_a353d766-f985-42bf-91f4-3281ebf25f69" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetsFairValueDisclosureAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_05ee3a7c-e777-4bfd-8f56-b97845bc9ff6" xlink:to="loc_us-gaap_AssetsFairValueDisclosureAbstract_a353d766-f985-42bf-91f4-3281ebf25f69" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MoneyMarketFundsAtCarryingValue_6268268b-52ad-4dc8-b14b-abdd7379336f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MoneyMarketFundsAtCarryingValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsFairValueDisclosureAbstract_a353d766-f985-42bf-91f4-3281ebf25f69" xlink:to="loc_us-gaap_MoneyMarketFundsAtCarryingValue_6268268b-52ad-4dc8-b14b-abdd7379336f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_0aeb2477-f0cb-4def-a2dd-d3e66822e5f5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsFairValueDisclosureAbstract_a353d766-f985-42bf-91f4-3281ebf25f69" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_0aeb2477-f0cb-4def-a2dd-d3e66822e5f5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure_12362972-e419-4868-8dce-e293389c9cfc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ForeignCurrencyContractAssetFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsFairValueDisclosureAbstract_a353d766-f985-42bf-91f4-3281ebf25f69" xlink:to="loc_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure_12362972-e419-4868-8dce-e293389c9cfc" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesFairValueDisclosureAbstract_edecee41-beaa-476d-8678-baa6998b2aae" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesFairValueDisclosureAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_05ee3a7c-e777-4bfd-8f56-b97845bc9ff6" xlink:to="loc_us-gaap_LiabilitiesFairValueDisclosureAbstract_edecee41-beaa-476d-8678-baa6998b2aae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_257f171f-a7a1-4da4-ad7d-732bbef5ba7b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesFairValueDisclosureAbstract_edecee41-beaa-476d-8678-baa6998b2aae" xlink:to="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_257f171f-a7a1-4da4-ad7d-732bbef5ba7b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_87f28bc5-4a7c-4781-ad70-8131bb3d4c27" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_05ee3a7c-e777-4bfd-8f56-b97845bc9ff6" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_87f28bc5-4a7c-4781-ad70-8131bb3d4c27" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_b4e094fe-9231-4234-8e90-6f219b09f738" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_87f28bc5-4a7c-4781-ad70-8131bb3d4c27" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_b4e094fe-9231-4234-8e90-6f219b09f738" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_b4e094fe-9231-4234-8e90-6f219b09f738_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_b4e094fe-9231-4234-8e90-6f219b09f738" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_b4e094fe-9231-4234-8e90-6f219b09f738_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_1c69cd41-6559-45f1-9e7c-51bbe0cf9aeb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_b4e094fe-9231-4234-8e90-6f219b09f738" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_1c69cd41-6559-45f1-9e7c-51bbe0cf9aeb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_72d50528-e20a-440a-836a-7ae0f20914f8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_1c69cd41-6559-45f1-9e7c-51bbe0cf9aeb" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_72d50528-e20a-440a-836a-7ae0f20914f8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_fac0fc62-9b0f-463d-90f8-85d0ad2110f4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_1c69cd41-6559-45f1-9e7c-51bbe0cf9aeb" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_fac0fc62-9b0f-463d-90f8-85d0ad2110f4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_e83ae1fc-c261-4be9-8fee-80ea118c0f5f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_1c69cd41-6559-45f1-9e7c-51bbe0cf9aeb" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_e83ae1fc-c261-4be9-8fee-80ea118c0f5f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis_f0ca01d4-2687-4ba0-a658-47aea817a18a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueByMeasurementFrequencyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_87f28bc5-4a7c-4781-ad70-8131bb3d4c27" xlink:to="loc_us-gaap_FairValueByMeasurementFrequencyAxis_f0ca01d4-2687-4ba0-a658-47aea817a18a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_f0ca01d4-2687-4ba0-a658-47aea817a18a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_f0ca01d4-2687-4ba0-a658-47aea817a18a" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_f0ca01d4-2687-4ba0-a658-47aea817a18a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_65a93d2b-4fb1-4b99-9e48-e1952f82250d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_f0ca01d4-2687-4ba0-a658-47aea817a18a" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_65a93d2b-4fb1-4b99-9e48-e1952f82250d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsRecurringMember_fe64ba25-481e-4f66-8bb8-2fc0a7c36814" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValueMeasurementsRecurringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementFrequencyDomain_65a93d2b-4fb1-4b99-9e48-e1952f82250d" xlink:to="loc_us-gaap_FairValueMeasurementsRecurringMember_fe64ba25-481e-4f66-8bb8-2fc0a7c36814" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_4ead5d5c-a056-4989-8ab5-00d16b2b947b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_87f28bc5-4a7c-4781-ad70-8131bb3d4c27" xlink:to="loc_us-gaap_FinancialInstrumentAxis_4ead5d5c-a056-4989-8ab5-00d16b2b947b" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4ead5d5c-a056-4989-8ab5-00d16b2b947b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_4ead5d5c-a056-4989-8ab5-00d16b2b947b" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4ead5d5c-a056-4989-8ab5-00d16b2b947b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_089a8573-7387-41d4-8788-f8bf95e109a7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_4ead5d5c-a056-4989-8ab5-00d16b2b947b" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_089a8573-7387-41d4-8788-f8bf95e109a7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_8ef57b2c-ec0e-48da-9508-e8be96d6e7fc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_089a8573-7387-41d4-8788-f8bf95e109a7" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_8ef57b2c-ec0e-48da-9508-e8be96d6e7fc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_829e18e1-5225-4155-8b0b-68f53b2b766a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_089a8573-7387-41d4-8788-f8bf95e109a7" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_829e18e1-5225-4155-8b0b-68f53b2b766a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_4c802387-a381-4347-96b9-c589a08989f0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_089a8573-7387-41d4-8788-f8bf95e109a7" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_4c802387-a381-4347-96b9-c589a08989f0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AgencyBondsMember_d2a210c9-2240-4a88-b753-2a1a0a6ed97a" xlink:href="cgnx-20221002.xsd#cgnx_AgencyBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_089a8573-7387-41d4-8788-f8bf95e109a7" xlink:to="loc_cgnx_AgencyBondsMember_d2a210c9-2240-4a88-b753-2a1a0a6ed97a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SovereignDebtSecuritiesMember_8d963ef5-3a02-4cc7-9c64-c37d913ca3f3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SovereignDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_089a8573-7387-41d4-8788-f8bf95e109a7" xlink:to="loc_us-gaap_SovereignDebtSecuritiesMember_8d963ef5-3a02-4cc7-9c64-c37d913ca3f3" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MunicipalBondsMember_b667e3a4-866e-4588-a192-9bdcb0ae244b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MunicipalBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_089a8573-7387-41d4-8788-f8bf95e109a7" xlink:to="loc_us-gaap_MunicipalBondsMember_b667e3a4-866e-4588-a192-9bdcb0ae244b" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#CashCashEquivalentsandInvestmentsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsDetails" xlink:type="extended" id="i16bf8474c96c4d5896e904dad2baff61_CashCashEquivalentsandInvestmentsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsLineItems_43af73f1-75b5-4609-baeb-48d1f5f68a0f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashAndCashEquivalentsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestReceivable_2e1e01eb-2532-48f6-b548-11840df33692" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InterestReceivable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_43af73f1-75b5-4609-baeb-48d1f5f68a0f" xlink:to="loc_us-gaap_InterestReceivable_2e1e01eb-2532-48f6-b548-11840df33692" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss_fb245381-d3bb-4cef-bd6e-ac6649994588" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_43af73f1-75b5-4609-baeb-48d1f5f68a0f" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss_fb245381-d3bb-4cef-bd6e-ac6649994588" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossPeriodIncreaseDecrease_5b9df96d-434d-44d0-8260-47645313fc2e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossPeriodIncreaseDecrease"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_43af73f1-75b5-4609-baeb-48d1f5f68a0f" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossPeriodIncreaseDecrease_5b9df96d-434d-44d0-8260-47645313fc2e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_595693bd-5eec-4541-af20-119420c0d79f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedGain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_43af73f1-75b5-4609-baeb-48d1f5f68a0f" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_595693bd-5eec-4541-af20-119420c0d79f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_c9ea6c73-6c21-4298-81be-5c527ecb8e6d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_43af73f1-75b5-4609-baeb-48d1f5f68a0f" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_c9ea6c73-6c21-4298-81be-5c527ecb8e6d" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesGrossUnrealizedLoss_86a298ff-fc35-4b8a-8f35-6ac9a4263da8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleDebtSecuritiesGrossUnrealizedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_43af73f1-75b5-4609-baeb-48d1f5f68a0f" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesGrossUnrealizedLoss_86a298ff-fc35-4b8a-8f35-6ac9a4263da8" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfCashAndCashEquivalentsTable_905eae80-648e-45e9-a2d8-da67a209ec56" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfCashAndCashEquivalentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_43af73f1-75b5-4609-baeb-48d1f5f68a0f" xlink:to="loc_us-gaap_ScheduleOfCashAndCashEquivalentsTable_905eae80-648e-45e9-a2d8-da67a209ec56" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_4c7cada5-ee4d-49fe-b2d3-2228da18cd07" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfCashAndCashEquivalentsTable_905eae80-648e-45e9-a2d8-da67a209ec56" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_4c7cada5-ee4d-49fe-b2d3-2228da18cd07" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_4c7cada5-ee4d-49fe-b2d3-2228da18cd07_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_4c7cada5-ee4d-49fe-b2d3-2228da18cd07" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_4c7cada5-ee4d-49fe-b2d3-2228da18cd07_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_ffe4a67c-ccda-4f09-9eb0-6e929044758b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_4c7cada5-ee4d-49fe-b2d3-2228da18cd07" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_ffe4a67c-ccda-4f09-9eb0-6e929044758b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherCurrentAssetsMember_da8378d4-b3b6-4e40-a46c-4d2a405bff3b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherCurrentAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_ffe4a67c-ccda-4f09-9eb0-6e929044758b" xlink:to="loc_us-gaap_OtherCurrentAssetsMember_da8378d4-b3b6-4e40-a46c-4d2a405bff3b" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails" xlink:type="extended" id="i2589683c9a7a4619b172b30045b06e1e_CashCashEquivalentsandInvestmentsComponentsofCashCashEquivalentsandInvestmentsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Cash_073141cf-ed72-4fc8-8384-837796abba24" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Cash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:to="loc_us-gaap_Cash_073141cf-ed72-4fc8-8384-837796abba24" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MoneyMarketFundsAtCarryingValue_657974a3-2381-4936-a30b-01b8850a8476" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MoneyMarketFundsAtCarryingValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:to="loc_us-gaap_MoneyMarketFundsAtCarryingValue_657974a3-2381-4936-a30b-01b8850a8476" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_aff8be87-cff7-4e54-b93a-266fde02ace9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_aff8be87-cff7-4e54-b93a-266fde02ace9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_e16daa3a-a69e-49b5-bb4e-30640935f960" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_e16daa3a-a69e-49b5-bb4e-30640935f960" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent_05809f75-d25b-4928-910a-a0a89b780749" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent_05809f75-d25b-4928-910a-a0a89b780749" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermInvestments_30922781-34a6-4c38-b06e-67a83fa8559c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LongTermInvestments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:to="loc_us-gaap_LongTermInvestments_30922781-34a6-4c38-b06e-67a83fa8559c" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_060f0da0-d457-4ab0-a777-410cdce26999" xlink:href="cgnx-20221002.xsd#cgnx_CashCashEquivalentsShortTermAndLongTermInvestments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:to="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_060f0da0-d457-4ab0-a777-410cdce26999" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_90bada09-55c7-4037-b3ab-24ba5e4dffc1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_39220f18-1326-4f30-9d3b-aeb619ff75f0" xlink:to="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_90bada09-55c7-4037-b3ab-24ba5e4dffc1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_7f6eeb3f-6767-4a0b-8968-ebd6e455e512" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_90bada09-55c7-4037-b3ab-24ba5e4dffc1" xlink:to="loc_us-gaap_FinancialInstrumentAxis_7f6eeb3f-6767-4a0b-8968-ebd6e455e512" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_7f6eeb3f-6767-4a0b-8968-ebd6e455e512_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_7f6eeb3f-6767-4a0b-8968-ebd6e455e512" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_7f6eeb3f-6767-4a0b-8968-ebd6e455e512_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_af1af2f7-299a-40ad-8432-3652a18b9cc1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_7f6eeb3f-6767-4a0b-8968-ebd6e455e512" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_af1af2f7-299a-40ad-8432-3652a18b9cc1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_d214f255-9e3d-49c4-b4c6-5b0f8331ea08" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_af1af2f7-299a-40ad-8432-3652a18b9cc1" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_d214f255-9e3d-49c4-b4c6-5b0f8331ea08" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_0210d353-28df-45a5-86c9-fbc528b13f3a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_af1af2f7-299a-40ad-8432-3652a18b9cc1" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_0210d353-28df-45a5-86c9-fbc528b13f3a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_6cbedc54-31e1-4b64-962c-60cf660f952a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_af1af2f7-299a-40ad-8432-3652a18b9cc1" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_6cbedc54-31e1-4b64-962c-60cf660f952a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AgencyBondsMember_674a1453-d2f3-49f7-b26c-bcc65913ecfb" xlink:href="cgnx-20221002.xsd#cgnx_AgencyBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_af1af2f7-299a-40ad-8432-3652a18b9cc1" xlink:to="loc_cgnx_AgencyBondsMember_674a1453-d2f3-49f7-b26c-bcc65913ecfb" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MunicipalBondsMember_95f645c2-d870-4622-b604-cb21a3a58c4b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MunicipalBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_af1af2f7-299a-40ad-8432-3652a18b9cc1" xlink:to="loc_us-gaap_MunicipalBondsMember_95f645c2-d870-4622-b604-cb21a3a58c4b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SovereignDebtMember_8a63dc2e-18fe-4e2d-a128-d8cad2c02eb8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SovereignDebtMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_af1af2f7-299a-40ad-8432-3652a18b9cc1" xlink:to="loc_us-gaap_SovereignDebtMember_8a63dc2e-18fe-4e2d-a128-d8cad2c02eb8" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails" xlink:type="extended" id="i3bbe276b5a114437861c346b1d619237_CashCashEquivalentsandInvestmentsSummaryofAvailableforSaleInvestmentsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_1ad3f6bb-06d0-4bd1-8099-680b898ba10c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_256951e5-0017-436c-84ea-7b6f97d33ec5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_1ad3f6bb-06d0-4bd1-8099-680b898ba10c" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_256951e5-0017-436c-84ea-7b6f97d33ec5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_2929b730-a83d-4a88-a7de-7e31f7421eaa" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_1ad3f6bb-06d0-4bd1-8099-680b898ba10c" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_2929b730-a83d-4a88-a7de-7e31f7421eaa" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_f3812c43-a987-43d5-aca1-af6a2c04cf6e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_1ad3f6bb-06d0-4bd1-8099-680b898ba10c" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_f3812c43-a987-43d5-aca1-af6a2c04cf6e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_daa95b6d-c56c-4943-9fe0-b5ec34259f1e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_1ad3f6bb-06d0-4bd1-8099-680b898ba10c" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_daa95b6d-c56c-4943-9fe0-b5ec34259f1e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_f81eca9c-9986-4bcb-a188-5507bbaf5d84" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_1ad3f6bb-06d0-4bd1-8099-680b898ba10c" xlink:to="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_f81eca9c-9986-4bcb-a188-5507bbaf5d84" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_f9367d66-3e97-4a8f-93b7-b33f4143ed23" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_f81eca9c-9986-4bcb-a188-5507bbaf5d84" xlink:to="loc_us-gaap_FinancialInstrumentAxis_f9367d66-3e97-4a8f-93b7-b33f4143ed23" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f9367d66-3e97-4a8f-93b7-b33f4143ed23_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_f9367d66-3e97-4a8f-93b7-b33f4143ed23" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f9367d66-3e97-4a8f-93b7-b33f4143ed23_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_03d2527c-b76d-4b5e-9119-8c57ab3efc33" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_f9367d66-3e97-4a8f-93b7-b33f4143ed23" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_03d2527c-b76d-4b5e-9119-8c57ab3efc33" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_e731dc5a-6e88-473f-b9d5-d7442fabddf0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_03d2527c-b76d-4b5e-9119-8c57ab3efc33" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_e731dc5a-6e88-473f-b9d5-d7442fabddf0" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_b53b6f6e-7fbc-4618-8a38-699319743ee1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_03d2527c-b76d-4b5e-9119-8c57ab3efc33" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_b53b6f6e-7fbc-4618-8a38-699319743ee1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_9c96b95d-4ee3-47e7-a55f-a3800d27cdc5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_03d2527c-b76d-4b5e-9119-8c57ab3efc33" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_9c96b95d-4ee3-47e7-a55f-a3800d27cdc5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AgencyBondsMember_227f546a-b1da-413c-8f82-c6fc43f9fa17" xlink:href="cgnx-20221002.xsd#cgnx_AgencyBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_03d2527c-b76d-4b5e-9119-8c57ab3efc33" xlink:to="loc_cgnx_AgencyBondsMember_227f546a-b1da-413c-8f82-c6fc43f9fa17" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SovereignDebtSecuritiesMember_e1697a97-2bda-4675-833d-84b0582456c1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SovereignDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_03d2527c-b76d-4b5e-9119-8c57ab3efc33" xlink:to="loc_us-gaap_SovereignDebtSecuritiesMember_e1697a97-2bda-4675-833d-84b0582456c1" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MunicipalBondsMember_e0906d1d-a717-4153-b810-32c90475aae7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MunicipalBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_03d2527c-b76d-4b5e-9119-8c57ab3efc33" xlink:to="loc_us-gaap_MunicipalBondsMember_e0906d1d-a717-4153-b810-32c90475aae7" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_40146b0b-af5d-45c4-b2e7-3d2bd7f7dab6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_f81eca9c-9986-4bcb-a188-5507bbaf5d84" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_40146b0b-af5d-45c4-b2e7-3d2bd7f7dab6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_40146b0b-af5d-45c4-b2e7-3d2bd7f7dab6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_40146b0b-af5d-45c4-b2e7-3d2bd7f7dab6" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_40146b0b-af5d-45c4-b2e7-3d2bd7f7dab6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_66284e11-de06-49a2-ab71-8d0c899ae1a4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_40146b0b-af5d-45c4-b2e7-3d2bd7f7dab6" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_66284e11-de06-49a2-ab71-8d0c899ae1a4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CurrentAssetsMember_8d66cc21-1ae7-4656-accd-12043c677ecf" xlink:href="cgnx-20221002.xsd#cgnx_CurrentAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_66284e11-de06-49a2-ab71-8d0c899ae1a4" xlink:to="loc_cgnx_CurrentAssetsMember_8d66cc21-1ae7-4656-accd-12043c677ecf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_NonCurrentAssetsMember_01accf77-21bb-4874-a66a-223dc46d7da1" xlink:href="cgnx-20221002.xsd#cgnx_NonCurrentAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_66284e11-de06-49a2-ab71-8d0c899ae1a4" xlink:to="loc_cgnx_NonCurrentAssetsMember_01accf77-21bb-4874-a66a-223dc46d7da1" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails" xlink:type="extended" id="i37efc06171024a76b85af7d80d71ab3f_CashCashEquivalentsandInvestmentsGrossUnrealizedLossesandFairValuesforAvailableforSaleInvestmentsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_dd67ca7a-92b2-4ad8-81b7-82004cfff4ab" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_a8609914-65e7-4332-a795-3239481c5dfc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_dd67ca7a-92b2-4ad8-81b7-82004cfff4ab" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_a8609914-65e7-4332-a795-3239481c5dfc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_18b95702-eb46-41c4-8fd3-9af8bb8b8bbb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_dd67ca7a-92b2-4ad8-81b7-82004cfff4ab" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_18b95702-eb46-41c4-8fd3-9af8bb8b8bbb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_32d634fd-5fca-490a-a619-9c346443c689" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_dd67ca7a-92b2-4ad8-81b7-82004cfff4ab" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_32d634fd-5fca-490a-a619-9c346443c689" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_bfae83c1-73a9-4121-b70a-ab51b366f89b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_dd67ca7a-92b2-4ad8-81b7-82004cfff4ab" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_bfae83c1-73a9-4121-b70a-ab51b366f89b" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_9b49896d-f83e-498c-b334-a4b33513b73c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_dd67ca7a-92b2-4ad8-81b7-82004cfff4ab" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_9b49896d-f83e-498c-b334-a4b33513b73c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_858aaf67-0d0c-4568-82bd-1501167e0a62" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_dd67ca7a-92b2-4ad8-81b7-82004cfff4ab" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_858aaf67-0d0c-4568-82bd-1501167e0a62" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_573a3c35-a130-4321-83f3-dd01b8c179d5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_dd67ca7a-92b2-4ad8-81b7-82004cfff4ab" xlink:to="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_573a3c35-a130-4321-83f3-dd01b8c179d5" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_be4d8ec4-c448-4835-afaa-191354430a34" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_573a3c35-a130-4321-83f3-dd01b8c179d5" xlink:to="loc_us-gaap_FinancialInstrumentAxis_be4d8ec4-c448-4835-afaa-191354430a34" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_be4d8ec4-c448-4835-afaa-191354430a34_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_be4d8ec4-c448-4835-afaa-191354430a34" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_be4d8ec4-c448-4835-afaa-191354430a34_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_e2d6430a-b0e7-49c9-b730-4864166eb511" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_be4d8ec4-c448-4835-afaa-191354430a34" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_e2d6430a-b0e7-49c9-b730-4864166eb511" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_42e95e95-8a56-44bf-a02d-e214f1b54747" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_e2d6430a-b0e7-49c9-b730-4864166eb511" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_42e95e95-8a56-44bf-a02d-e214f1b54747" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_744a082d-3676-4966-8ecd-38393f95e891" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_e2d6430a-b0e7-49c9-b730-4864166eb511" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_744a082d-3676-4966-8ecd-38393f95e891" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_f4a0be29-c2d2-4a27-8222-41954b918d7d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_e2d6430a-b0e7-49c9-b730-4864166eb511" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_f4a0be29-c2d2-4a27-8222-41954b918d7d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AgencyBondsMember_ac44842b-cb80-4cd1-8fba-d50fc1119bb8" xlink:href="cgnx-20221002.xsd#cgnx_AgencyBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_e2d6430a-b0e7-49c9-b730-4864166eb511" xlink:to="loc_cgnx_AgencyBondsMember_ac44842b-cb80-4cd1-8fba-d50fc1119bb8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SovereignDebtSecuritiesMember_a0ca81af-69b1-475a-82bd-f58c23ba9b10" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SovereignDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_e2d6430a-b0e7-49c9-b730-4864166eb511" xlink:to="loc_us-gaap_SovereignDebtSecuritiesMember_a0ca81af-69b1-475a-82bd-f58c23ba9b10" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MunicipalBondsMember_51726bde-ef80-432a-bc79-28dd86356d6b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MunicipalBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_e2d6430a-b0e7-49c9-b730-4864166eb511" xlink:to="loc_us-gaap_MunicipalBondsMember_51726bde-ef80-432a-bc79-28dd86356d6b" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails" xlink:type="extended" id="if2719e500d034bfda8f10b694a2557d3_CashCashEquivalentsandInvestmentsEffectiveMaturityDatesofAvailableforSaleInvestmentsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_7e3e06a1-b275-42c6-ba46-7a8c82ece36d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_bc1e17f7-4b3b-4967-b7ef-de59f17bfbda" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_7e3e06a1-b275-42c6-ba46-7a8c82ece36d" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_bc1e17f7-4b3b-4967-b7ef-de59f17bfbda" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_03a0acc8-63f9-4343-9bb4-6c9a2e442493" xlink:href="cgnx-20221002.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_7e3e06a1-b275-42c6-ba46-7a8c82ece36d" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_03a0acc8-63f9-4343-9bb4-6c9a2e442493" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_314fee05-4ead-4acf-9ddf-06ae3fec58e0" xlink:href="cgnx-20221002.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_7e3e06a1-b275-42c6-ba46-7a8c82ece36d" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_314fee05-4ead-4acf-9ddf-06ae3fec58e0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_4e9ec8f2-8447-46a2-80ea-29f2e1023a91" xlink:href="cgnx-20221002.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_7e3e06a1-b275-42c6-ba46-7a8c82ece36d" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_4e9ec8f2-8447-46a2-80ea-29f2e1023a91" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_c5645119-0927-4e89-acfb-26258b17af2c" xlink:href="cgnx-20221002.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_7e3e06a1-b275-42c6-ba46-7a8c82ece36d" xlink:to="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_c5645119-0927-4e89-acfb-26258b17af2c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d13a1002-db83-456e-97ce-4cb69e72b52e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_7e3e06a1-b275-42c6-ba46-7a8c82ece36d" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d13a1002-db83-456e-97ce-4cb69e72b52e" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_6aac91aa-c1cb-4e9c-8646-8092badc0144" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_7e3e06a1-b275-42c6-ba46-7a8c82ece36d" xlink:to="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_6aac91aa-c1cb-4e9c-8646-8092badc0144" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_84731d5e-d8d2-4551-b477-fa1674edcabd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_6aac91aa-c1cb-4e9c-8646-8092badc0144" xlink:to="loc_us-gaap_FinancialInstrumentAxis_84731d5e-d8d2-4551-b477-fa1674edcabd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_84731d5e-d8d2-4551-b477-fa1674edcabd_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_84731d5e-d8d2-4551-b477-fa1674edcabd" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_84731d5e-d8d2-4551-b477-fa1674edcabd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f15ef4cc-6981-48d1-bc8e-aa51cd1ae70c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_84731d5e-d8d2-4551-b477-fa1674edcabd" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f15ef4cc-6981-48d1-bc8e-aa51cd1ae70c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_b54f4e32-a5c5-4060-ae14-44529646bec8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f15ef4cc-6981-48d1-bc8e-aa51cd1ae70c" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_b54f4e32-a5c5-4060-ae14-44529646bec8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_c167de74-c9a0-43ff-b414-f853671db3c8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f15ef4cc-6981-48d1-bc8e-aa51cd1ae70c" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_c167de74-c9a0-43ff-b414-f853671db3c8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_088fb902-a722-4c12-a90d-ef275e1707fe" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f15ef4cc-6981-48d1-bc8e-aa51cd1ae70c" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_088fb902-a722-4c12-a90d-ef275e1707fe" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AgencyBondsMember_7e930fff-0fcd-47f3-9de2-33f4f4dcc0ef" xlink:href="cgnx-20221002.xsd#cgnx_AgencyBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f15ef4cc-6981-48d1-bc8e-aa51cd1ae70c" xlink:to="loc_cgnx_AgencyBondsMember_7e930fff-0fcd-47f3-9de2-33f4f4dcc0ef" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SovereignDebtSecuritiesMember_85b168aa-33fa-46ab-8269-7598a20a5ac2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SovereignDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f15ef4cc-6981-48d1-bc8e-aa51cd1ae70c" xlink:to="loc_us-gaap_SovereignDebtSecuritiesMember_85b168aa-33fa-46ab-8269-7598a20a5ac2" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MunicipalBondsMember_ef9d893e-12fa-4d24-9c05-3419f510c45d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MunicipalBondsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f15ef4cc-6981-48d1-bc8e-aa51cd1ae70c" xlink:to="loc_us-gaap_MunicipalBondsMember_ef9d893e-12fa-4d24-9c05-3419f510c45d" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/LeasesNarrativeDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#LeasesNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/LeasesNarrativeDetails" xlink:type="extended" id="i21cad6c588c447de95f757eb1ec6143c_LeasesNarrativeDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionLineItems_d402a563-cbc8-41e1-bfe0-39796a0b0273" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeLeaseDescriptionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetRentableArea_6956c836-42e3-4650-a9df-9e00040eeb81" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetRentableArea"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_d402a563-cbc8-41e1-bfe0-39796a0b0273" xlink:to="loc_us-gaap_NetRentableArea_6956c836-42e3-4650-a9df-9e00040eeb81" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseTermOfContract_f4c98cd4-84ae-4a09-a0e8-66590f316e5b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseTermOfContract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_d402a563-cbc8-41e1-bfe0-39796a0b0273" xlink:to="loc_us-gaap_LesseeOperatingLeaseTermOfContract_f4c98cd4-84ae-4a09-a0e8-66590f316e5b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_LesseeOperatingLeaseOptionToRenewTermOfContract_8a2e3ce9-a348-418f-a411-00f8da8ab356" xlink:href="cgnx-20221002.xsd#cgnx_LesseeOperatingLeaseOptionToRenewTermOfContract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_d402a563-cbc8-41e1-bfe0-39796a0b0273" xlink:to="loc_cgnx_LesseeOperatingLeaseOptionToRenewTermOfContract_8a2e3ce9-a348-418f-a411-00f8da8ab356" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_db26d61e-8575-42a8-98cd-22d3625d2176" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_d402a563-cbc8-41e1-bfe0-39796a0b0273" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_db26d61e-8575-42a8-98cd-22d3625d2176" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiability_572e87d6-0414-4eb8-ba92-48088756671e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_d402a563-cbc8-41e1-bfe0-39796a0b0273" xlink:to="loc_us-gaap_OperatingLeaseLiability_572e87d6-0414-4eb8-ba92-48088756671e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionTable_866bdf5f-ad51-4814-9b53-1e621879e0b7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeLeaseDescriptionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_d402a563-cbc8-41e1-bfe0-39796a0b0273" xlink:to="loc_us-gaap_LesseeLeaseDescriptionTable_866bdf5f-ad51-4814-9b53-1e621879e0b7" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis_4c8c94bd-3ab6-4752-b4eb-b16cbf0ae715" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_StatementGeographicalAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LesseeLeaseDescriptionTable_866bdf5f-ad51-4814-9b53-1e621879e0b7" xlink:to="loc_srt_StatementGeographicalAxis_4c8c94bd-3ab6-4752-b4eb-b16cbf0ae715" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_4c8c94bd-3ab6-4752-b4eb-b16cbf0ae715_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_4c8c94bd-3ab6-4752-b4eb-b16cbf0ae715" xlink:to="loc_srt_SegmentGeographicalDomain_4c8c94bd-3ab6-4752-b4eb-b16cbf0ae715_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_c556b9f3-f868-48e7-b450-ad9f41279616" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_4c8c94bd-3ab6-4752-b4eb-b16cbf0ae715" xlink:to="loc_srt_SegmentGeographicalDomain_c556b9f3-f868-48e7-b450-ad9f41279616" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_SouthboroughMassachusettsMember_1c007fe2-74ab-4a89-8d9a-974ff3db77cc" xlink:href="cgnx-20221002.xsd#cgnx_SouthboroughMassachusettsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_c556b9f3-f868-48e7-b450-ad9f41279616" xlink:to="loc_cgnx_SouthboroughMassachusettsMember_1c007fe2-74ab-4a89-8d9a-974ff3db77cc" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/IntangibleAssetsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#IntangibleAssetsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/IntangibleAssetsDetails" xlink:type="extended" id="i35c8b591e5944c0da41771ff37a1dc95_IntangibleAssetsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_e6f52259-bec9-4b39-b6bc-649303b0e2c9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross_aa9ad14d-2971-4298-b935-cc4c0ed4e359" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_e6f52259-bec9-4b39-b6bc-649303b0e2c9" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsGross_aa9ad14d-2971-4298-b935-cc4c0ed4e359" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_15dd6374-9a42-413f-9107-7cab31e968c2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_e6f52259-bec9-4b39-b6bc-649303b0e2c9" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_15dd6374-9a42-413f-9107-7cab31e968c2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_9f2a5478-087e-4e40-97a1-e3b88e45b0a7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_e6f52259-bec9-4b39-b6bc-649303b0e2c9" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsNet_9f2a5478-087e-4e40-97a1-e3b88e45b0a7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract_19c12461-bea4-41b4-b5c1-e515ef6e6c4f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_e6f52259-bec9-4b39-b6bc-649303b0e2c9" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract_19c12461-bea4-41b4-b5c1-e515ef6e6c4f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseRemainderOfFiscalYear_9baa075a-4a24-4e92-8a1f-15077d14ea30" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseRemainderOfFiscalYear"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract_19c12461-bea4-41b4-b5c1-e515ef6e6c4f" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseRemainderOfFiscalYear_9baa075a-4a24-4e92-8a1f-15077d14ea30" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_8a2f838f-873d-491a-ba0a-9b4af99c6855" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract_19c12461-bea4-41b4-b5c1-e515ef6e6c4f" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_8a2f838f-873d-491a-ba0a-9b4af99c6855" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_8f86879b-9634-4d22-a1ba-f1a7f627a4d7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract_19c12461-bea4-41b4-b5c1-e515ef6e6c4f" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_8f86879b-9634-4d22-a1ba-f1a7f627a4d7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_d969bc53-a2b2-464f-ab04-ba3d10c21f69" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract_19c12461-bea4-41b4-b5c1-e515ef6e6c4f" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_d969bc53-a2b2-464f-ab04-ba3d10c21f69" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_98c94a78-4543-4c52-b8d5-dc5fb01a6ee6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract_19c12461-bea4-41b4-b5c1-e515ef6e6c4f" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_98c94a78-4543-4c52-b8d5-dc5fb01a6ee6" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_bb73673c-986e-4379-b8be-2bdb70d12809" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsFutureAmortizationExpenseAbstract_19c12461-bea4-41b4-b5c1-e515ef6e6c4f" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_bb73673c-986e-4379-b8be-2bdb70d12809" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_6ba663e9-9301-48bd-843b-ea3ed447337d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_5bcfb373-c78d-4019-9bc0-2789f74f09d2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_e6f52259-bec9-4b39-b6bc-649303b0e2c9" xlink:to="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_5bcfb373-c78d-4019-9bc0-2789f74f09d2" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_7f1e0894-94e5-40b7-9f2e-e5a1aaa9fb99" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_5bcfb373-c78d-4019-9bc0-2789f74f09d2" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_7f1e0894-94e5-40b7-9f2e-e5a1aaa9fb99" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_7f1e0894-94e5-40b7-9f2e-e5a1aaa9fb99_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_7f1e0894-94e5-40b7-9f2e-e5a1aaa9fb99" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_7f1e0894-94e5-40b7-9f2e-e5a1aaa9fb99_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_4e8038ce-389a-4bab-a620-3ffe89ab48a2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_7f1e0894-94e5-40b7-9f2e-e5a1aaa9fb99" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_4e8038ce-389a-4bab-a620-3ffe89ab48a2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DistributionRightsMember_f30d075c-604f-463a-bf56-6ddb186404b3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DistributionRightsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_4e8038ce-389a-4bab-a620-3ffe89ab48a2" xlink:to="loc_us-gaap_DistributionRightsMember_f30d075c-604f-463a-bf56-6ddb186404b3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DevelopedTechnologyRightsMember_8367e812-397d-4f33-ae91-cd465b095ca4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DevelopedTechnologyRightsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_4e8038ce-389a-4bab-a620-3ffe89ab48a2" xlink:to="loc_us-gaap_DevelopedTechnologyRightsMember_8367e812-397d-4f33-ae91-cd465b095ca4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CustomerContractsAndRelationshipsMember_b0edd550-4f45-4ad1-8b54-faa23b79fcce" xlink:href="cgnx-20221002.xsd#cgnx_CustomerContractsAndRelationshipsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_4e8038ce-389a-4bab-a620-3ffe89ab48a2" xlink:to="loc_cgnx_CustomerContractsAndRelationshipsMember_b0edd550-4f45-4ad1-8b54-faa23b79fcce" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherIntangibleAssetsMember_b75545b6-d0d2-482a-9ffc-ea15efdc8d54" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherIntangibleAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_4e8038ce-389a-4bab-a620-3ffe89ab48a2" xlink:to="loc_us-gaap_OtherIntangibleAssetsMember_b75545b6-d0d2-482a-9ffc-ea15efdc8d54" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember_a7b86270-6546-445b-8a96-f6f47eb2f6c2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_4e8038ce-389a-4bab-a620-3ffe89ab48a2" xlink:to="loc_us-gaap_TrademarksMember_a7b86270-6546-445b-8a96-f6f47eb2f6c2" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DistributionRightsDevelopedTechnologyRightsCustomerContractsAndRelationshipsOtherIntangibleAssetsAndTrademarksMember_3c9caa27-ed27-4c72-80f3-d9d8bbe3b4d2" xlink:href="cgnx-20221002.xsd#cgnx_DistributionRightsDevelopedTechnologyRightsCustomerContractsAndRelationshipsOtherIntangibleAssetsAndTrademarksMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_4e8038ce-389a-4bab-a620-3ffe89ab48a2" xlink:to="loc_cgnx_DistributionRightsDevelopedTechnologyRightsCustomerContractsAndRelationshipsOtherIntangibleAssetsAndTrademarksMember_3c9caa27-ed27-4c72-80f3-d9d8bbe3b4d2" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#DerivativeInstrumentsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsDetails" xlink:type="extended" id="ibdd51c344c5e4e478a49b48b411a6522_DerivativeInstrumentsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosuresLineItems_65ff942f-f3a8-43fc-9200-8c82062ce3fc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosuresLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1_56c3f818-4c2f-4211-b537-d96040057101" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosuresLineItems_65ff942f-f3a8-43fc-9200-8c82062ce3fc" xlink:to="loc_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1_56c3f818-4c2f-4211-b537-d96040057101" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosuresTable_49bd4d33-fd81-4da0-98b6-ea014f5ced43" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosuresLineItems_65ff942f-f3a8-43fc-9200-8c82062ce3fc" xlink:to="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosuresTable_49bd4d33-fd81-4da0-98b6-ea014f5ced43" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_0aafc9f2-c302-4ab7-b783-58a4eb0d3a14" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosuresTable_49bd4d33-fd81-4da0-98b6-ea014f5ced43" xlink:to="loc_us-gaap_HedgingDesignationAxis_0aafc9f2-c302-4ab7-b783-58a4eb0d3a14" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_0aafc9f2-c302-4ab7-b783-58a4eb0d3a14_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_0aafc9f2-c302-4ab7-b783-58a4eb0d3a14" xlink:to="loc_us-gaap_HedgingDesignationDomain_0aafc9f2-c302-4ab7-b783-58a4eb0d3a14_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_ee85d3d1-866c-43b6-aadf-b8a7d9d6735e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_0aafc9f2-c302-4ab7-b783-58a4eb0d3a14" xlink:to="loc_us-gaap_HedgingDesignationDomain_ee85d3d1-866c-43b6-aadf-b8a7d9d6735e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_768be54a-e5cc-4e40-b227-93e4cd1fd3e5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_ee85d3d1-866c-43b6-aadf-b8a7d9d6735e" xlink:to="loc_us-gaap_NondesignatedMember_768be54a-e5cc-4e40-b227-93e4cd1fd3e5" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsOutstandingForwardContractsTableDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#DerivativeInstrumentsOutstandingForwardContractsTableDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsOutstandingForwardContractsTableDetails" xlink:type="extended" id="i2fa8fef100dc45b195978176c13b0a6c_DerivativeInstrumentsOutstandingForwardContractsTableDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLineItems_8d0a644e-770c-46fb-9406-0143bd1e24df" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssetNotionalAmount_29d58dde-5935-4fe0-9289-ef9a69dcbc93" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeAssetNotionalAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeLineItems_8d0a644e-770c-46fb-9406-0143bd1e24df" xlink:to="loc_us-gaap_DerivativeAssetNotionalAmount_29d58dde-5935-4fe0-9289-ef9a69dcbc93" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTable_187b318d-53b2-4705-9888-29e47b8ad6eb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeLineItems_8d0a644e-770c-46fb-9406-0143bd1e24df" xlink:to="loc_us-gaap_DerivativeTable_187b318d-53b2-4705-9888-29e47b8ad6eb" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_a4530b4c-e870-4f51-b0b0-507dbb3d5f0c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_187b318d-53b2-4705-9888-29e47b8ad6eb" xlink:to="loc_us-gaap_HedgingDesignationAxis_a4530b4c-e870-4f51-b0b0-507dbb3d5f0c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_a4530b4c-e870-4f51-b0b0-507dbb3d5f0c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_a4530b4c-e870-4f51-b0b0-507dbb3d5f0c" xlink:to="loc_us-gaap_HedgingDesignationDomain_a4530b4c-e870-4f51-b0b0-507dbb3d5f0c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_2095d6fd-7747-49b2-b791-663db7d6bd7e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_a4530b4c-e870-4f51-b0b0-507dbb3d5f0c" xlink:to="loc_us-gaap_HedgingDesignationDomain_2095d6fd-7747-49b2-b791-663db7d6bd7e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_8b9729f5-c94e-4d70-bfeb-86915880dac3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_2095d6fd-7747-49b2-b791-663db7d6bd7e" xlink:to="loc_us-gaap_NondesignatedMember_8b9729f5-c94e-4d70-bfeb-86915880dac3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_CurrencyAxis_c2f3fc0a-3345-44b2-9a36-2585926e68f7" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_CurrencyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeTable_187b318d-53b2-4705-9888-29e47b8ad6eb" xlink:to="loc_srt_CurrencyAxis_c2f3fc0a-3345-44b2-9a36-2585926e68f7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_AllCurrenciesDomain_c2f3fc0a-3345-44b2-9a36-2585926e68f7_default" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_AllCurrenciesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CurrencyAxis_c2f3fc0a-3345-44b2-9a36-2585926e68f7" xlink:to="loc_currency_AllCurrenciesDomain_c2f3fc0a-3345-44b2-9a36-2585926e68f7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_AllCurrenciesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CurrencyAxis_c2f3fc0a-3345-44b2-9a36-2585926e68f7" xlink:to="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_EUR_f7792078-2dde-4027-81cf-465214b664da" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_EUR"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:to="loc_currency_EUR_f7792078-2dde-4027-81cf-465214b664da" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_CNY_1ad1c811-88fa-418d-8768-5832e95a0637" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_CNY"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:to="loc_currency_CNY_1ad1c811-88fa-418d-8768-5832e95a0637" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_MXN_3d980a1f-5882-4769-8fcd-2f11b3be2185" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_MXN"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:to="loc_currency_MXN_3d980a1f-5882-4769-8fcd-2f11b3be2185" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_JPY_615333c1-9751-43f2-9ae7-02082728f7ca" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_JPY"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:to="loc_currency_JPY_615333c1-9751-43f2-9ae7-02082728f7ca" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_GBP_17a988b1-3d93-49b6-b16c-5d972ce9afbc" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_GBP"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:to="loc_currency_GBP_17a988b1-3d93-49b6-b16c-5d972ce9afbc" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_HUF_d157f34a-b670-4677-aa42-ced9f3691567" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_HUF"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:to="loc_currency_HUF_d157f34a-b670-4677-aa42-ced9f3691567" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_currency_CAD_03152bf0-1d77-48a6-8dc2-82720a98942b" xlink:href="https://xbrl.sec.gov/currency/2022/currency-2022.xsd#currency_CAD"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_currency_AllCurrenciesDomain_0eb755a1-eccb-4369-9323-d4ae26075a3d" xlink:to="loc_currency_CAD_03152bf0-1d77-48a6-8dc2-82720a98942b" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails" xlink:type="extended" id="i7ec0d3024b374969aac20ffeccc8c4ad_DerivativeInstrumentsScheduleofDerivativeInstrumentsinStatementofFinancialPositionFairValueDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_02986313-9dcb-4266-9a6d-f92f16cef612" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_f92338db-0074-4c08-8527-43486751883e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_02986313-9dcb-4266-9a6d-f92f16cef612" xlink:to="loc_us-gaap_DerivativeAssets_f92338db-0074-4c08-8527-43486751883e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_97abd9bd-a8fe-41c4-a977-71562ec3aa1c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_02986313-9dcb-4266-9a6d-f92f16cef612" xlink:to="loc_us-gaap_DerivativeLiabilities_97abd9bd-a8fe-41c4-a977-71562ec3aa1c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_bde1d5ca-4deb-4eac-bd0c-b60cea79da74" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_02986313-9dcb-4266-9a6d-f92f16cef612" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_bde1d5ca-4deb-4eac-bd0c-b60cea79da74" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_f17d9cd2-87ce-4514-b4c3-57ab6f70c4ae" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_bde1d5ca-4deb-4eac-bd0c-b60cea79da74" xlink:to="loc_us-gaap_HedgingDesignationAxis_f17d9cd2-87ce-4514-b4c3-57ab6f70c4ae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_f17d9cd2-87ce-4514-b4c3-57ab6f70c4ae_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_f17d9cd2-87ce-4514-b4c3-57ab6f70c4ae" xlink:to="loc_us-gaap_HedgingDesignationDomain_f17d9cd2-87ce-4514-b4c3-57ab6f70c4ae_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_30129761-292c-4f06-8156-4d80a19889c8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_f17d9cd2-87ce-4514-b4c3-57ab6f70c4ae" xlink:to="loc_us-gaap_HedgingDesignationDomain_30129761-292c-4f06-8156-4d80a19889c8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_5a233e9f-a7ab-430b-9f7c-d661ab27db20" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_30129761-292c-4f06-8156-4d80a19889c8" xlink:to="loc_us-gaap_NondesignatedMember_5a233e9f-a7ab-430b-9f7c-d661ab27db20" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/DerivativeInstrumentsDerivativeInstrumentsGainLossDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#DerivativeInstrumentsDerivativeInstrumentsGainLossDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/DerivativeInstrumentsDerivativeInstrumentsGainLossDetails" xlink:type="extended" id="i635940af118e4ed2b5fdcdb5ec1f8f98_DerivativeInstrumentsDerivativeInstrumentsGainLossDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossLineItems_d0e48f71-c468-4b12-897c-619e9eb71119" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentsGainLossLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_418714b1-42a1-4fe5-9e15-a678006ea061" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossLineItems_d0e48f71-c468-4b12-897c-619e9eb71119" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_418714b1-42a1-4fe5-9e15-a678006ea061" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_8330072a-9e5e-4fb9-ad0e-1354c63fa923" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossLineItems_d0e48f71-c468-4b12-897c-619e9eb71119" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_8330072a-9e5e-4fb9-ad0e-1354c63fa923" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_6c1e1817-ed65-43a2-94d3-b409816e5a2a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_8330072a-9e5e-4fb9-ad0e-1354c63fa923" xlink:to="loc_us-gaap_HedgingDesignationAxis_6c1e1817-ed65-43a2-94d3-b409816e5a2a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_6c1e1817-ed65-43a2-94d3-b409816e5a2a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_6c1e1817-ed65-43a2-94d3-b409816e5a2a" xlink:to="loc_us-gaap_HedgingDesignationDomain_6c1e1817-ed65-43a2-94d3-b409816e5a2a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_e14da1a0-acfa-41e4-bfe3-1194e80be8df" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_6c1e1817-ed65-43a2-94d3-b409816e5a2a" xlink:to="loc_us-gaap_HedgingDesignationDomain_e14da1a0-acfa-41e4-bfe3-1194e80be8df" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember_07eeb47a-0a10-4e23-9af7-327557d5133c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NondesignatedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_e14da1a0-acfa-41e4-bfe3-1194e80be8df" xlink:to="loc_us-gaap_NondesignatedMember_07eeb47a-0a10-4e23-9af7-327557d5133c" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyGeographyDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#RevenueRecognitionRevenueDisaggregatedbyGeographyDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyGeographyDetails" xlink:type="extended" id="ib2e0fa426ee748cf8f1d1fb041409940_RevenueRecognitionRevenueDisaggregatedbyGeographyDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DisaggregationOfRevenueLineItems_52ac1a47-c1f9-4fd2-acd0-243a7dcadc54" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DisaggregationOfRevenueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_8ed248d8-f625-4410-a3f1-d7faad86228f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_52ac1a47-c1f9-4fd2-acd0-243a7dcadc54" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_8ed248d8-f625-4410-a3f1-d7faad86228f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DisaggregationOfRevenueTable_e629ffb0-e569-4922-9950-29faab05e1ce" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DisaggregationOfRevenueTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems_52ac1a47-c1f9-4fd2-acd0-243a7dcadc54" xlink:to="loc_us-gaap_DisaggregationOfRevenueTable_e629ffb0-e569-4922-9950-29faab05e1ce" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis_85e9edf6-ceae-4b10-b828-62807d7082a8" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_StatementGeographicalAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable_e629ffb0-e569-4922-9950-29faab05e1ce" xlink:to="loc_srt_StatementGeographicalAxis_85e9edf6-ceae-4b10-b828-62807d7082a8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_85e9edf6-ceae-4b10-b828-62807d7082a8_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_85e9edf6-ceae-4b10-b828-62807d7082a8" xlink:to="loc_srt_SegmentGeographicalDomain_85e9edf6-ceae-4b10-b828-62807d7082a8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_56a5e50b-d5ef-42c6-b2a9-bf0da2c050ab" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_85e9edf6-ceae-4b10-b828-62807d7082a8" xlink:to="loc_srt_SegmentGeographicalDomain_56a5e50b-d5ef-42c6-b2a9-bf0da2c050ab" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_AmericasMember_afd8cd22-a6c6-4702-ae65-5fc729ca3e0f" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_AmericasMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_56a5e50b-d5ef-42c6-b2a9-bf0da2c050ab" xlink:to="loc_srt_AmericasMember_afd8cd22-a6c6-4702-ae65-5fc729ca3e0f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_EuropeMember_239697e3-6074-4b70-a8c0-d512ad35a91b" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_EuropeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_56a5e50b-d5ef-42c6-b2a9-bf0da2c050ab" xlink:to="loc_srt_EuropeMember_239697e3-6074-4b70-a8c0-d512ad35a91b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_country_CN_4da8bbce-63ff-4d54-b7b4-735ed72201dd" xlink:href="https://xbrl.sec.gov/country/2022/country-2022.xsd#country_CN"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_56a5e50b-d5ef-42c6-b2a9-bf0da2c050ab" xlink:to="loc_country_CN_4da8bbce-63ff-4d54-b7b4-735ed72201dd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AsiaExcludingChinaMember_eaff2b9c-5ccd-4291-a859-ea6d8f051d60" xlink:href="cgnx-20221002.xsd#cgnx_AsiaExcludingChinaMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_56a5e50b-d5ef-42c6-b2a9-bf0da2c050ab" xlink:to="loc_cgnx_AsiaExcludingChinaMember_eaff2b9c-5ccd-4291-a859-ea6d8f051d60" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails" xlink:type="extended" id="i5e3ddbbcef0d4582af40b84d0a9bd289_RevenueRecognitionRevenueDisaggregatedbyProductsandServicesDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EntityWideInformationRevenueFromExternalCustomerLineItems_56c226f2-2288-4c0b-a06e-70137374f36c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EntityWideInformationRevenueFromExternalCustomerLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_71649053-4df0-49a8-81a2-9735a0f31b65" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EntityWideInformationRevenueFromExternalCustomerLineItems_56c226f2-2288-4c0b-a06e-70137374f36c" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_71649053-4df0-49a8-81a2-9735a0f31b65" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable_88fd3c90-3643-4616-b726-0dadd6f03aef" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EntityWideInformationRevenueFromExternalCustomerLineItems_56c226f2-2288-4c0b-a06e-70137374f36c" xlink:to="loc_us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable_88fd3c90-3643-4616-b726-0dadd6f03aef" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ProductOrServiceAxis_b40ad872-50d8-4f9d-abaa-f013ea1fda21" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ProductOrServiceAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEntityWideInformationRevenueFromExternalCustomersByProductsAndServicesTable_88fd3c90-3643-4616-b726-0dadd6f03aef" xlink:to="loc_srt_ProductOrServiceAxis_b40ad872-50d8-4f9d-abaa-f013ea1fda21" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ProductsAndServicesDomain_b40ad872-50d8-4f9d-abaa-f013ea1fda21_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ProductsAndServicesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ProductOrServiceAxis_b40ad872-50d8-4f9d-abaa-f013ea1fda21" xlink:to="loc_srt_ProductsAndServicesDomain_b40ad872-50d8-4f9d-abaa-f013ea1fda21_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ProductsAndServicesDomain_2b11a350-b415-4421-bd73-f67620153c4f" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_ProductsAndServicesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ProductOrServiceAxis_b40ad872-50d8-4f9d-abaa-f013ea1fda21" xlink:to="loc_srt_ProductsAndServicesDomain_2b11a350-b415-4421-bd73-f67620153c4f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_StandardProductsandServicesMember_0eaef806-70ba-4b56-b3b6-74150e5e7ce2" xlink:href="cgnx-20221002.xsd#cgnx_StandardProductsandServicesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_2b11a350-b415-4421-bd73-f67620153c4f" xlink:to="loc_cgnx_StandardProductsandServicesMember_0eaef806-70ba-4b56-b3b6-74150e5e7ce2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ApplicationSpecificCustomerSolutionsMember_19b20e4f-b59d-4076-8907-d7e168983162" xlink:href="cgnx-20221002.xsd#cgnx_ApplicationSpecificCustomerSolutionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_2b11a350-b415-4421-bd73-f67620153c4f" xlink:to="loc_cgnx_ApplicationSpecificCustomerSolutionsMember_19b20e4f-b59d-4076-8907-d7e168983162" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#StockBasedCompensationExpenseDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseDetails" xlink:type="extended" id="i4a02a1169e0d49ecbd837ffbdfb9d2bc_StockBasedCompensationExpenseDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_70efdee9-5f7a-4fbe-aced-5d4905e5ec08" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_70efdee9-5f7a-4fbe-aced-5d4905e5ec08" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_87f35730-7f8b-45ef-bdd2-617578432827" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_87f35730-7f8b-45ef-bdd2-617578432827" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ExpirationPeriodOfStockOptionPlan_902baef8-63ee-4d34-babf-160610b76791" xlink:href="cgnx-20221002.xsd#cgnx_ExpirationPeriodOfStockOptionPlan"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_ExpirationPeriodOfStockOptionPlan_902baef8-63ee-4d34-babf-160610b76791" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_747cbaff-3d3f-46fc-b7bf-7d15299995e1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_747cbaff-3d3f-46fc-b7bf-7d15299995e1" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisableIntrinsicValue_092f3395-0455-4946-8425-7487b2f84ccb" xlink:href="cgnx-20221002.xsd#cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisableIntrinsicValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisableIntrinsicValue_092f3395-0455-4946-8425-7487b2f84ccb" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue_aa9dee8f-82cd-4eae-b847-8674d15bccca" xlink:href="cgnx-20221002.xsd#cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue_aa9dee8f-82cd-4eae-b847-8674d15bccca" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_de25764f-c648-47ea-aa2e-a7cd16c32b0c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_de25764f-c648-47ea-aa2e-a7cd16c32b0c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_c7ca920b-9721-4347-a6a6-ce25fbf08cfd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_c7ca920b-9721-4347-a6a6-ce25fbf08cfd" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_00cebc55-d214-4a9f-b78d-08fb1d8ff575" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_00cebc55-d214-4a9f-b78d-08fb1d8ff575" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_NumberOfGroupsWithinEmployeePopulation_9f277c0a-11f2-4a8c-b760-9a4538e480a8" xlink:href="cgnx-20221002.xsd#cgnx_NumberOfGroupsWithinEmployeePopulation"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_NumberOfGroupsWithinEmployeePopulation_9f277c0a-11f2-4a8c-b760-9a4538e480a8" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement_b61f28d1-4779-462f-b2b4-9f168cd402ff" xlink:href="cgnx-20221002.xsd#cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement_b61f28d1-4779-462f-b2b4-9f168cd402ff" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement_dcfed9bc-1a85-4a62-b49a-319820a5044f" xlink:href="cgnx-20221002.xsd#cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement_dcfed9bc-1a85-4a62-b49a-319820a5044f" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_IncreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates_e4390c60-5e83-4909-9316-120f3b1a4aa8" xlink:href="cgnx-20221002.xsd#cgnx_IncreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_IncreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates_e4390c60-5e83-4909-9316-120f3b1a4aa8" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_d5967eb2-326f-4944-a864-4942b258bbe0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_d5967eb2-326f-4944-a864-4942b258bbe0" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EmployeeServiceSharebasedCompensationNonvestedAwardsCompensationNotyetRecognizedPeriodforRecognition_e74b2360-67d2-4986-a816-cd7e95526aa8" xlink:href="cgnx-20221002.xsd#cgnx_EmployeeServiceSharebasedCompensationNonvestedAwardsCompensationNotyetRecognizedPeriodforRecognition"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_EmployeeServiceSharebasedCompensationNonvestedAwardsCompensationNotyetRecognizedPeriodforRecognition_e74b2360-67d2-4986-a816-cd7e95526aa8" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllocatedShareBasedCompensationExpense_bee96007-c092-4ea8-8042-075bea461015" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AllocatedShareBasedCompensationExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_AllocatedShareBasedCompensationExpense_bee96007-c092-4ea8-8042-075bea461015" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_21bab8ab-ccad-422b-bbc4-8078e920b48f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_21bab8ab-ccad-422b-bbc4-8078e920b48f" xlink:type="arc" order="16"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount_888ebaa1-f67c-443a-818c-e1ffe792712b" xlink:href="cgnx-20221002.xsd#cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount_888ebaa1-f67c-443a-818c-e1ffe792712b" xlink:type="arc" order="17"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_817e75f7-a5db-47fa-82a8-982d7050a8dc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_e479b6bd-24bb-4fdf-a337-42f03b8a256f" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_817e75f7-a5db-47fa-82a8-982d7050a8dc" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_e34520bd-0ae4-4f35-9346-742666920ef0" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_817e75f7-a5db-47fa-82a8-982d7050a8dc" xlink:to="loc_srt_RangeAxis_e34520bd-0ae4-4f35-9346-742666920ef0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_e34520bd-0ae4-4f35-9346-742666920ef0_default" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_e34520bd-0ae4-4f35-9346-742666920ef0" xlink:to="loc_srt_RangeMember_e34520bd-0ae4-4f35-9346-742666920ef0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_fa3f35fb-9375-46ac-85cf-f36be4601ef2" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_e34520bd-0ae4-4f35-9346-742666920ef0" xlink:to="loc_srt_RangeMember_fa3f35fb-9375-46ac-85cf-f36be4601ef2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_9118caf8-68a6-40eb-ae8a-e557c18a52b4" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_fa3f35fb-9375-46ac-85cf-f36be4601ef2" xlink:to="loc_srt_MinimumMember_9118caf8-68a6-40eb-ae8a-e557c18a52b4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_f7d14b6b-81f6-431b-967c-d35adc1f0138" xlink:href="https://xbrl.fasb.org/srt/2022/elts/srt-2022.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_fa3f35fb-9375-46ac-85cf-f36be4601ef2" xlink:to="loc_srt_MaximumMember_f7d14b6b-81f6-431b-967c-d35adc1f0138" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_87f4f3ff-e999-4b27-9f6b-799fdc792eb0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_817e75f7-a5db-47fa-82a8-982d7050a8dc" xlink:to="loc_us-gaap_AwardTypeAxis_87f4f3ff-e999-4b27-9f6b-799fdc792eb0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_87f4f3ff-e999-4b27-9f6b-799fdc792eb0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_87f4f3ff-e999-4b27-9f6b-799fdc792eb0" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_87f4f3ff-e999-4b27-9f6b-799fdc792eb0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_9aab8304-dc36-47e3-b312-622ff094b3b4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_87f4f3ff-e999-4b27-9f6b-799fdc792eb0" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_9aab8304-dc36-47e3-b312-622ff094b3b4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_ff25e2f5-730a-4de3-9f41-02a9086b5732" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_9aab8304-dc36-47e3-b312-622ff094b3b4" xlink:to="loc_us-gaap_EmployeeStockOptionMember_ff25e2f5-730a-4de3-9f41-02a9086b5732" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_5c717478-240c-4581-8246-a64628c14110" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_9aab8304-dc36-47e3-b312-622ff094b3b4" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_5c717478-240c-4581-8246-a64628c14110" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PerformanceSharesMember_734bafff-239d-4383-a799-0da435e48103" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PerformanceSharesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_9aab8304-dc36-47e3-b312-622ff094b3b4" xlink:to="loc_us-gaap_PerformanceSharesMember_734bafff-239d-4383-a799-0da435e48103" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameAxis_f2476d73-56e6-4c87-a87d-15c42efe57bf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PlanNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_817e75f7-a5db-47fa-82a8-982d7050a8dc" xlink:to="loc_us-gaap_PlanNameAxis_f2476d73-56e6-4c87-a87d-15c42efe57bf" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameDomain_f2476d73-56e6-4c87-a87d-15c42efe57bf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PlanNameAxis_f2476d73-56e6-4c87-a87d-15c42efe57bf" xlink:to="loc_us-gaap_PlanNameDomain_f2476d73-56e6-4c87-a87d-15c42efe57bf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameDomain_e99f4703-34ac-4701-b060-e9584eaf0a06" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PlanNameAxis_f2476d73-56e6-4c87-a87d-15c42efe57bf" xlink:to="loc_us-gaap_PlanNameDomain_e99f4703-34ac-4701-b060-e9584eaf0a06" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_GeneralStockOptionPlanMember_f8a592b4-03b1-44ea-a537-28d0d07e40dc" xlink:href="cgnx-20221002.xsd#cgnx_GeneralStockOptionPlanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PlanNameDomain_e99f4703-34ac-4701-b060-e9584eaf0a06" xlink:to="loc_cgnx_GeneralStockOptionPlanMember_f8a592b4-03b1-44ea-a537-28d0d07e40dc" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails" xlink:type="extended" id="ib4d45c32e06e4339a4b678a92bfd9186_StockBasedCompensationExpenseStockBasedCompensationExpenseScheduleofRestrictedStockUnitsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_edaae4cf-f836-410b-8911-1799f442acea" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_2c6bf980-49c1-4553-9197-da4116e8c0ac" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_edaae4cf-f836-410b-8911-1799f442acea" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_2c6bf980-49c1-4553-9197-da4116e8c0ac" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_f59031b1-8efa-4d3d-b975-4f0190894c31" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_2c6bf980-49c1-4553-9197-da4116e8c0ac" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_f59031b1-8efa-4d3d-b975-4f0190894c31" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_004a44f3-dc6e-4c40-831d-e1068b112b34" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_2c6bf980-49c1-4553-9197-da4116e8c0ac" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_004a44f3-dc6e-4c40-831d-e1068b112b34" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_ba5150fa-a14b-49c7-aa67-24e2547c4cd7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_2c6bf980-49c1-4553-9197-da4116e8c0ac" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_ba5150fa-a14b-49c7-aa67-24e2547c4cd7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_e1f56766-d29d-4ce9-ad50-d756230d2be5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_2c6bf980-49c1-4553-9197-da4116e8c0ac" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_e1f56766-d29d-4ce9-ad50-d756230d2be5" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_a1752b64-aef4-49d0-bca4-8034089b1c4b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_f5ab4571-6895-4bdd-ab7a-f71f9b7bb241" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_edaae4cf-f836-410b-8911-1799f442acea" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_f5ab4571-6895-4bdd-ab7a-f71f9b7bb241" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_fe888c70-c7b8-4bfb-8abb-2251e668ce3c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_f5ab4571-6895-4bdd-ab7a-f71f9b7bb241" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_fe888c70-c7b8-4bfb-8abb-2251e668ce3c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_6ede0afe-4610-4680-bb56-27276e6247e9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_f5ab4571-6895-4bdd-ab7a-f71f9b7bb241" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_6ede0afe-4610-4680-bb56-27276e6247e9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_527d67fd-36c8-4fe6-9207-91a7f8784357" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_f5ab4571-6895-4bdd-ab7a-f71f9b7bb241" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_527d67fd-36c8-4fe6-9207-91a7f8784357" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_68cac570-20ed-4cc7-b46a-70058627e855" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_f5ab4571-6895-4bdd-ab7a-f71f9b7bb241" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_68cac570-20ed-4cc7-b46a-70058627e855" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_bca8d527-0a44-494b-a15e-7d9a3bf5b6ef" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_da33e372-3d17-4319-ba6a-d113fb0dd7d1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_edaae4cf-f836-410b-8911-1799f442acea" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_da33e372-3d17-4319-ba6a-d113fb0dd7d1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_8f64fe9d-381c-4341-97d8-40d5eafb975f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_da33e372-3d17-4319-ba6a-d113fb0dd7d1" xlink:to="loc_us-gaap_AwardTypeAxis_8f64fe9d-381c-4341-97d8-40d5eafb975f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_8f64fe9d-381c-4341-97d8-40d5eafb975f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_8f64fe9d-381c-4341-97d8-40d5eafb975f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_8f64fe9d-381c-4341-97d8-40d5eafb975f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_255b7eaf-ad32-47c1-8662-6fca8fa338e9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_8f64fe9d-381c-4341-97d8-40d5eafb975f" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_255b7eaf-ad32-47c1-8662-6fca8fa338e9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_4de88074-29ab-4646-b266-5a740f264e14" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_255b7eaf-ad32-47c1-8662-6fca8fa338e9" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_4de88074-29ab-4646-b266-5a740f264e14" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseScheduleofPerformanceRestrictedStockUnitsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#StockBasedCompensationExpenseScheduleofPerformanceRestrictedStockUnitsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseScheduleofPerformanceRestrictedStockUnitsDetails" xlink:type="extended" id="i63f4887541e34b88b1b293470af2135e_StockBasedCompensationExpenseScheduleofPerformanceRestrictedStockUnitsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_418d8067-5626-445c-8bc4-922d302eae05" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_dc78eda5-31a2-4500-ba1d-ba7d86b0eb28" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_418d8067-5626-445c-8bc4-922d302eae05" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_dc78eda5-31a2-4500-ba1d-ba7d86b0eb28" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_86773f91-c278-4ccc-b4fc-02a368da1a50" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_dc78eda5-31a2-4500-ba1d-ba7d86b0eb28" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_86773f91-c278-4ccc-b4fc-02a368da1a50" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_115c1856-1aef-43a3-a16b-9161e7850e69" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_dc78eda5-31a2-4500-ba1d-ba7d86b0eb28" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_115c1856-1aef-43a3-a16b-9161e7850e69" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_99614a4f-ea01-4198-afe8-8097080a9740" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_dc78eda5-31a2-4500-ba1d-ba7d86b0eb28" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_99614a4f-ea01-4198-afe8-8097080a9740" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_90058705-5381-4fc6-abc4-47b40c1f6cb1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_dc78eda5-31a2-4500-ba1d-ba7d86b0eb28" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_90058705-5381-4fc6-abc4-47b40c1f6cb1" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_17bcf2b7-1a2c-463f-9b6c-6b0fcec3a749" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_8e6c6924-39c8-4ea1-909a-2299d32d2839" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_418d8067-5626-445c-8bc4-922d302eae05" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_8e6c6924-39c8-4ea1-909a-2299d32d2839" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_296db173-bae4-4831-af72-73040414efab" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_8e6c6924-39c8-4ea1-909a-2299d32d2839" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_296db173-bae4-4831-af72-73040414efab" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_d735ef47-19d9-4052-b9a7-0fc883d2f4d6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_8e6c6924-39c8-4ea1-909a-2299d32d2839" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_d735ef47-19d9-4052-b9a7-0fc883d2f4d6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_38b5c88d-123a-4ea5-9215-a57576e78aa8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_8e6c6924-39c8-4ea1-909a-2299d32d2839" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_38b5c88d-123a-4ea5-9215-a57576e78aa8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_cc65744d-3dc5-4bb7-a323-dc36f7c84818" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_8e6c6924-39c8-4ea1-909a-2299d32d2839" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_cc65744d-3dc5-4bb7-a323-dc36f7c84818" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_77e60347-8d61-4ca2-9600-1c590d39bd11" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_86cd8155-0261-40c3-a841-db19eb199c8c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_418d8067-5626-445c-8bc4-922d302eae05" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_86cd8155-0261-40c3-a841-db19eb199c8c" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_f10dc85a-2dd8-4af7-a647-12ff3e623743" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_86cd8155-0261-40c3-a841-db19eb199c8c" xlink:to="loc_us-gaap_AwardTypeAxis_f10dc85a-2dd8-4af7-a647-12ff3e623743" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_f10dc85a-2dd8-4af7-a647-12ff3e623743_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_f10dc85a-2dd8-4af7-a647-12ff3e623743" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_f10dc85a-2dd8-4af7-a647-12ff3e623743_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_68ec29d1-99f6-45e7-a15e-18cb61b4217d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_f10dc85a-2dd8-4af7-a647-12ff3e623743" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_68ec29d1-99f6-45e7-a15e-18cb61b4217d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PerformanceSharesMember_adb96f44-e63a-4239-b559-712d1e2f5fd2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PerformanceSharesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_68ec29d1-99f6-45e7-a15e-18cb61b4217d" xlink:to="loc_us-gaap_PerformanceSharesMember_adb96f44-e63a-4239-b559-712d1e2f5fd2" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails" xlink:type="extended" id="i84208459dce54e69b454e01b5fd9f69c_StockBasedCompensationExpenseScheduleofEmployeeServiceSharebasedCompensationAllocationofRecognizedPeriodCostsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems_626d665c-4ee6-422c-ba6d-270c1f0c0bc9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllocatedShareBasedCompensationExpense_527a89f8-841c-4528-a74a-fac3076aadda" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AllocatedShareBasedCompensationExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems_626d665c-4ee6-422c-ba6d-270c1f0c0bc9" xlink:to="loc_us-gaap_AllocatedShareBasedCompensationExpense_527a89f8-841c-4528-a74a-fac3076aadda" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable_6713241d-4cad-4aa9-89c0-9833ccb76c09" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems_626d665c-4ee6-422c-ba6d-270c1f0c0bc9" xlink:to="loc_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable_6713241d-4cad-4aa9-89c0-9833ccb76c09" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_19404686-be77-4ea8-96ab-5c78f93521db" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable_6713241d-4cad-4aa9-89c0-9833ccb76c09" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_19404686-be77-4ea8-96ab-5c78f93521db" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_19404686-be77-4ea8-96ab-5c78f93521db_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_19404686-be77-4ea8-96ab-5c78f93521db" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_19404686-be77-4ea8-96ab-5c78f93521db_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_87bfc493-5492-4a3e-833e-24b27dd641f8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_19404686-be77-4ea8-96ab-5c78f93521db" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_87bfc493-5492-4a3e-833e-24b27dd641f8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsTotalMember_661e4d8d-1f14-4cd9-8aa4-4fdb8144d5cb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CostOfGoodsTotalMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_87bfc493-5492-4a3e-833e-24b27dd641f8" xlink:to="loc_us-gaap_CostOfGoodsTotalMember_661e4d8d-1f14-4cd9-8aa4-4fdb8144d5cb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpenseMember_398ffe41-545c-4415-8006-b257f7bd9838" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ResearchAndDevelopmentExpenseMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_87bfc493-5492-4a3e-833e-24b27dd641f8" xlink:to="loc_us-gaap_ResearchAndDevelopmentExpenseMember_398ffe41-545c-4415-8006-b257f7bd9838" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_SellingGeneralAndAdministrativeMember_c457951a-e10f-42b5-89f2-d4f0972f72dd" xlink:href="cgnx-20221002.xsd#cgnx_SellingGeneralAndAdministrativeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_87bfc493-5492-4a3e-833e-24b27dd641f8" xlink:to="loc_cgnx_SellingGeneralAndAdministrativeMember_c457951a-e10f-42b5-89f2-d4f0972f72dd" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/StockRepurchaseProgramDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#StockRepurchaseProgramDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/StockRepurchaseProgramDetails" xlink:type="extended" id="i676af9217747488d950013b7bca4cc1f_StockRepurchaseProgramDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityClassOfTreasuryStockLineItems_ce27e9df-3474-4c5e-8a02-3c5e0041f31b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EquityClassOfTreasuryStockLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1_99bff6d6-dfa0-4217-9b33-49c7deeea1b3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRepurchaseProgramAuthorizedAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_ce27e9df-3474-4c5e-8a02-3c5e0041f31b" xlink:to="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1_99bff6d6-dfa0-4217-9b33-49c7deeea1b3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRedeemedOrCalledDuringPeriodShares_f4377846-0779-4847-a549-8e4a5f38e9e8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRedeemedOrCalledDuringPeriodShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_ce27e9df-3474-4c5e-8a02-3c5e0041f31b" xlink:to="loc_us-gaap_StockRedeemedOrCalledDuringPeriodShares_f4377846-0779-4847-a549-8e4a5f38e9e8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRedeemedOrCalledDuringPeriodValue_6e977284-eee7-4721-8fcb-b53c5ff12d62" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRedeemedOrCalledDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_ce27e9df-3474-4c5e-8a02-3c5e0041f31b" xlink:to="loc_us-gaap_StockRedeemedOrCalledDuringPeriodValue_6e977284-eee7-4721-8fcb-b53c5ff12d62" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_09be0f09-49f6-4235-a4d9-a5928ee558e4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_ce27e9df-3474-4c5e-8a02-3c5e0041f31b" xlink:to="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_09be0f09-49f6-4235-a4d9-a5928ee558e4" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_StockRepurchasedDuringPriorPeriodSettledInCurrentPeriod_3317bcdc-efd7-42d7-8d83-fc76b0817312" xlink:href="cgnx-20221002.xsd#cgnx_StockRepurchasedDuringPriorPeriodSettledInCurrentPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_ce27e9df-3474-4c5e-8a02-3c5e0041f31b" xlink:to="loc_cgnx_StockRepurchasedDuringPriorPeriodSettledInCurrentPeriod_3317bcdc-efd7-42d7-8d83-fc76b0817312" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfTreasuryStockTable_df5e8081-cf2b-4b82-aa5f-e15d827ffe8e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ClassOfTreasuryStockTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EquityClassOfTreasuryStockLineItems_ce27e9df-3474-4c5e-8a02-3c5e0041f31b" xlink:to="loc_us-gaap_ClassOfTreasuryStockTable_df5e8081-cf2b-4b82-aa5f-e15d827ffe8e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramAxis_d186d9b6-5806-4367-be15-234feb0a1805" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareRepurchaseProgramAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfTreasuryStockTable_df5e8081-cf2b-4b82-aa5f-e15d827ffe8e" xlink:to="loc_us-gaap_ShareRepurchaseProgramAxis_d186d9b6-5806-4367-be15-234feb0a1805" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramDomain_d186d9b6-5806-4367-be15-234feb0a1805_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareRepurchaseProgramDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShareRepurchaseProgramAxis_d186d9b6-5806-4367-be15-234feb0a1805" xlink:to="loc_us-gaap_ShareRepurchaseProgramDomain_d186d9b6-5806-4367-be15-234feb0a1805_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramDomain_59800528-a2b2-4dd4-bdae-0292dacc3b7c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareRepurchaseProgramDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShareRepurchaseProgramAxis_d186d9b6-5806-4367-be15-234feb0a1805" xlink:to="loc_us-gaap_ShareRepurchaseProgramDomain_59800528-a2b2-4dd4-bdae-0292dacc3b7c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_RepurchaseProgramMarch2020Member_0e243dfa-45d4-44a5-b2af-295b1b141443" xlink:href="cgnx-20221002.xsd#cgnx_RepurchaseProgramMarch2020Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareRepurchaseProgramDomain_59800528-a2b2-4dd4-bdae-0292dacc3b7c" xlink:to="loc_cgnx_RepurchaseProgramMarch2020Member_0e243dfa-45d4-44a5-b2af-295b1b141443" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_RepurchaseProgramMarch2022Member_fe9287a7-3e3a-48c2-a4da-05c1f413cd98" xlink:href="cgnx-20221002.xsd#cgnx_RepurchaseProgramMarch2022Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareRepurchaseProgramDomain_59800528-a2b2-4dd4-bdae-0292dacc3b7c" xlink:to="loc_cgnx_RepurchaseProgramMarch2022Member_fe9287a7-3e3a-48c2-a4da-05c1f413cd98" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/IncomeTaxesDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#IncomeTaxesDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/IncomeTaxesDetails" xlink:type="extended" id="icf220f13ec9d42b280ac2b058c09a9ef_IncomeTaxesDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxContingencyLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_db72d6b1-7d4f-4b3e-9c89-de6c896bbedd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_db72d6b1-7d4f-4b3e-9c89-de6c896bbedd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTaxRateReconciliationDiscreteTaxExpenseBenefitAmount_4592f68f-dc65-457f-9975-1506ad60021d" xlink:href="cgnx-20221002.xsd#cgnx_EffectiveIncomeTaxRateReconciliationDiscreteTaxExpenseBenefitAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_cgnx_EffectiveIncomeTaxRateReconciliationDiscreteTaxExpenseBenefitAmount_4592f68f-dc65-457f-9975-1506ad60021d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTaxRateReconciliationCatastrophicEventAmount_095a0432-ade6-4d2e-98cf-6f4a336b2c83" xlink:href="cgnx-20221002.xsd#cgnx_EffectiveIncomeTaxRateReconciliationCatastrophicEventAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_cgnx_EffectiveIncomeTaxRateReconciliationCatastrophicEventAmount_095a0432-ade6-4d2e-98cf-6f4a336b2c83" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxReconciliationTaxSettlements_6b767b09-54ae-4a1d-8506-c1a52f95b56a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxReconciliationTaxSettlements"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_IncomeTaxReconciliationTaxSettlements_6b767b09-54ae-4a1d-8506-c1a52f95b56a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxReconciliationChangeInDeferredTaxAssetsValuationAllowance_32b5d057-724c-4197-b7d5-f2d96dd3007a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxReconciliationChangeInDeferredTaxAssetsValuationAllowance"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_IncomeTaxReconciliationChangeInDeferredTaxAssetsValuationAllowance_32b5d057-724c-4197-b7d5-f2d96dd3007a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxReconciliationOtherAdjustments_d9fac046-ca2a-4c2a-9590-89f634b04382" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxReconciliationOtherAdjustments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_IncomeTaxReconciliationOtherAdjustments_d9fac046-ca2a-4c2a-9590-89f634b04382" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount_87bbb11c-f202-4881-ad87-77128df29748" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount_87bbb11c-f202-4881-ad87-77128df29748" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTaxRateReconciliationExcludingDiscreteItemsPercent_7ce06af6-87e8-4c77-8f19-1f82641f5937" xlink:href="cgnx-20221002.xsd#cgnx_EffectiveIncomeTaxRateReconciliationExcludingDiscreteItemsPercent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_cgnx_EffectiveIncomeTaxRateReconciliationExcludingDiscreteItemsPercent_7ce06af6-87e8-4c77-8f19-1f82641f5937" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_46d8d579-2be1-42e3-a13a-2d037ed2c0a6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_46d8d579-2be1-42e3-a13a-2d037ed2c0a6" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_LiabilityForUncertainTaxPositions_8abf0ac6-d9d1-4ca6-b76f-b9f6dc1d0bd8" xlink:href="cgnx-20221002.xsd#cgnx_LiabilityForUncertainTaxPositions"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_cgnx_LiabilityForUncertainTaxPositions_8abf0ac6-d9d1-4ca6-b76f-b9f6dc1d0bd8" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent_eaee9ba5-8346-4680-b8a6-8592e02fca92" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilityForUncertainTaxPositionsNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent_eaee9ba5-8346-4680-b8a6-8592e02fca92" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredLiabilities_b3c2f1d0-fb5e-4ec8-ac7e-40e8f58ddd52" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInDeferredLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredLiabilities_b3c2f1d0-fb5e-4ec8-ac7e-40e8f58ddd52" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_TaxyearsopentoexaminationbyInternalRevenueService_e6ae9bf9-9a15-4e85-b990-677a3be540f5" xlink:href="cgnx-20221002.xsd#cgnx_TaxyearsopentoexaminationbyInternalRevenueService"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_cgnx_TaxyearsopentoexaminationbyInternalRevenueService_e6ae9bf9-9a15-4e85-b990-677a3be540f5" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_IncomeTaxExaminationYearsUnderExaminationOtherEntities_0653ca7d-355b-48e6-9465-e29e94472cce" xlink:href="cgnx-20221002.xsd#cgnx_IncomeTaxExaminationYearsUnderExaminationOtherEntities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_cgnx_IncomeTaxExaminationYearsUnderExaminationOtherEntities_0653ca7d-355b-48e6-9465-e29e94472cce" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTacRateReconciliationReleaseOfTaxReserve_dc2fe888-bed8-4ac4-85b2-3b0b39faf16a" xlink:href="cgnx-20221002.xsd#cgnx_EffectiveIncomeTacRateReconciliationReleaseOfTaxReserve"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_cgnx_EffectiveIncomeTacRateReconciliationReleaseOfTaxReserve_dc2fe888-bed8-4ac4-85b2-3b0b39faf16a" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxContingencyTable_fa8f25fd-5370-4b9f-aff7-b42f52fb160d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxContingencyTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_900dfb41-9acb-4b74-971e-98711410e40d" xlink:to="loc_us-gaap_IncomeTaxContingencyTable_fa8f25fd-5370-4b9f-aff7-b42f52fb160d" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityAxis_9e8e7561-0ec1-45f5-b69e-7e8d491f5f0d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxAuthorityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_IncomeTaxContingencyTable_fa8f25fd-5370-4b9f-aff7-b42f52fb160d" xlink:to="loc_us-gaap_IncomeTaxAuthorityAxis_9e8e7561-0ec1-45f5-b69e-7e8d491f5f0d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityDomain_9e8e7561-0ec1-45f5-b69e-7e8d491f5f0d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxAuthorityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeTaxAuthorityAxis_9e8e7561-0ec1-45f5-b69e-7e8d491f5f0d" xlink:to="loc_us-gaap_IncomeTaxAuthorityDomain_9e8e7561-0ec1-45f5-b69e-7e8d491f5f0d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityDomain_d2194dec-6086-40fa-91e5-6c7b00669ddd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxAuthorityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeTaxAuthorityAxis_9e8e7561-0ec1-45f5-b69e-7e8d491f5f0d" xlink:to="loc_us-gaap_IncomeTaxAuthorityDomain_d2194dec-6086-40fa-91e5-6c7b00669ddd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCountryMember_475354af-f172-439b-a267-c3616cc30a9f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ForeignCountryMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityDomain_d2194dec-6086-40fa-91e5-6c7b00669ddd" xlink:to="loc_us-gaap_ForeignCountryMember_475354af-f172-439b-a267-c3616cc30a9f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DomesticCountryMember_e77cccab-19b6-4ad3-a3f5-bc9ab919ef77" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DomesticCountryMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityDomain_d2194dec-6086-40fa-91e5-6c7b00669ddd" xlink:to="loc_us-gaap_DomesticCountryMember_e77cccab-19b6-4ad3-a3f5-bc9ab919ef77" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityNameAxis_742f4861-68ef-4100-b54d-72daad94b62f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxAuthorityNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_IncomeTaxContingencyTable_fa8f25fd-5370-4b9f-aff7-b42f52fb160d" xlink:to="loc_us-gaap_IncomeTaxAuthorityNameAxis_742f4861-68ef-4100-b54d-72daad94b62f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityNameDomain_742f4861-68ef-4100-b54d-72daad94b62f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxAuthorityNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameAxis_742f4861-68ef-4100-b54d-72daad94b62f" xlink:to="loc_us-gaap_IncomeTaxAuthorityNameDomain_742f4861-68ef-4100-b54d-72daad94b62f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityNameDomain_9058926f-aad9-4ed9-acf1-d6aba274613e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxAuthorityNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameAxis_742f4861-68ef-4100-b54d-72daad94b62f" xlink:to="loc_us-gaap_IncomeTaxAuthorityNameDomain_9058926f-aad9-4ed9-acf1-d6aba274613e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueCommissionersIrelandMember_6590b7f3-0510-4c1d-bb59-85ca33b05470" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RevenueCommissionersIrelandMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameDomain_9058926f-aad9-4ed9-acf1-d6aba274613e" xlink:to="loc_us-gaap_RevenueCommissionersIrelandMember_6590b7f3-0510-4c1d-bb59-85ca33b05470" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StateAdministrationOfTaxationChinaMember_6eff366f-83b4-43f1-8e67-c28e8dd174fe" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StateAdministrationOfTaxationChinaMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameDomain_9058926f-aad9-4ed9-acf1-d6aba274613e" xlink:to="loc_us-gaap_StateAdministrationOfTaxationChinaMember_6eff366f-83b4-43f1-8e67-c28e8dd174fe" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_country_KP_ed8d6cd5-c056-4ac2-a379-931e569321ab" xlink:href="https://xbrl.sec.gov/country/2022/country-2022.xsd#country_KP"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameDomain_9058926f-aad9-4ed9-acf1-d6aba274613e" xlink:to="loc_country_KP_ed8d6cd5-c056-4ac2-a379-931e569321ab" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/WeightedAverageSharesDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#WeightedAverageSharesDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/WeightedAverageSharesDetails" xlink:type="extended" id="i687bf08191e74706a36687e24917d03f_WeightedAverageSharesDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_65dfb07b-04ec-4068-ae8d-9d58e41d0a44" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_d74f0091-a3ec-4238-96f8-ed091201d30d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_65dfb07b-04ec-4068-ae8d-9d58e41d0a44" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_d74f0091-a3ec-4238-96f8-ed091201d30d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_07a2194c-7fee-4ca2-a072-665c77a1aae3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_65dfb07b-04ec-4068-ae8d-9d58e41d0a44" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_07a2194c-7fee-4ca2-a072-665c77a1aae3" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_ee0f63ff-8fd8-449c-8022-1c38e0e30662" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_07a2194c-7fee-4ca2-a072-665c77a1aae3" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_ee0f63ff-8fd8-449c-8022-1c38e0e30662" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_ee0f63ff-8fd8-449c-8022-1c38e0e30662_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_ee0f63ff-8fd8-449c-8022-1c38e0e30662" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_ee0f63ff-8fd8-449c-8022-1c38e0e30662_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_85cc3f79-99ae-4920-960b-39b0613f5d82" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_ee0f63ff-8fd8-449c-8022-1c38e0e30662" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_85cc3f79-99ae-4920-960b-39b0613f5d82" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_b4418d36-8dfa-4854-8536-1965be227e65" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_85cc3f79-99ae-4920-960b-39b0613f5d82" xlink:to="loc_us-gaap_EmployeeStockOptionMember_b4418d36-8dfa-4854-8536-1965be227e65" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockMember_1ab1339a-3529-49d2-9748-afcfa3d3dcb7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RestrictedStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_85cc3f79-99ae-4920-960b-39b0613f5d82" xlink:to="loc_us-gaap_RestrictedStockMember_1ab1339a-3529-49d2-9748-afcfa3d3dcb7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PerformanceSharesMember_57bd348b-7993-4823-99db-6dab38432bbf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PerformanceSharesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_85cc3f79-99ae-4920-960b-39b0613f5d82" xlink:to="loc_us-gaap_PerformanceSharesMember_57bd348b-7993-4823-99db-6dab38432bbf" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/LossfromFireDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#LossfromFireDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/LossfromFireDetails" xlink:type="extended" id="ifc3799fe22844964b5664864488203e0_LossfromFireDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnusualOrInfrequentItemLineItems_478f15fe-3035-49e3-bd98-02712dcb0a1f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_UnusualOrInfrequentItemLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromInsuranceSettlementOperatingActivities_b20c68c3-dbaf-4fc8-bacc-b5fd56639e6c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ProceedsFromInsuranceSettlementOperatingActivities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_UnusualOrInfrequentItemLineItems_478f15fe-3035-49e3-bd98-02712dcb0a1f" xlink:to="loc_us-gaap_ProceedsFromInsuranceSettlementOperatingActivities_b20c68c3-dbaf-4fc8-bacc-b5fd56639e6c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnusualOrInfrequentItemTable_03258736-2673-4827-981d-569b468c0c0b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_UnusualOrInfrequentItemTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_UnusualOrInfrequentItemLineItems_478f15fe-3035-49e3-bd98-02712dcb0a1f" xlink:to="loc_us-gaap_UnusualOrInfrequentItemTable_03258736-2673-4827-981d-569b468c0c0b" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeAxis_d41b0c97-199d-40a1-ad0b-4b1c67ee65bc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_UnusualOrInfrequentItemTable_03258736-2673-4827-981d-569b468c0c0b" xlink:to="loc_us-gaap_SubsequentEventTypeAxis_d41b0c97-199d-40a1-ad0b-4b1c67ee65bc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_d41b0c97-199d-40a1-ad0b-4b1c67ee65bc_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_d41b0c97-199d-40a1-ad0b-4b1c67ee65bc" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_d41b0c97-199d-40a1-ad0b-4b1c67ee65bc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_6218ab25-fcc2-4625-baa2-389ef06e4475" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_d41b0c97-199d-40a1-ad0b-4b1c67ee65bc" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_6218ab25-fcc2-4625-baa2-389ef06e4475" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventMember_d1a90d78-f15c-4047-ad6b-85d91b58169d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SubsequentEventTypeDomain_6218ab25-fcc2-4625-baa2-389ef06e4475" xlink:to="loc_us-gaap_SubsequentEventMember_d1a90d78-f15c-4047-ad6b-85d91b58169d" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.cognex.com/role/SubsequentEventsDetails" xlink:type="simple" xlink:href="cgnx-20221002.xsd#SubsequentEventsDetails"/>
  <link:definitionLink xlink:role="http://www.cognex.com/role/SubsequentEventsDetails" xlink:type="extended" id="i96ec7bd8839144fa82cd7ad9f5271067_SubsequentEventsDetails">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventLineItems_59ebfe5e-bf9c-4b2d-9532-1f1f99ddd1d4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareDeclared_495fbd67-e21f-4c5f-81a8-54ea31fda396" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CommonStockDividendsPerShareDeclared"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SubsequentEventLineItems_59ebfe5e-bf9c-4b2d-9532-1f1f99ddd1d4" xlink:to="loc_us-gaap_CommonStockDividendsPerShareDeclared_495fbd67-e21f-4c5f-81a8-54ea31fda396" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTable_cd72a795-ccee-487f-af48-e32e6b59cad1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_SubsequentEventLineItems_59ebfe5e-bf9c-4b2d-9532-1f1f99ddd1d4" xlink:to="loc_us-gaap_SubsequentEventTable_cd72a795-ccee-487f-af48-e32e6b59cad1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeAxis_52c178ea-9d39-40ad-9e83-12b00da56199" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_SubsequentEventTable_cd72a795-ccee-487f-af48-e32e6b59cad1" xlink:to="loc_us-gaap_SubsequentEventTypeAxis_52c178ea-9d39-40ad-9e83-12b00da56199" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_52c178ea-9d39-40ad-9e83-12b00da56199_default" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_52c178ea-9d39-40ad-9e83-12b00da56199" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_52c178ea-9d39-40ad-9e83-12b00da56199_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_efb85c8e-e72b-4fba-b22b-9451f67af6c5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_52c178ea-9d39-40ad-9e83-12b00da56199" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_efb85c8e-e72b-4fba-b22b-9451f67af6c5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventMember_f1ace798-5614-42aa-b1bc-2ac22754af20" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_SubsequentEventMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SubsequentEventTypeDomain_efb85c8e-e72b-4fba-b22b-9451f67af6c5" xlink:to="loc_us-gaap_SubsequentEventMember_f1ace798-5614-42aa-b1bc-2ac22754af20" xlink:type="arc" order="0"/>
  </link:definitionLink>
</link:linkbase>
