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

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2022 Workiva-->
<!--r:4878a129-9b80-4a38-a303-2b34e8ac6131,g:f27b0d4b-0a26-4a3f-9754-6435629f6abe-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedPeriodStartLabel" xlink:type="simple" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedPeriodStartLabel"/>
  <link:roleRef roleURI="http://www.xbrl.org/2009/role/netLabel" xlink:type="simple" xlink:href="http://www.xbrl.org/lrr/role/net-2009-12-16.xsd#netLabel"/>
  <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedNetLabel" xlink:type="simple" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedNetLabel"/>
  <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="simple" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedTerseLabel"/>
  <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedPeriodEndLabel" xlink:type="simple" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedPeriodEndLabel"/>
  <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="simple" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedLabel"/>
  <link:roleRef roleURI="http://www.xbrl.org/2009/role/negatedTotalLabel" xlink:type="simple" xlink:href="http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd#negatedTotalLabel"/>
  <link:labelLink xlink:role="http://www.xbrl.org/2003/role/link" xlink:type="extended">
    <link:label id="lab_us-gaap_RevenueCommissionersIrelandMember_34224d51-9466-494f-b08e-f3f49f42626a_terseLabel_en-US" xlink:label="lab_us-gaap_RevenueCommissionersIrelandMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue Commissioners, Ireland [Member]</link:label>
    <link:label id="lab_us-gaap_RevenueCommissionersIrelandMember_label_en-US" xlink:label="lab_us-gaap_RevenueCommissionersIrelandMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue Commissioners, Ireland [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueCommissionersIrelandMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueCommissionersIrelandMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RevenueCommissionersIrelandMember" xlink:to="lab_us-gaap_RevenueCommissionersIrelandMember" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_NameOfMajorCustomerDomain_4154e349-8a0c-4bcf-b53d-d3b8d3ca4f92_terseLabel_en-US" xlink:label="lab_srt_NameOfMajorCustomerDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer [Domain]</link:label>
    <link:label id="lab_srt_NameOfMajorCustomerDomain_label_en-US" xlink:label="lab_srt_NameOfMajorCustomerDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_NameOfMajorCustomerDomain" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_NameOfMajorCustomerDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_NameOfMajorCustomerDomain" xlink:to="lab_srt_NameOfMajorCustomerDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue_71145464-9599-4201-986d-c720dcf925f9_terseLabel_en-US" xlink:label="lab_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total intrinsic values of stock options exercised</link:label>
    <link:label id="lab_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue_label_en-US" xlink:label="lab_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Shares Based Compensation Arrangement By Shares Based Payment Award Options Exercised Intrinsic Value</link:label>
    <link:label id="lab_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue_documentation_en-US" xlink:label="lab_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Shares based compensation arrangement by shares based payment award options exercised intrinsic value.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue" xlink:href="cgnx-20211231.xsd#cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue" xlink:to="lab_cgnx_SharesBasedCompensationArrangementBySharesBasedPaymentAwardOptionsExercisedIntrinsicValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CurrentStateAndLocalTaxExpenseBenefit_13fc0940-f17d-4ecd-85bb-41b6d9f55517_terseLabel_en-US" xlink:label="lab_us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">State</link:label>
    <link:label id="lab_us-gaap_CurrentStateAndLocalTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current State and Local Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentStateAndLocalTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:to="lab_us-gaap_CurrentStateAndLocalTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_ec4268a9-e12d-4ab7-b181-3861561bdda4_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Vested (in shares)</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_2c0e1471-658e-46e6-b404-22a03b205dba_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Vested</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Vested in Period</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LeaseholdImprovementsMember_f1b99457-1f0d-42fc-9d1d-97082695b364_verboseLabel_en-US" xlink:label="lab_us-gaap_LeaseholdImprovementsMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Leasehold Improvements [Member]</link:label>
    <link:label id="lab_us-gaap_LeaseholdImprovementsMember_label_en-US" xlink:label="lab_us-gaap_LeaseholdImprovementsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Leasehold Improvements [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LeaseholdImprovementsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LeaseholdImprovementsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LeaseholdImprovementsMember" xlink:to="lab_us-gaap_LeaseholdImprovementsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_18553c01-56bf-46ec-90f9-b35127a67a1c_terseLabel_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current investments, amortized cost of $137,124 and $102,258 in 2021 and 2020, respectively, allowance for credit losses of $0 in 2021 and 2020</link:label>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent_label_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent" xlink:to="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PreferredStockSharesOutstanding_6c469525-0d4e-4cb7-8110-b7b71a3c8de0_terseLabel_en-US" xlink:label="lab_us-gaap_PreferredStockSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred stock, shares outstanding</link:label>
    <link:label id="lab_us-gaap_PreferredStockSharesOutstanding_label_en-US" xlink:label="lab_us-gaap_PreferredStockSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred Stock, Shares Outstanding</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockSharesOutstanding" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockSharesOutstanding"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PreferredStockSharesOutstanding" xlink:to="lab_us-gaap_PreferredStockSharesOutstanding" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseAxis_193a8444-a58d-42eb-a548-3641cdf3bc5c_terseLabel_en-US" xlink:label="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property Subject to or Available for Operating Lease [Axis]</link:label>
    <link:label id="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseAxis_label_en-US" xlink:label="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property Subject to or Available for Operating Lease [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertySubjectToOrAvailableForOperatingLeaseAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseAxis" xlink:to="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GoodwillDisclosureTextBlock_4ad86d0a-78f2-4df1-ba22-958fd7ad54dd_terseLabel_en-US" xlink:label="lab_us-gaap_GoodwillDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill</link:label>
    <link:label id="lab_us-gaap_GoodwillDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_GoodwillDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GoodwillDisclosureTextBlock" xlink:to="lab_us-gaap_GoodwillDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherIntangibleAssetsMember_8d2c4c5c-e542-4ac9-8890-e37e756367ae_terseLabel_en-US" xlink:label="lab_us-gaap_OtherIntangibleAssetsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Non-compete Agreements [Member]</link:label>
    <link:label id="lab_us-gaap_OtherIntangibleAssetsMember_label_en-US" xlink:label="lab_us-gaap_OtherIntangibleAssetsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Intangible Assets [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherIntangibleAssetsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherIntangibleAssetsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherIntangibleAssetsMember" xlink:to="lab_us-gaap_OtherIntangibleAssetsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset_17c59a8b-87ed-4272-806d-98f8c00b80dd_terseLabel_en-US" xlink:label="lab_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Carrying value of lease assets</link:label>
    <link:label id="lab_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset_label_en-US" xlink:label="lab_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Right-Of-Use Asset, Carrying Value Of Impaired Asset</link:label>
    <link:label id="lab_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset_documentation_en-US" xlink:label="lab_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Right-Of-Use Asset, Carrying Value Of Impaired Asset</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset" xlink:href="cgnx-20211231.xsd#cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset" xlink:to="lab_cgnx_OperatingLeaseRightOfUseAssetCarryingValueOfImpairedAsset" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInContractWithCustomerAsset_c6b7c517-6056-488e-bf18-f0d2a26ba809_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInContractWithCustomerAsset" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unbilled revenue</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInContractWithCustomerAsset_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInContractWithCustomerAsset" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Contract with Customer, Asset</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInContractWithCustomerAsset" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInContractWithCustomerAsset"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInContractWithCustomerAsset" xlink:to="lab_us-gaap_IncreaseDecreaseInContractWithCustomerAsset" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeLiabilities_81f97249-beff-4e20-b853-93fce3f7182d_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeLiabilities" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net amount of liabilities presented</link:label>
    <link:label id="lab_us-gaap_DerivativeLiabilities_40b21f4c-e393-4d56-b5b9-89e67873d667_totalLabel_en-US" xlink:label="lab_us-gaap_DerivativeLiabilities" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net amount of liabilities presented</link:label>
    <link:label id="lab_us-gaap_DerivativeLiabilities_label_en-US" xlink:label="lab_us-gaap_DerivativeLiabilities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Liability</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLiabilities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeLiabilities" xlink:to="lab_us-gaap_DerivativeLiabilities" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DividendsCommonStockCash_ef0aebd6-688f-4ee3-be25-25e6140c7d09_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_DividendsCommonStockCash" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payment of dividends ($0.245 per common share)</link:label>
    <link:label id="lab_us-gaap_DividendsCommonStockCash_label_en-US" xlink:label="lab_us-gaap_DividendsCommonStockCash" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Dividends, Common Stock, Cash</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockCash" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DividendsCommonStockCash"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DividendsCommonStockCash" xlink:to="lab_us-gaap_DividendsCommonStockCash" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_SecurityExchangeName_f7542994-c9b4-4992-86a9-53ac30f51159_terseLabel_en-US" xlink:label="lab_dei_SecurityExchangeName" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Security Exchange Name</link:label>
    <link:label id="lab_dei_SecurityExchangeName_label_en-US" xlink:label="lab_dei_SecurityExchangeName" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Security Exchange Name</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_SecurityExchangeName" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_SecurityExchangeName"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_SecurityExchangeName" xlink:to="lab_dei_SecurityExchangeName" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSaleRecognizedInEarnings_704c2c1c-0342-4f7c-ae95-0e95c014fd99_terseLabel_en-US" xlink:label="lab_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSaleRecognizedInEarnings" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Credit losses</link:label>
    <link:label id="lab_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSaleRecognizedInEarnings_label_en-US" xlink:label="lab_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSaleRecognizedInEarnings" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other-than-temporary Impairment Loss, Debt Securities, Available-for-sale, Recognized in Earnings</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSaleRecognizedInEarnings" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSaleRecognizedInEarnings"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSaleRecognizedInEarnings" xlink:to="lab_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSaleRecognizedInEarnings" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax_d40aaa86-1a5d-4fc7-ae23-7b093a97a702_terseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax benefit of foreign currency translation adjustment</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Comprehensive Income (Loss), Foreign Currency Translation Adjustment, Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax" xlink:to="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_0afabfd8-60e8-4c55-88e4-3ced54003dd3_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Forfeited or expired, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Forfeitures, Weighted Average Grant Date Fair Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ContractWithCustomerAssetAndLiabilityTableTextBlock_d542891f-c0bf-43b1-b253-26b2f85699b9_terseLabel_en-US" xlink:label="lab_us-gaap_ContractWithCustomerAssetAndLiabilityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract with Customer, Liability</link:label>
    <link:label id="lab_us-gaap_ContractWithCustomerAssetAndLiabilityTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ContractWithCustomerAssetAndLiabilityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract with Customer, Contract Asset, Contract Liability, and Receivable [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ContractWithCustomerAssetAndLiabilityTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ContractWithCustomerAssetAndLiabilityTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ContractWithCustomerAssetAndLiabilityTableTextBlock" xlink:to="lab_us-gaap_ContractWithCustomerAssetAndLiabilityTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities_d749062d-1843-40cd-9c27-d8e6948ef5b3_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payment of Chiaro contingent consideration</link:label>
    <link:label id="lab_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities_label_en-US" xlink:label="lab_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payment for Contingent Consideration Liability, Financing Activities</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities" xlink:to="lab_us-gaap_PaymentForContingentConsiderationLiabilityFinancingActivities" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount_76019d4a-02f4-4be6-8af2-a11f7c5b01c3_terseLabel_en-US" xlink:label="lab_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Compensation expense capitalized</link:label>
    <link:label id="lab_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount_label_en-US" xlink:label="lab_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Employee Service Share Based Compensation Recognized Period Costs Capitalized Amount</link:label>
    <link:label id="lab_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount_documentation_en-US" xlink:label="lab_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Employee service share based compensation recognized period costs capitalized amount.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" xlink:href="cgnx-20211231.xsd#cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" xlink:to="lab_cgnx_EmployeeServiceShareBasedCompensationRecognizedPeriodCostsCapitalizedAmount" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1_f1b31376-7eb9-46c7-afc4-c0f54e34b0df_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease, weighted average remaining lease term (years)</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Weighted Average Remaining Lease Term</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:to="lab_us-gaap_OperatingLeaseWeightedAverageRemainingLeaseTerm1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ForeignCurrencyTransactionsAndTranslationsPolicyTextBlock_4c10f17e-b61a-4da4-9b00-80cf4f6ec738_terseLabel_en-US" xlink:label="lab_us-gaap_ForeignCurrencyTransactionsAndTranslationsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Currency</link:label>
    <link:label id="lab_us-gaap_ForeignCurrencyTransactionsAndTranslationsPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_ForeignCurrencyTransactionsAndTranslationsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Currency Transactions and Translations Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyTransactionsAndTranslationsPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignCurrencyTransactionsAndTranslationsPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ForeignCurrencyTransactionsAndTranslationsPolicyTextBlock" xlink:to="lab_us-gaap_ForeignCurrencyTransactionsAndTranslationsPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_29d5be16-e1bc-4bbd-8359-bd5ec73e70ac_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Share-based Compensation Arrangements by Share-based Payment Award [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Share-based Compensation Arrangements by Share-based Payment Award [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:to="lab_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativesPolicyTextBlock_281a4718-1838-4bfc-b34e-9d82f46c4a66_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativesPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments</link:label>
    <link:label id="lab_us-gaap_DerivativesPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_DerivativesPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivatives, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativesPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativesPolicyTextBlock" xlink:to="lab_us-gaap_DerivativesPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_7755edad-e01c-4fea-a2c4-8a62a10b006b_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Shares available for grant under stock option plans</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Number of Shares Available for Grant</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ContractTerminationMember_99231d38-c986-4bbc-b674-c866fa237f13_terseLabel_en-US" xlink:label="lab_us-gaap_ContractTerminationMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract Termination [Member]</link:label>
    <link:label id="lab_us-gaap_ContractTerminationMember_label_en-US" xlink:label="lab_us-gaap_ContractTerminationMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract Termination [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ContractTerminationMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ContractTerminationMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ContractTerminationMember" xlink:to="lab_us-gaap_ContractTerminationMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_e706d559-9fb6-4af3-b36a-959705dce8b1_totalLabel_en-US" xlink:label="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net change in cash and cash equivalents</link:label>
    <link:label id="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_label_en-US" xlink:label="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash, Cash Equivalents, Restricted Cash and Restricted Cash Equivalents, Period Increase (Decrease), Including Exchange Rate Effect</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:to="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_5133c975-7b74-4ec3-a299-107d28d88bc3_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Expected volatility</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Expected Volatility Rate</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseLeaseIncome_f99b8539-7ac6-4bd9-b3be-0d1519138e6b_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseLeaseIncome" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease income</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseLeaseIncome_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseLeaseIncome" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Lease Income</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLeaseIncome" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLeaseIncome"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseLeaseIncome" xlink:to="lab_us-gaap_OperatingLeaseLeaseIncome" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_47e627fc-b207-49d7-8977-45123790c3ab_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation, Calculation [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_label_en-US" xlink:label="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation, Calculation [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward" xlink:to="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable_5642c390-b762-4e47-9cf8-d317a3da1f64_terseLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued income taxes</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Income Taxes Payable</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable" xlink:to="lab_us-gaap_IncreaseDecreaseInAccruedIncomeTaxesPayable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_834de29d-7454-4adf-9a9e-90663a4f9d26_terseLabel_en-US" xlink:label="lab_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Economic hedge forward contracts</link:label>
    <link:label id="lab_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure_label_en-US" xlink:label="lab_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Currency Contracts, Liability, Fair Value Disclosure</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure" xlink:to="lab_us-gaap_ForeignCurrencyContractsLiabilityFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DeferredTaxAssetsOtherNoncurrent_f107f9c5-2d19-491b-92ba-af3d3bf813bf_terseLabel_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsOtherNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other</link:label>
    <link:label id="lab_cgnx_DeferredTaxAssetsOtherNoncurrent_label_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsOtherNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets Other Noncurrent</link:label>
    <link:label id="lab_cgnx_DeferredTaxAssetsOtherNoncurrent_documentation_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsOtherNoncurrent" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred tax assets other non current.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxAssetsOtherNoncurrent" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxAssetsOtherNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DeferredTaxAssetsOtherNoncurrent" xlink:to="lab_cgnx_DeferredTaxAssetsOtherNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GainLossOnDispositionOfAssets1_7e385257-fe5c-4bea-9717-91510bee1700_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_GainLossOnDispositionOfAssets1" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Loss on disposition of property, plant and equipment</link:label>
    <link:label id="lab_us-gaap_GainLossOnDispositionOfAssets1_label_en-US" xlink:label="lab_us-gaap_GainLossOnDispositionOfAssets1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gain (Loss) on Disposition of Assets</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnDispositionOfAssets1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GainLossOnDispositionOfAssets1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GainLossOnDispositionOfAssets1" xlink:to="lab_us-gaap_GainLossOnDispositionOfAssets1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_TaxCreditCarryforwardLineItems_38eb8d8d-4e79-4506-a7c3-78f1fe997cfa_terseLabel_en-US" xlink:label="lab_us-gaap_TaxCreditCarryforwardLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax Credit Carryforward [Line Items]</link:label>
    <link:label id="lab_us-gaap_TaxCreditCarryforwardLineItems_label_en-US" xlink:label="lab_us-gaap_TaxCreditCarryforwardLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax Credit Carryforward [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TaxCreditCarryforwardLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TaxCreditCarryforwardLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_TaxCreditCarryforwardLineItems" xlink:to="lab_us-gaap_TaxCreditCarryforwardLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense_4088141a-15ce-43c4-9bf8-aa1bcb06977b_terseLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Charged&#160;to Costs and Expenses</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense_label_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves, Additions, Charge to Cost and Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:to="lab_us-gaap_ValuationAllowancesAndReservesChargedToCostAndExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccruedBonusesCurrent_ffccd714-b30e-4c98-b701-55d98587c9c6_terseLabel_en-US" xlink:label="lab_us-gaap_AccruedBonusesCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Incentive compensation</link:label>
    <link:label id="lab_us-gaap_AccruedBonusesCurrent_label_en-US" xlink:label="lab_us-gaap_AccruedBonusesCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Bonuses, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedBonusesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedBonusesCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccruedBonusesCurrent" xlink:to="lab_us-gaap_AccruedBonusesCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SubsequentEventTypeDomain_02de7063-68e4-47dc-9276-886feef081d6_terseLabel_en-US" xlink:label="lab_us-gaap_SubsequentEventTypeDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event Type [Domain]</link:label>
    <link:label id="lab_us-gaap_SubsequentEventTypeDomain_label_en-US" xlink:label="lab_us-gaap_SubsequentEventTypeDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event Type [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SubsequentEventTypeDomain" xlink:to="lab_us-gaap_SubsequentEventTypeDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeLeaseDescriptionLineItems_2519737b-c350-42dc-8723-e805a313b0f0_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeLeaseDescriptionLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Lease, Description [Line Items]</link:label>
    <link:label id="lab_us-gaap_LesseeLeaseDescriptionLineItems_label_en-US" xlink:label="lab_us-gaap_LesseeLeaseDescriptionLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Lease, Description [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeLeaseDescriptionLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems" xlink:to="lab_us-gaap_LesseeLeaseDescriptionLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RevenueRecognitionAndDeferredRevenueAbstract_label_en-US" xlink:label="lab_us-gaap_RevenueRecognitionAndDeferredRevenueAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue Recognition and Deferred Revenue [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueRecognitionAndDeferredRevenueAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueRecognitionAndDeferredRevenueAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RevenueRecognitionAndDeferredRevenueAbstract" xlink:to="lab_us-gaap_RevenueRecognitionAndDeferredRevenueAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AmortizationOfIntangibleAssets_1fe2b984-3e9c-485c-b59a-6c71b1823098_terseLabel_en-US" xlink:label="lab_us-gaap_AmortizationOfIntangibleAssets" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Amortization of intangible assets</link:label>
    <link:label id="lab_us-gaap_AmortizationOfIntangibleAssets_label_en-US" xlink:label="lab_us-gaap_AmortizationOfIntangibleAssets" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Amortization of Intangible Assets</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfIntangibleAssets" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AmortizationOfIntangibleAssets"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AmortizationOfIntangibleAssets" xlink:to="lab_us-gaap_AmortizationOfIntangibleAssets" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfRestructuringReserveByTypeOfCostTextBlock_a7a36baa-402f-4014-b6b2-4caf7a4d5a43_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfRestructuringReserveByTypeOfCostTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Restructuring Reserve by Type of Cost</link:label>
    <link:label id="lab_us-gaap_ScheduleOfRestructuringReserveByTypeOfCostTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfRestructuringReserveByTypeOfCostTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Restructuring Reserve by Type of Cost [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringReserveByTypeOfCostTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfRestructuringReserveByTypeOfCostTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfRestructuringReserveByTypeOfCostTextBlock" xlink:to="lab_us-gaap_ScheduleOfRestructuringReserveByTypeOfCostTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill_33d39e4a-9960-4541-8497-09d4e510b139_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible assets</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combination, Recognized Identifiable Assets Acquired and Liabilities Assumed, Intangible Assets, Other than Goodwill</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill" xlink:to="lab_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedIntangibleAssetsOtherThanGoodwill" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_5c8bfa2c-de4a-41a7-8017-01611bbec6ca_terseLabel_en-US" xlink:label="lab_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Repurchase Program, Remaining Authorized Repurchase Amount</link:label>
    <link:label id="lab_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1_label_en-US" xlink:label="lab_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Repurchase Program, Remaining Authorized Repurchase Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1" xlink:to="lab_us-gaap_StockRepurchaseProgramRemainingAuthorizedRepurchaseAmount1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions_4476a9d8-5be4-4f22-99ee-7d58f8bf42f5_terseLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross amounts of increases in unrecognized tax benefits as a result of tax positions taken in prior periods</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions_label_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Increase Resulting from Prior Period Tax Positions</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions" xlink:to="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromPriorPeriodTaxPositions" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsLiabilitiesNet_d629b86d-4b7d-4e6e-8fc4-5cdfa0807534_totalLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsLiabilitiesNet" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Net, Noncurrent</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsLiabilitiesNet_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsLiabilitiesNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsLiabilitiesNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet" xlink:to="lab_us-gaap_DeferredTaxAssetsLiabilitiesNet" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_d4071663-e855-4d9b-a38e-8d17d7d52cac_terseLabel_en-US" xlink:label="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock options to purchase anti-dilutive common stock</link:label>
    <link:label id="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_label_en-US" xlink:label="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Antidilutive Securities Excluded from Computation of Earnings Per Share, Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:to="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent_48be9ab2-07b7-4135-abb9-94f29450e968_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease, weighted average discount rate (percent)</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Weighted Average Discount Rate, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:to="lab_us-gaap_OperatingLeaseWeightedAverageDiscountRatePercent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfInventoryCurrentTableTextBlock_5f182e29-555a-40f0-b3f4-94452f655a5a_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfInventoryCurrentTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventories</link:label>
    <link:label id="lab_us-gaap_ScheduleOfInventoryCurrentTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfInventoryCurrentTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Inventory, Current [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfInventoryCurrentTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfInventoryCurrentTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfInventoryCurrentTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfInventoryCurrentTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ResearchAndDevelopmentExpenseMember_67e500d0-587a-49e3-8454-8b23094280cc_terseLabel_en-US" xlink:label="lab_us-gaap_ResearchAndDevelopmentExpenseMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Research, development, and engineering expenses</link:label>
    <link:label id="lab_us-gaap_ResearchAndDevelopmentExpenseMember_label_en-US" xlink:label="lab_us-gaap_ResearchAndDevelopmentExpenseMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Research and Development Expense [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpenseMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ResearchAndDevelopmentExpenseMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ResearchAndDevelopmentExpenseMember" xlink:to="lab_us-gaap_ResearchAndDevelopmentExpenseMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SubsequentEventsAbstract_84feb999-639c-4084-a9e7-52f4b7044db9_terseLabel_en-US" xlink:label="lab_us-gaap_SubsequentEventsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Events [Abstract]</link:label>
    <link:label id="lab_us-gaap_SubsequentEventsAbstract_label_en-US" xlink:label="lab_us-gaap_SubsequentEventsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Events [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SubsequentEventsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SubsequentEventsAbstract" xlink:to="lab_us-gaap_SubsequentEventsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessAcquisitionAxis_e8d197d8-c400-4164-b181-eb877a992a24_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessAcquisitionAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Acquisition [Axis]</link:label>
    <link:label id="lab_us-gaap_BusinessAcquisitionAxis_label_en-US" xlink:label="lab_us-gaap_BusinessAcquisitionAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Acquisition [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessAcquisitionAxis" xlink:to="lab_us-gaap_BusinessAcquisitionAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxAuthorityNameAxis_e5601369-90f9-46e6-976e-3cfae8460b6c_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxAuthorityNameAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Authority, Name [Axis]</link:label>
    <link:label id="lab_us-gaap_IncomeTaxAuthorityNameAxis_label_en-US" xlink:label="lab_us-gaap_IncomeTaxAuthorityNameAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Authority, Name [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityNameAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxAuthorityNameAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameAxis" xlink:to="lab_us-gaap_IncomeTaxAuthorityNameAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_4d5dfe5c-28aa-4f2b-b888-e991d5fdce1e_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Equity Award [Domain]</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Award Type [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_MovementInStandardProductWarrantyAccrualRollForward_c4777a8c-a0a9-4864-893f-0465e4665bba_terseLabel_en-US" xlink:label="lab_us-gaap_MovementInStandardProductWarrantyAccrualRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Movement in Standard Product Warranty Accrual [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_MovementInStandardProductWarrantyAccrualRollForward_label_en-US" xlink:label="lab_us-gaap_MovementInStandardProductWarrantyAccrualRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Movement in Standard Product Warranty Accrual [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MovementInStandardProductWarrantyAccrualRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_MovementInStandardProductWarrantyAccrualRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_MovementInStandardProductWarrantyAccrualRollForward" xlink:to="lab_us-gaap_MovementInStandardProductWarrantyAccrualRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_LocalPhoneNumber_dcf7ed84-c75f-44cf-beef-3091e3d48c73_terseLabel_en-US" xlink:label="lab_dei_LocalPhoneNumber" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Local Phone Number</link:label>
    <link:label id="lab_dei_LocalPhoneNumber_label_en-US" xlink:label="lab_dei_LocalPhoneNumber" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Local Phone Number</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_LocalPhoneNumber" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_LocalPhoneNumber"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_LocalPhoneNumber" xlink:to="lab_dei_LocalPhoneNumber" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GainLossOnSaleOfInvestments_28444a26-cb34-4010-b42e-a63d7827b4b0_negatedLabel_en-US" xlink:label="lab_us-gaap_GainLossOnSaleOfInvestments" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Realized gain on sale of investments</link:label>
    <link:label id="lab_us-gaap_GainLossOnSaleOfInvestments_label_en-US" xlink:label="lab_us-gaap_GainLossOnSaleOfInvestments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gain (Loss) on Sale of Investments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfInvestments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GainLossOnSaleOfInvestments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GainLossOnSaleOfInvestments" xlink:to="lab_us-gaap_GainLossOnSaleOfInvestments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesReconciliationTableTextBlock_18beda13-3931-42e0-8095-bdef104e159c_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesReconciliationTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Summary of Available-for-Sale Investments</link:label>
    <link:label id="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesReconciliationTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesReconciliationTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Available-for-sale Securities Reconciliation [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesReconciliationTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesReconciliationTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesReconciliationTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesReconciliationTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber_b926fabf-888c-40d7-a71f-ce3d66b25cbf_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Exercisable, Shares</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Exercisable, Number</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure_33758a77-d28a-4853-a99b-b20bcc2f6c1b_terseLabel_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible asset in connection with change in tax structure</link:label>
    <link:label id="lab_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure_label_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Intangible Asset, Change in Tax Structure</link:label>
    <link:label id="lab_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure_documentation_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Intangible Asset, Change in Tax Structure</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure" xlink:to="lab_cgnx_DeferredTaxAssetsIntangibleAssetChangeinTaxStructure" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InvestmentsClassifiedByContractualMaturityDateTableTextBlock_be5932fb-a865-4550-bd9a-f74d4ae02327_terseLabel_en-US" xlink:label="lab_us-gaap_InvestmentsClassifiedByContractualMaturityDateTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Maturity Dates of Available-for-Sale Investments</link:label>
    <link:label id="lab_us-gaap_InvestmentsClassifiedByContractualMaturityDateTableTextBlock_label_en-US" xlink:label="lab_us-gaap_InvestmentsClassifiedByContractualMaturityDateTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investments Classified by Contractual Maturity Date [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentsClassifiedByContractualMaturityDateTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentsClassifiedByContractualMaturityDateTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InvestmentsClassifiedByContractualMaturityDateTableTextBlock" xlink:to="lab_us-gaap_InvestmentsClassifiedByContractualMaturityDateTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_CurrencyAxis_3803110c-826f-4257-a526-242ca7989203_terseLabel_en-US" xlink:label="lab_srt_CurrencyAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Currency [Axis]</link:label>
    <link:label id="lab_srt_CurrencyAxis_label_en-US" xlink:label="lab_srt_CurrencyAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Currency [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_CurrencyAxis" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_CurrencyAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_CurrencyAxis" xlink:to="lab_srt_CurrencyAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_MoneyMarketInstrumentsFairValueDisclosure_c05110c3-5089-4afe-a84f-54035f85cd54_terseLabel_en-US" xlink:label="lab_cgnx_MoneyMarketInstrumentsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Money market instruments</link:label>
    <link:label id="lab_cgnx_MoneyMarketInstrumentsFairValueDisclosure_label_en-US" xlink:label="lab_cgnx_MoneyMarketInstrumentsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Money Market Instruments Fair Value Disclosure</link:label>
    <link:label id="lab_cgnx_MoneyMarketInstrumentsFairValueDisclosure_documentation_en-US" xlink:label="lab_cgnx_MoneyMarketInstrumentsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Money market instruments fair value disclosure.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_MoneyMarketInstrumentsFairValueDisclosure" xlink:href="cgnx-20211231.xsd#cgnx_MoneyMarketInstrumentsFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_MoneyMarketInstrumentsFairValueDisclosure" xlink:to="lab_cgnx_MoneyMarketInstrumentsFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RetainedEarningsMember_7dbc5695-66d5-42aa-ad50-8e92fd20a585_terseLabel_en-US" xlink:label="lab_us-gaap_RetainedEarningsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retained Earnings [Member]</link:label>
    <link:label id="lab_us-gaap_RetainedEarningsMember_label_en-US" xlink:label="lab_us-gaap_RetainedEarningsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retained Earnings [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetainedEarningsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RetainedEarningsMember" xlink:to="lab_us-gaap_RetainedEarningsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment_ab6e7f53-4e4e-4c77-a947-cd99e05fff2c_terseLabel_en-US" xlink:label="lab_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign exchange rate changes</link:label>
    <link:label id="lab_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment_label_en-US" xlink:label="lab_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable, Allowance For Credit Loss, Foreign Exchange Rate Adjustment</link:label>
    <link:label id="lab_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment_documentation_en-US" xlink:label="lab_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable, Allowance For Credit Loss, Foreign Exchange Rate Adjustment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" xlink:href="cgnx-20211231.xsd#cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" xlink:to="lab_cgnx_AccountsReceivableAllowanceForCreditLossForeignExchangeRateAdjustment" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_f5baad2d-edb3-404d-a2cc-e508d47b9bb3_terseLabel_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">1-2 Years</link:label>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_label_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available For Sale Securities Debt Maturities After One Year Before Two Years Fair Value</link:label>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue_documentation_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">This item represents the fair value of debt securities which are expected to mature within one year of the balance sheet date and which are categorized neither as held-to-maturity nor trading securities.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" xlink:href="cgnx-20211231.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" xlink:to="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterOneYearBeforeTwoYearsFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_39314c19-c428-4e80-bf94-68efeeb32825_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Antidilutive Securities Excluded from Computation of Earnings Per Share [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Antidilutive Securities Excluded from Computation of Earnings Per Share [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:to="lab_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInAccountsReceivable_48eecbfe-6d0c-4ec0-96d9-60fa0cdc59f2_negatedLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts receivable</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInAccountsReceivable_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Accounts Receivable</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsReceivable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:to="lab_us-gaap_IncreaseDecreaseInAccountsReceivable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DividendsPayableDateOfRecordDayMonthAndYear_d92c33af-7435-444f-90d4-20c7a4a5b59a_terseLabel_en-US" xlink:label="lab_us-gaap_DividendsPayableDateOfRecordDayMonthAndYear" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Dividends Payable, Date of Record</link:label>
    <link:label id="lab_us-gaap_DividendsPayableDateOfRecordDayMonthAndYear_label_en-US" xlink:label="lab_us-gaap_DividendsPayableDateOfRecordDayMonthAndYear" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Dividends Payable, Date of Record</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsPayableDateOfRecordDayMonthAndYear" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DividendsPayableDateOfRecordDayMonthAndYear"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DividendsPayableDateOfRecordDayMonthAndYear" xlink:to="lab_us-gaap_DividendsPayableDateOfRecordDayMonthAndYear" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureAbstract_b71e6f8d-9633-4bde-baad-c75846c29de8_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments and Hedging Activities Disclosure [Abstract]</link:label>
    <link:label id="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureAbstract_label_en-US" xlink:label="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments and Hedging Activities Disclosure [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureAbstract" xlink:to="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentLineItems_59d91aef-81dc-4aa4-b084-bb5fce92e9db_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment [Line Items]</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentLineItems_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityWellKnownSeasonedIssuer_fc58197f-2373-4e09-b988-de739b398684_terseLabel_en-US" xlink:label="lab_dei_EntityWellKnownSeasonedIssuer" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Well-known Seasoned Issuer</link:label>
    <link:label id="lab_dei_EntityWellKnownSeasonedIssuer_label_en-US" xlink:label="lab_dei_EntityWellKnownSeasonedIssuer" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Well-known Seasoned Issuer</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityWellKnownSeasonedIssuer" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityWellKnownSeasonedIssuer"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityWellKnownSeasonedIssuer" xlink:to="lab_dei_EntityWellKnownSeasonedIssuer" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable_17cce6ec-f8ad-40fc-be49-260977e491ff_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation [Table]</link:label>
    <link:label id="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable_label_en-US" xlink:label="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable" xlink:to="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_Customer2Member_2f2c1022-b385-492a-9563-dd9460e1f5f9_terseLabel_en-US" xlink:label="lab_cgnx_Customer2Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer 2 [Member]</link:label>
    <link:label id="lab_cgnx_Customer2Member_label_en-US" xlink:label="lab_cgnx_Customer2Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer 2 [Member]</link:label>
    <link:label id="lab_cgnx_Customer2Member_documentation_en-US" xlink:label="lab_cgnx_Customer2Member" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer 2</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_Customer2Member" xlink:href="cgnx-20211231.xsd#cgnx_Customer2Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_Customer2Member" xlink:to="lab_cgnx_Customer2Member" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems_f27b8cee-2efc-40a6-9846-1b1db62ed456_terseLabel_en-US" xlink:label="lab_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Employee Service Share-based Compensation, Allocation of Recognized Period Costs [Line Items]</link:label>
    <link:label id="lab_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems_label_en-US" xlink:label="lab_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Expensed and Capitalized, Amount [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems" xlink:to="lab_us-gaap_EmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EarningsPerShareBasic_7c96d5d2-473e-45c3-b3ff-0ff78af6546c_terseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerShareBasic" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net income (in dollars per share)</link:label>
    <link:label id="lab_us-gaap_EarningsPerShareBasic_a4a9a00a-a719-43e0-970c-975ca7834ee3_verboseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerShareBasic" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Basic net income (loss) per share (in dollars per share)</link:label>
    <link:label id="lab_us-gaap_EarningsPerShareBasic_label_en-US" xlink:label="lab_us-gaap_EarningsPerShareBasic" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Earnings Per Share, Basic</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EarningsPerShareBasic" xlink:to="lab_us-gaap_EarningsPerShareBasic" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseExpense_a29e0b62-fdbf-485f-8ff8-bc9c28a260a0_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease expense</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseExpense_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseExpense" xlink:to="lab_us-gaap_OperatingLeaseExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RevenueFromContractWithCustomerTextBlock_b7c56144-bf2f-4557-9468-05004cacb8d2_terseLabel_en-US" xlink:label="lab_us-gaap_RevenueFromContractWithCustomerTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue Recognition</link:label>
    <link:label id="lab_us-gaap_RevenueFromContractWithCustomerTextBlock_label_en-US" xlink:label="lab_us-gaap_RevenueFromContractWithCustomerTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue from Contract with Customer [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueFromContractWithCustomerTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RevenueFromContractWithCustomerTextBlock" xlink:to="lab_us-gaap_RevenueFromContractWithCustomerTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_43557120-782b-4102-8ddf-f52334180ba8_periodStartLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nonvested beginning balance outstanding</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_c42efcca-9217-4632-9a7c-fa280df4517f_periodEndLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nonvested ending balance outstanding</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Nonvested, Number</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_d15d270f-2510-4915-a3bf-afdaecdd8086_periodStartLabel_en-US" xlink:label="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning balance</link:label>
    <link:label id="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_92389ce8-ce1d-4066-abba-15f4b9a65011_periodEndLabel_en-US" xlink:label="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Ending balance</link:label>
    <link:label id="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_f4db2b55-0e10-4ea1-b50d-44ecf9fd415b_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair value</link:label>
    <link:label id="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_label_en-US" xlink:label="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Measurement with Unobservable Inputs Reconciliation, Recurring Basis, Liability Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue" xlink:to="lab_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EarningsPerShareDilutedAbstract_3823db41-1c10-4df2-80f3-776add646993_terseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerShareDilutedAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Diluted earnings per weighted-average common and common-equivalent share (1):</link:label>
    <link:label id="lab_us-gaap_EarningsPerShareDilutedAbstract_label_en-US" xlink:label="lab_us-gaap_EarningsPerShareDilutedAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Earnings Per Share, Diluted [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDilutedAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareDilutedAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EarningsPerShareDilutedAbstract" xlink:to="lab_us-gaap_EarningsPerShareDilutedAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock_446ad9d0-eb2d-48fc-a14e-bfbc0b984566_terseLabel_en-US" xlink:label="lab_srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule II - Valuation and Qualifying Accounts</link:label>
    <link:label id="lab_srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock_label_en-US" xlink:label="lab_srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Schedule of Valuation and Qualifying Accounts Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" xlink:to="lab_srt_ScheduleOfValuationAndQualifyingAccountsDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeFairValueOfDerivativeAsset_6515f2e7-9e90-4d44-aa34-1a75fe28066f_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeFairValueOfDerivativeAsset" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Asset, Fair Value, Gross Asset</link:label>
    <link:label id="lab_us-gaap_DerivativeFairValueOfDerivativeAsset_label_en-US" xlink:label="lab_us-gaap_DerivativeFairValueOfDerivativeAsset" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Asset, Fair Value, Gross Asset</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeAsset" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeFairValueOfDerivativeAsset"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeFairValueOfDerivativeAsset" xlink:to="lab_us-gaap_DerivativeFairValueOfDerivativeAsset" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueLow_2ac7b66c-1557-49cf-a855-274e331080a9_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueLow" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contingent consideration, low range</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueLow_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueLow" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combination, Contingent Consideration Arrangements, Range of Outcomes, Value, Low</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueLow" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueLow"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueLow" xlink:to="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueLow" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsByGeographicalAreasTableTextBlock_2280cf49-fb6d-47c0-97e4-3ce27b6bb9c0_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsByGeographicalAreasTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Revenue from External Customers and Long-Lived Assets, by Geographical Areas</link:label>
    <link:label id="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsByGeographicalAreasTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsByGeographicalAreasTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Revenue from External Customers and Long-Lived Assets, by Geographical Areas [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsByGeographicalAreasTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsByGeographicalAreasTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsByGeographicalAreasTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsByGeographicalAreasTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityVoluntaryFilers_d05c3eee-3c6e-4bab-a1e3-b5cd2caf5782_terseLabel_en-US" xlink:label="lab_dei_EntityVoluntaryFilers" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Voluntary Filers</link:label>
    <link:label id="lab_dei_EntityVoluntaryFilers_label_en-US" xlink:label="lab_dei_EntityVoluntaryFilers" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Voluntary Filers</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityVoluntaryFilers" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityVoluntaryFilers"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityVoluntaryFilers" xlink:to="lab_dei_EntityVoluntaryFilers" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesAdjustments_50c090d4-1a48-47de-ae5e-981979b432b2_terseLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesAdjustments" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesAdjustments_label_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesAdjustments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves, Increase (Decrease) Adjustment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesAdjustments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ValuationAllowancesAndReservesAdjustments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesAdjustments" xlink:to="lab_us-gaap_ValuationAllowancesAndReservesAdjustments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringReserveAccrualAdjustment1_48099581-198a-4377-a8c8-6ecaea2afcba_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringReserveAccrualAdjustment1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring adjustments</link:label>
    <link:label id="lab_us-gaap_RestructuringReserveAccrualAdjustment1_label_en-US" xlink:label="lab_us-gaap_RestructuringReserveAccrualAdjustment1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Reserve, Accrual Adjustment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringReserveAccrualAdjustment1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringReserveAccrualAdjustment1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringReserveAccrualAdjustment1" xlink:to="lab_us-gaap_RestructuringReserveAccrualAdjustment1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AssetsFairValueDisclosureAbstract_98171a09-dd98-41e1-9b5a-690a9a25ddc8_terseLabel_en-US" xlink:label="lab_us-gaap_AssetsFairValueDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Assets:</link:label>
    <link:label id="lab_us-gaap_AssetsFairValueDisclosureAbstract_label_en-US" xlink:label="lab_us-gaap_AssetsFairValueDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Assets, Fair Value Disclosure [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsFairValueDisclosureAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsFairValueDisclosureAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AssetsFairValueDisclosureAbstract" xlink:to="lab_us-gaap_AssetsFairValueDisclosureAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueInputsLevel1Member_75f35a36-10b6-4037-a8e4-47b260379fb5_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueInputsLevel1Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Quoted&#160;Prices&#160;in Active Markets for Identical Assets (Level&#160;1)</link:label>
    <link:label id="lab_us-gaap_FairValueInputsLevel1Member_label_en-US" xlink:label="lab_us-gaap_FairValueInputsLevel1Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Inputs, Level 1 [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueInputsLevel1Member" xlink:to="lab_us-gaap_FairValueInputsLevel1Member" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1411bd43-94a6-4c34-9968-ef92991d5ec3_terseLabel_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash flows from investing activities:</link:label>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_label_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Cash Provided by (Used in) Investing Activities [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:to="lab_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxDisclosureAbstract_1856014c-4f24-4f01-aae2-6b485490392a_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Disclosure [Abstract]</link:label>
    <link:label id="lab_us-gaap_IncomeTaxDisclosureAbstract_label_en-US" xlink:label="lab_us-gaap_IncomeTaxDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Disclosure [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxDisclosureAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxDisclosureAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxDisclosureAbstract" xlink:to="lab_us-gaap_IncomeTaxDisclosureAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntitySmallBusiness_f38ca83f-c324-416a-8fa5-4dd6c667e893_terseLabel_en-US" xlink:label="lab_dei_EntitySmallBusiness" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Small Business</link:label>
    <link:label id="lab_dei_EntitySmallBusiness_label_en-US" xlink:label="lab_dei_EntitySmallBusiness" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Small Business</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntitySmallBusiness" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntitySmallBusiness"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntitySmallBusiness" xlink:to="lab_dei_EntitySmallBusiness" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AllowanceForCreditLossesOnFinancingReceivablesTableTextBlock_0c580dec-0ee9-4f50-b695-dfd9ef9776c9_terseLabel_en-US" xlink:label="lab_us-gaap_AllowanceForCreditLossesOnFinancingReceivablesTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Allowance for Credit Loss</link:label>
    <link:label id="lab_us-gaap_AllowanceForCreditLossesOnFinancingReceivablesTableTextBlock_label_en-US" xlink:label="lab_us-gaap_AllowanceForCreditLossesOnFinancingReceivablesTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Financing Receivable, Allowance for Credit Loss [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllowanceForCreditLossesOnFinancingReceivablesTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AllowanceForCreditLossesOnFinancingReceivablesTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AllowanceForCreditLossesOnFinancingReceivablesTableTextBlock" xlink:to="lab_us-gaap_AllowanceForCreditLossesOnFinancingReceivablesTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions_b565116f-de60-4e6a-beac-ef7bdc2183b6_terseLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross amounts of increases in unrecognized tax benefits as a result of tax positions taken in the current period</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions_label_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Increase Resulting from Current Period Tax Positions</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions" xlink:to="lab_us-gaap_UnrecognizedTaxBenefitsIncreasesResultingFromCurrentPeriodTaxPositions" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsLineItems_e966cee9-dee1-4021-9b50-cfd7321c29a1_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets [Line Items]</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsLineItems_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount_165aeca0-8879-416f-a3f1-32ceb0468010_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reduction of income tax expense for adoption of ASU 2016-09</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Expense (Benefit), Share-based Payment Arrangement, Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UncollectibleReceivablesMember_3cc31cce-cd7e-4138-a116-10d0619b0318_terseLabel_en-US" xlink:label="lab_us-gaap_UncollectibleReceivablesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reserve for Uncollectible Accounts Receivable and Sales Return [Member]</link:label>
    <link:label id="lab_us-gaap_UncollectibleReceivablesMember_label_en-US" xlink:label="lab_us-gaap_UncollectibleReceivablesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Uncollectible Receivables [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UncollectibleReceivablesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UncollectibleReceivablesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UncollectibleReceivablesMember" xlink:to="lab_us-gaap_UncollectibleReceivablesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled_3e27ced0-0a2a-4dcc-ad53-a2fdbcc6ba26_terseLabel_en-US" xlink:label="lab_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase of common stock, not yet settled (in shares)</link:label>
    <link:label id="lab_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled_label_en-US" xlink:label="lab_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Repurchased During Period, Shares Not Yet Settled</link:label>
    <link:label id="lab_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled_documentation_en-US" xlink:label="lab_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Repurchased During Period, Shares Not Yet Settled</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled" xlink:href="cgnx-20211231.xsd#cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled" xlink:to="lab_cgnx_StockRepurchasedDuringPeriodSharesNotYetSettled" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NoncompeteAgreementsMember_53084829-1012-4e18-bead-a878ace11412_terseLabel_en-US" xlink:label="lab_us-gaap_NoncompeteAgreementsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Non-compete agreements</link:label>
    <link:label id="lab_us-gaap_NoncompeteAgreementsMember_label_en-US" xlink:label="lab_us-gaap_NoncompeteAgreementsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Noncompete Agreements [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoncompeteAgreementsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NoncompeteAgreementsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NoncompeteAgreementsMember" xlink:to="lab_us-gaap_NoncompeteAgreementsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement_dbdfff89-9eb2-4d6e-9714-7dabd1226699_terseLabel_en-US" xlink:label="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Estimated forfeiture rate for unvested options for senior management</link:label>
    <link:label id="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement_label_en-US" xlink:label="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Estimated Forfeiture Rate For Unvested Options For Senior Management</link:label>
    <link:label id="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement_documentation_en-US" xlink:label="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Estimated forfeiture rate for unvested options for senior management.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" xlink:href="cgnx-20211231.xsd#cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" xlink:to="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForSeniorManagement" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill_80618ed5-24f2-4745-af56-2941fd9db192_terseLabel_en-US" xlink:label="lab_us-gaap_ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible asset impairment charges</link:label>
    <link:label id="lab_us-gaap_ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill_label_en-US" xlink:label="lab_us-gaap_ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Impairment of Intangible Assets, Indefinite-lived (Excluding Goodwill)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill" xlink:to="lab_us-gaap_ImpairmentOfIntangibleAssetsIndefinitelivedExcludingGoodwill" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LiabilitiesAndStockholdersEquityAbstract_02257245-0bf3-4c43-8511-f3f9113607c8_terseLabel_en-US" xlink:label="lab_us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">LIABILITIES AND SHAREHOLDERS&#8217; EQUITY</link:label>
    <link:label id="lab_us-gaap_LiabilitiesAndStockholdersEquityAbstract_label_en-US" xlink:label="lab_us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liabilities and Equity [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquityAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:to="lab_us-gaap_LiabilitiesAndStockholdersEquityAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInAccountsPayable_8991ff91-e859-4bbe-aa56-fc055e2d22ec_terseLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInAccountsPayable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts payable</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInAccountsPayable_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInAccountsPayable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Accounts Payable</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsPayable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInAccountsPayable" xlink:to="lab_us-gaap_IncreaseDecreaseInAccountsPayable" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ApplicationofCustomerSpecificSolutionsMember_e3584499-6fab-4528-b7a5-d822f86549a5_terseLabel_en-US" xlink:label="lab_cgnx_ApplicationofCustomerSpecificSolutionsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Application-specific customer solutions</link:label>
    <link:label id="lab_cgnx_ApplicationofCustomerSpecificSolutionsMember_label_en-US" xlink:label="lab_cgnx_ApplicationofCustomerSpecificSolutionsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Application of Customer Specific Solutions [Member]</link:label>
    <link:label id="lab_cgnx_ApplicationofCustomerSpecificSolutionsMember_documentation_en-US" xlink:label="lab_cgnx_ApplicationofCustomerSpecificSolutionsMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Application of Customer Specific Solutions [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ApplicationofCustomerSpecificSolutionsMember" xlink:href="cgnx-20211231.xsd#cgnx_ApplicationofCustomerSpecificSolutionsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ApplicationofCustomerSpecificSolutionsMember" xlink:to="lab_cgnx_ApplicationofCustomerSpecificSolutionsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_ValuationAndQualifyingAccountsDisclosureTable_a302e73e-04f0-4a29-803d-3278ff7daec6_terseLabel_en-US" xlink:label="lab_srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation and Qualifying Accounts Disclosure [Table]</link:label>
    <link:label id="lab_srt_ValuationAndQualifyingAccountsDisclosureTable_label_en-US" xlink:label="lab_srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation and Qualifying Accounts Disclosure [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ValuationAndQualifyingAccountsDisclosureTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:to="lab_srt_ValuationAndQualifyingAccountsDisclosureTable" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityInteractiveDataCurrent_79d916da-900c-4830-be03-c68ec7e799f7_terseLabel_en-US" xlink:label="lab_dei_EntityInteractiveDataCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Interactive Data Current</link:label>
    <link:label id="lab_dei_EntityInteractiveDataCurrent_label_en-US" xlink:label="lab_dei_EntityInteractiveDataCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Interactive Data Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityInteractiveDataCurrent" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityInteractiveDataCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityInteractiveDataCurrent" xlink:to="lab_dei_EntityInteractiveDataCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_95502e05-62a8-4798-94d6-5df2050d55a8_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2025</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Asset, Expected Amortization, Year Four</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_3b38a54e-bf85-4094-afa1-0f615c31c252_terseLabel_en-US" xlink:label="lab_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Issuance of common stock under stock option plans</link:label>
    <link:label id="lab_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised_label_en-US" xlink:label="lab_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Issued During Period, Value, Stock Options Exercised</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised" xlink:to="lab_us-gaap_StockIssuedDuringPeriodValueStockOptionsExercised" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_7e8b43ff-c310-4eb9-824e-01885960b49b_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross realized losses</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Realized Gain</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedGain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_4fcc0693-3427-47bb-83a6-b26fca27e12b_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revaluation of contingent consideration</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combination, Contingent Consideration Arrangements, Change in Amount of Contingent Consideration, Liability</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1" xlink:to="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsChangeInAmountOfContingentConsiderationLiability1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent_60d409db-931a-415e-8805-78d86e52b063_terseLabel_en-US" xlink:label="lab_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reserve for income taxes</link:label>
    <link:label id="lab_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent_label_en-US" xlink:label="lab_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liability for Uncertainty in Income Taxes, Noncurrent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForUncertainTaxPositionsNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent" xlink:to="lab_us-gaap_LiabilityForUncertainTaxPositionsNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BalanceSheetLocationDomain_9942023a-05f5-4ad5-8177-47448aabc32b_terseLabel_en-US" xlink:label="lab_us-gaap_BalanceSheetLocationDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance Sheet Location [Domain]</link:label>
    <link:label id="lab_us-gaap_BalanceSheetLocationDomain_label_en-US" xlink:label="lab_us-gaap_BalanceSheetLocationDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance Sheet Location [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BalanceSheetLocationDomain" xlink:to="lab_us-gaap_BalanceSheetLocationDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefits_e9fd902f-f491-41ac-8a71-d222802aef42_terseLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefits" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reserve for tax uncertainties</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefits_06084875-3495-413e-a2e2-64eb5edf4dc7_periodStartLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefits" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance of reserve for income taxes</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefits_4f665d45-45f3-4dc8-808b-3d00f7f54ffc_periodEndLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefits" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance of reserve for income taxes</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefits_label_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefits" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnrecognizedTaxBenefits" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnrecognizedTaxBenefits"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UnrecognizedTaxBenefits" xlink:to="lab_us-gaap_UnrecognizedTaxBenefits" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsGross_302f4287-79ec-4cc1-a967-af6631b19988_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsGross" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred tax assets</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsGross_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsGross" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGross" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsGross"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsGross" xlink:to="lab_us-gaap_DeferredTaxAssetsGross" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxAuthorityDomain_8f9ccecf-aa54-40e3-b638-58a8c48ab9b4_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxAuthorityDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Authority [Domain]</link:label>
    <link:label id="lab_us-gaap_IncomeTaxAuthorityDomain_label_en-US" xlink:label="lab_us-gaap_IncomeTaxAuthorityDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Authority [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxAuthorityDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxAuthorityDomain" xlink:to="lab_us-gaap_IncomeTaxAuthorityDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_SellingGeneralAndAdministrativeMember_4791eb56-98c4-4ea1-b87c-ea89b14defa7_terseLabel_en-US" xlink:label="lab_cgnx_SellingGeneralAndAdministrativeMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Selling, general, and administrative [Member]</link:label>
    <link:label id="lab_cgnx_SellingGeneralAndAdministrativeMember_label_en-US" xlink:label="lab_cgnx_SellingGeneralAndAdministrativeMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Selling General And Administrative [Member]</link:label>
    <link:label id="lab_cgnx_SellingGeneralAndAdministrativeMember_documentation_en-US" xlink:label="lab_cgnx_SellingGeneralAndAdministrativeMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Selling, general, and administrative.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_SellingGeneralAndAdministrativeMember" xlink:href="cgnx-20211231.xsd#cgnx_SellingGeneralAndAdministrativeMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_SellingGeneralAndAdministrativeMember" xlink:to="lab_cgnx_SellingGeneralAndAdministrativeMember" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityCommonStockSharesOutstanding_6cf7670f-e52a-4117-9bcf-8970b68633f8_terseLabel_en-US" xlink:label="lab_dei_EntityCommonStockSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Common Stock, Shares Outstanding</link:label>
    <link:label id="lab_dei_EntityCommonStockSharesOutstanding_label_en-US" xlink:label="lab_dei_EntityCommonStockSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Common Stock, Shares Outstanding</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCommonStockSharesOutstanding" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityCommonStockSharesOutstanding"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityCommonStockSharesOutstanding" xlink:to="lab_dei_EntityCommonStockSharesOutstanding" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxReconciliationTaxSettlementsForeign_0b188cdd-4128-464b-8b1b-3eacc79ac2e3_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxReconciliationTaxSettlementsForeign" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">1. Effective income tax rate reconciliation, tax settlement, foreign, amount</link:label>
    <link:label id="lab_us-gaap_IncomeTaxReconciliationTaxSettlementsForeign_label_en-US" xlink:label="lab_us-gaap_IncomeTaxReconciliationTaxSettlementsForeign" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Settlement, Foreign, Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxReconciliationTaxSettlementsForeign" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxReconciliationTaxSettlementsForeign"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxReconciliationTaxSettlementsForeign" xlink:to="lab_us-gaap_IncomeTaxReconciliationTaxSettlementsForeign" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_c7b799b9-995a-47ec-8155-d83c1bbfdcb7_terseLabel_en-US" xlink:label="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross Unrealized Gains</link:label>
    <link:label id="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_label_en-US" xlink:label="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Accumulated Gross Unrealized Gain, before Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax" xlink:to="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityAddressStateOrProvince_5466abf6-bfb4-4dff-8011-a7cbce5509dd_terseLabel_en-US" xlink:label="lab_dei_EntityAddressStateOrProvince" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Address, State or Province</link:label>
    <link:label id="lab_dei_EntityAddressStateOrProvince_label_en-US" xlink:label="lab_dei_EntityAddressStateOrProvince" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Address, State or Province</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressStateOrProvince" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityAddressStateOrProvince"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityAddressStateOrProvince" xlink:to="lab_dei_EntityAddressStateOrProvince" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringReserve_64e0d5b2-348f-4692-8fad-c4a7be6e6bc9_periodStartLabel_en-US" xlink:label="lab_us-gaap_RestructuringReserve" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance as of December 31, 2019</link:label>
    <link:label id="lab_us-gaap_RestructuringReserve_5eb42b5f-66e8-4c1a-8060-bda2d589de86_periodEndLabel_en-US" xlink:label="lab_us-gaap_RestructuringReserve" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance as of December 31, 2020</link:label>
    <link:label id="lab_us-gaap_RestructuringReserve_label_en-US" xlink:label="lab_us-gaap_RestructuringReserve" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Reserve</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringReserve" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringReserve"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringReserve" xlink:to="lab_us-gaap_RestructuringReserve" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredIncomeTaxAssetsNet_708fa1ee-564d-4735-bbe8-a210f1ae8a75_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxAssetsNet" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred income taxes</link:label>
    <link:label id="lab_us-gaap_DeferredIncomeTaxAssetsNet_label_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxAssetsNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Income Tax Assets, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxAssetsNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredIncomeTaxAssetsNet" xlink:to="lab_us-gaap_DeferredIncomeTaxAssetsNet" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LiabilitiesCurrentAbstract_aa5d4ff7-28f6-48a7-814d-56d7a87b5ce2_terseLabel_en-US" xlink:label="lab_us-gaap_LiabilitiesCurrentAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current liabilities:</link:label>
    <link:label id="lab_us-gaap_LiabilitiesCurrentAbstract_label_en-US" xlink:label="lab_us-gaap_LiabilitiesCurrentAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liabilities, Current [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrentAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesCurrentAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LiabilitiesCurrentAbstract" xlink:to="lab_us-gaap_LiabilitiesCurrentAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_RestatementAxis_655e047f-aa63-4479-8ced-655f1caa3e32_terseLabel_en-US" xlink:label="lab_srt_RestatementAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restatement [Axis]</link:label>
    <link:label id="lab_srt_RestatementAxis_label_en-US" xlink:label="lab_srt_RestatementAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revision of Prior Period [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RestatementAxis" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RestatementAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_RestatementAxis" xlink:to="lab_srt_RestatementAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice_e55d183e-1d79-456d-a854-4f234ce63656_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Exercisable, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Exercisable, Weighted Average Exercise Price</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves_c4206668-dbaf-454f-a53c-2c69e36eb0d5_terseLabel_en-US" xlink:label="lab_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Minimum decrease in income tax expense due to release in reserves</link:label>
    <link:label id="lab_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves_label_en-US" xlink:label="lab_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Minimum Decrease In Income Tax Expense Due To Release In Reserves</link:label>
    <link:label id="lab_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves_documentation_en-US" xlink:label="lab_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Minimum decrease in income tax expense due to release in reserves.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:href="cgnx-20211231.xsd#cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:to="lab_cgnx_MinimumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringReserveSettledWithoutCash2_1daf2132-822a-423e-8bb2-b12452649c89_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_RestructuringReserveSettledWithoutCash2" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Non-cash restructuring charges</link:label>
    <link:label id="lab_us-gaap_RestructuringReserveSettledWithoutCash2_label_en-US" xlink:label="lab_us-gaap_RestructuringReserveSettledWithoutCash2" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Reserve, Settled without Cash</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringReserveSettledWithoutCash2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringReserveSettledWithoutCash2"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringReserveSettledWithoutCash2" xlink:to="lab_us-gaap_RestructuringReserveSettledWithoutCash2" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InventoryDisclosureTextBlock_9faea943-f179-4c05-844e-b7b0b2106eef_verboseLabel_en-US" xlink:label="lab_us-gaap_InventoryDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventories</link:label>
    <link:label id="lab_us-gaap_InventoryDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_InventoryDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InventoryDisclosureTextBlock" xlink:to="lab_us-gaap_InventoryDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued_82be716c-219a-4b91-ad7e-0398acac93b9_terseLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Interest and penalties, gross</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued_label_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Income Tax Penalties and Interest Accrued</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued" xlink:to="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestAccrued" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccountingPoliciesAbstract_7241c905-9f44-461b-9f2e-03d103b32c02_terseLabel_en-US" xlink:label="lab_us-gaap_AccountingPoliciesAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounting Policies [Abstract]</link:label>
    <link:label id="lab_us-gaap_AccountingPoliciesAbstract_label_en-US" xlink:label="lab_us-gaap_AccountingPoliciesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounting Policies [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountingPoliciesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountingPoliciesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccountingPoliciesAbstract" xlink:to="lab_us-gaap_AccountingPoliciesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2_37d7a275-358f-4955-ab60-7af0093f762a_terseLabel_en-US" xlink:label="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Outstanding, weighted-average remaining contractual term (in years)</link:label>
    <link:label id="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2_label_en-US" xlink:label="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding, Weighted Average Remaining Contractual Term</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2" xlink:to="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_MunicipalBondsFairValueDisclosure_90e095da-abcd-4eac-8540-70bdacafee21_terseLabel_en-US" xlink:label="lab_cgnx_MunicipalBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Municipal bonds</link:label>
    <link:label id="lab_cgnx_MunicipalBondsFairValueDisclosure_label_en-US" xlink:label="lab_cgnx_MunicipalBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Municipal Bonds Fair Value Disclosure</link:label>
    <link:label id="lab_cgnx_MunicipalBondsFairValueDisclosure_documentation_en-US" xlink:label="lab_cgnx_MunicipalBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Municipal bonds fair value disclosure.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_MunicipalBondsFairValueDisclosure" xlink:href="cgnx-20211231.xsd#cgnx_MunicipalBondsFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_MunicipalBondsFairValueDisclosure" xlink:to="lab_cgnx_MunicipalBondsFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CurrentFederalTaxExpenseBenefit_e8eda658-58eb-4bb5-bad7-4363dd5a505a_terseLabel_en-US" xlink:label="lab_us-gaap_CurrentFederalTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Federal</link:label>
    <link:label id="lab_us-gaap_CurrentFederalTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_CurrentFederalTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current Federal Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentFederalTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentFederalTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CurrentFederalTaxExpenseBenefit" xlink:to="lab_us-gaap_CurrentFederalTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseLiability_a60215ba-b749-4093-a82f-83e2e53ac90c_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseLiability" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease, liability</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseLiability_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseLiability" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Liability</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiability" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiability"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseLiability" xlink:to="lab_us-gaap_OperatingLeaseLiability" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_DocumentTransitionReport_15ade72f-e14d-44df-b715-0e174f48f0be_terseLabel_en-US" xlink:label="lab_dei_DocumentTransitionReport" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Transition Report</link:label>
    <link:label id="lab_dei_DocumentTransitionReport_label_en-US" xlink:label="lab_dei_DocumentTransitionReport" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Transition Report</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentTransitionReport" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentTransitionReport"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_DocumentTransitionReport" xlink:to="lab_dei_DocumentTransitionReport" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_be3ef7b4-2e9a-4dba-a011-39a16a09b64c_terseLabel_en-US" xlink:label="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Recognition period for unrecognized compensation expense</link:label>
    <link:label id="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_label_en-US" xlink:label="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Nonvested Award, Cost Not yet Recognized, Period for Recognition</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:to="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DueFromForeignBanks_36d4768c-75b2-4d04-b21b-7633a422dc94_terseLabel_en-US" xlink:label="lab_cgnx_DueFromForeignBanks" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash balance included foreign bank balance</link:label>
    <link:label id="lab_cgnx_DueFromForeignBanks_label_en-US" xlink:label="lab_cgnx_DueFromForeignBanks" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Due From Foreign Banks</link:label>
    <link:label id="lab_cgnx_DueFromForeignBanks_documentation_en-US" xlink:label="lab_cgnx_DueFromForeignBanks" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Due from foreign banks.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DueFromForeignBanks" xlink:href="cgnx-20211231.xsd#cgnx_DueFromForeignBanks"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DueFromForeignBanks" xlink:to="lab_cgnx_DueFromForeignBanks" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CustomerConcentrationRiskMember_25b1c5b7-1caf-4c6a-b9a2-d0257a5afa40_verboseLabel_en-US" xlink:label="lab_us-gaap_CustomerConcentrationRiskMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue from a single customer, percentage</link:label>
    <link:label id="lab_us-gaap_CustomerConcentrationRiskMember_label_en-US" xlink:label="lab_us-gaap_CustomerConcentrationRiskMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer Concentration Risk [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CustomerConcentrationRiskMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CustomerConcentrationRiskMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CustomerConcentrationRiskMember" xlink:to="lab_us-gaap_CustomerConcentrationRiskMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_65cfee13-8f3a-45e9-bfdd-b08ed9d1fa76_periodStartLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nonvested beginning balance, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_efff90bf-1bce-44e1-9f96-cee0944d5b32_periodEndLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nonvested ending balance, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Nonvested, Weighted Average Grant Date Fair Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeasesTextBlock_ba7294de-2f35-4122-9ba8-f9f726755832_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeasesTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Leases</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeasesTextBlock_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeasesTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Leases [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeasesTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeasesTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeasesTextBlock" xlink:to="lab_us-gaap_LesseeOperatingLeasesTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DividendsPayableAmountPerShare_f5e00e8f-7ed7-4d3f-8d88-17dfa4dd3c01_terseLabel_en-US" xlink:label="lab_us-gaap_DividendsPayableAmountPerShare" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Dividends Payable, Amount Per Share</link:label>
    <link:label id="lab_us-gaap_DividendsPayableAmountPerShare_label_en-US" xlink:label="lab_us-gaap_DividendsPayableAmountPerShare" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Dividends Payable, Amount Per Share</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsPayableAmountPerShare" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DividendsPayableAmountPerShare"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DividendsPayableAmountPerShare" xlink:to="lab_us-gaap_DividendsPayableAmountPerShare" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationDisclosureTextBlock_8ef176a2-3b48-40f6-9c0e-b724440dc617_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Acquisitions</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combination Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationDisclosureTextBlock" xlink:to="lab_us-gaap_BusinessCombinationDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember_e95fab29-a415-403c-b3b2-27cce7505edd_terseLabel_en-US" xlink:label="lab_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Completed Technologies And Other Intangible Assets [Member]</link:label>
    <link:label id="lab_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember_label_en-US" xlink:label="lab_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Completed Technologies And Other Intangible Assets [Member]</link:label>
    <link:label id="lab_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember_documentation_en-US" xlink:label="lab_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Completed Technologies And Other Intangible Assets [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember" xlink:href="cgnx-20211231.xsd#cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember" xlink:to="lab_cgnx_CompletedTechnologiesAndOtherIntangibleAssetsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_IcfrAuditorAttestationFlag_75962bc4-64c4-4e7b-9857-21e5cf616e35_terseLabel_en-US" xlink:label="lab_dei_IcfrAuditorAttestationFlag" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">ICFR Auditor Attestation Flag</link:label>
    <link:label id="lab_dei_IcfrAuditorAttestationFlag_label_en-US" xlink:label="lab_dei_IcfrAuditorAttestationFlag" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">ICFR Auditor Attestation Flag</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_IcfrAuditorAttestationFlag" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_IcfrAuditorAttestationFlag"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_IcfrAuditorAttestationFlag" xlink:to="lab_dei_IcfrAuditorAttestationFlag" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_AuditorLineItems_label_en-US" xlink:label="lab_dei_AuditorLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Auditor [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_AuditorLineItems" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_AuditorLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_AuditorLineItems" xlink:to="lab_dei_AuditorLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock_6864f989-8bc7-41ad-9a3f-bcb9f0d8345a_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted-Average Assumptions Used in Estimating Fair Values of Stock Options Granted</link:label>
    <link:label id="lab_us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Share-based Payment Award, Stock Options, Valuation Assumptions [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AntidilutiveSecuritiesNameDomain_e99a1012-1e69-48b4-95c6-2f4f49bbe674_terseLabel_en-US" xlink:label="lab_us-gaap_AntidilutiveSecuritiesNameDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Antidilutive Securities, Name [Domain]</link:label>
    <link:label id="lab_us-gaap_AntidilutiveSecuritiesNameDomain_label_en-US" xlink:label="lab_us-gaap_AntidilutiveSecuritiesNameDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Antidilutive Securities, Name [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain" xlink:to="lab_us-gaap_AntidilutiveSecuritiesNameDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredForeignIncomeTaxExpenseBenefit_9f9235c1-5e49-44b1-88de-1d21ecdc37f4_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredForeignIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign</link:label>
    <link:label id="lab_us-gaap_DeferredForeignIncomeTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_DeferredForeignIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Foreign Income Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredForeignIncomeTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredForeignIncomeTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredForeignIncomeTaxExpenseBenefit" xlink:to="lab_us-gaap_DeferredForeignIncomeTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GoodwillLineItems_5b207fcc-561a-498e-8417-85862965fe9e_terseLabel_en-US" xlink:label="lab_us-gaap_GoodwillLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill [Line Items]</link:label>
    <link:label id="lab_us-gaap_GoodwillLineItems_label_en-US" xlink:label="lab_us-gaap_GoodwillLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GoodwillLineItems" xlink:to="lab_us-gaap_GoodwillLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StatementClassOfStockAxis_18ef4481-97ef-4dd4-83cf-5169a387ea64_terseLabel_en-US" xlink:label="lab_us-gaap_StatementClassOfStockAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Class of Stock [Axis]</link:label>
    <link:label id="lab_us-gaap_StatementClassOfStockAxis_label_en-US" xlink:label="lab_us-gaap_StatementClassOfStockAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Class of Stock [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StatementClassOfStockAxis" xlink:to="lab_us-gaap_StatementClassOfStockAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome_58ae8e4e-b376-4d83-af42-7ce1ce8f6f2c_terseLabel_en-US" xlink:label="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">GILTI tax basis differences</link:label>
    <link:label id="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome_bc321907-85d1-496a-be49-d75aa16cf500_negatedTerseLabel_en-US" xlink:label="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">GILTI tax basis differences in connection with change in tax structure</link:label>
    <link:label id="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome_label_en-US" xlink:label="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Liabilities, Tax Cuts And Jobs Act, Global Intangible Low Tax Income</link:label>
    <link:label id="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome_documentation_en-US" xlink:label="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Liabilities, Tax Cuts And Jobs Act, Global Intangible Low Tax Income</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" xlink:to="lab_cgnx_DeferredTaxLiabilitiesTaxCutsAndJobsActGlobalIntangibleLowTaxIncome" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_GBP_eea4300f-4bab-40c0-8e8a-bada9b225d9f_terseLabel_en-US" xlink:label="lab_currency_GBP" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">British Pound [Member]</link:label>
    <link:label id="lab_currency_GBP_label_en-US" xlink:label="lab_currency_GBP" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">United Kingdom, Pounds</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_GBP" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_GBP"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_GBP" xlink:to="lab_currency_GBP" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SummaryOfIncomeTaxContingenciesTextBlock_23836965-bcf6-4060-b32e-ef14d754bdde_terseLabel_en-US" xlink:label="lab_us-gaap_SummaryOfIncomeTaxContingenciesTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Changes in the Reserve for Income Taxes, Excluding Interest and Penalties</link:label>
    <link:label id="lab_us-gaap_SummaryOfIncomeTaxContingenciesTextBlock_label_en-US" xlink:label="lab_us-gaap_SummaryOfIncomeTaxContingenciesTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Summary of Income Tax Contingencies [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SummaryOfIncomeTaxContingenciesTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SummaryOfIncomeTaxContingenciesTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SummaryOfIncomeTaxContingenciesTextBlock" xlink:to="lab_us-gaap_SummaryOfIncomeTaxContingenciesTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_NumberOfGroupsWithinEmployeePopulation_3e7d9492-2ff2-4c67-bb87-f421f40dd360_terseLabel_en-US" xlink:label="lab_cgnx_NumberOfGroupsWithinEmployeePopulation" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Number of groups within the employee population</link:label>
    <link:label id="lab_cgnx_NumberOfGroupsWithinEmployeePopulation_label_en-US" xlink:label="lab_cgnx_NumberOfGroupsWithinEmployeePopulation" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Number Of Groups Within Employee Population</link:label>
    <link:label id="lab_cgnx_NumberOfGroupsWithinEmployeePopulation_documentation_en-US" xlink:label="lab_cgnx_NumberOfGroupsWithinEmployeePopulation" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Number of groups within employee population.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_NumberOfGroupsWithinEmployeePopulation" xlink:href="cgnx-20211231.xsd#cgnx_NumberOfGroupsWithinEmployeePopulation"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_NumberOfGroupsWithinEmployeePopulation" xlink:to="lab_cgnx_NumberOfGroupsWithinEmployeePopulation" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxAuthorityAxis_320ec688-07ca-4efa-8096-9f80317052df_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxAuthorityAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Authority [Axis]</link:label>
    <link:label id="lab_us-gaap_IncomeTaxAuthorityAxis_label_en-US" xlink:label="lab_us-gaap_IncomeTaxAuthorityAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Authority [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxAuthorityAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxAuthorityAxis" xlink:to="lab_us-gaap_IncomeTaxAuthorityAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InventoryWorkInProcessNetOfReserves_691ccf83-a99f-4239-b762-da3e690b9319_terseLabel_en-US" xlink:label="lab_us-gaap_InventoryWorkInProcessNetOfReserves" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Work-in-process</link:label>
    <link:label id="lab_us-gaap_InventoryWorkInProcessNetOfReserves_label_en-US" xlink:label="lab_us-gaap_InventoryWorkInProcessNetOfReserves" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory, Work in Process, Net of Reserves</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryWorkInProcessNetOfReserves" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryWorkInProcessNetOfReserves"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InventoryWorkInProcessNetOfReserves" xlink:to="lab_us-gaap_InventoryWorkInProcessNetOfReserves" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UnbilledReceivablesCurrent_3a83cc68-d3ee-44d2-b991-d6e291a52974_terseLabel_en-US" xlink:label="lab_us-gaap_UnbilledReceivablesCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unbilled revenue</link:label>
    <link:label id="lab_us-gaap_UnbilledReceivablesCurrent_label_en-US" xlink:label="lab_us-gaap_UnbilledReceivablesCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unbilled Receivables, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnbilledReceivablesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnbilledReceivablesCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UnbilledReceivablesCurrent" xlink:to="lab_us-gaap_UnbilledReceivablesCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_d412540a-72b4-49a9-849e-62a25add9639_terseLabel_en-US" xlink:label="lab_us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Prepaid expenses and other current assets</link:label>
    <link:label id="lab_us-gaap_PrepaidExpenseAndOtherAssetsCurrent_label_en-US" xlink:label="lab_us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Prepaid Expense and Other Assets, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PrepaidExpenseAndOtherAssetsCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:to="lab_us-gaap_PrepaidExpenseAndOtherAssetsCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_KRW_6d4eff3d-48bd-4a2a-9341-fc6f6eabb803_terseLabel_en-US" xlink:label="lab_currency_KRW" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Korean Won [Member]</link:label>
    <link:label id="lab_currency_KRW_label_en-US" xlink:label="lab_currency_KRW" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Korea (South), Won</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_KRW" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_KRW"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_KRW" xlink:to="lab_currency_KRW" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLineItems_207361b4-5a56-408e-a20d-1c96a13140b1_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Shares</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLineItems_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Option, Exercise Price Range [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLineItems" xlink:to="lab_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommonStockDividendsPerShareDeclared_1f4cd8cd-0172-4558-9f00-6da17732a504_terseLabel_en-US" xlink:label="lab_us-gaap_CommonStockDividendsPerShareDeclared" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash dividend declared per common share</link:label>
    <link:label id="lab_us-gaap_CommonStockDividendsPerShareDeclared_label_en-US" xlink:label="lab_us-gaap_CommonStockDividendsPerShareDeclared" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock, Dividends, Per Share, Declared</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareDeclared" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockDividendsPerShareDeclared"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommonStockDividendsPerShareDeclared" xlink:to="lab_us-gaap_CommonStockDividendsPerShareDeclared" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccruedLiabilitiesCurrent_80291377-966d-4275-b5d5-52c6000ff2da_terseLabel_en-US" xlink:label="lab_us-gaap_AccruedLiabilitiesCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued expenses</link:label>
    <link:label id="lab_us-gaap_AccruedLiabilitiesCurrent_597ea811-6af7-49f8-b1d0-f5a3a82b96df_totalLabel_en-US" xlink:label="lab_us-gaap_AccruedLiabilitiesCurrent" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued expenses</link:label>
    <link:label id="lab_us-gaap_AccruedLiabilitiesCurrent_label_en-US" xlink:label="lab_us-gaap_AccruedLiabilitiesCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Liabilities, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedLiabilitiesCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrent" xlink:to="lab_us-gaap_AccruedLiabilitiesCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_b16874db-455f-4975-b1a3-b47f96158048_terseLabel_en-US" xlink:label="lab_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue</link:label>
    <link:label id="lab_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_ffe2b11b-5db6-437d-8108-997b651aee2c_verboseLabel_en-US" xlink:label="lab_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue</link:label>
    <link:label id="lab_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax_label_en-US" xlink:label="lab_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue from Contract with Customer, Excluding Assessed Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:to="lab_us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_4a35f8e7-155b-4d5b-9164-5e6c26245faa_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock-based compensation expense</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Tax Deferred Expense, Compensation and Benefits, Share-based Compensation Cost</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:to="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InventoryFinishedGoodsNetOfReserves_b7dc9f6c-560b-489d-bcbb-efbf7c764e2b_terseLabel_en-US" xlink:label="lab_us-gaap_InventoryFinishedGoodsNetOfReserves" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finished goods</link:label>
    <link:label id="lab_us-gaap_InventoryFinishedGoodsNetOfReserves_label_en-US" xlink:label="lab_us-gaap_InventoryFinishedGoodsNetOfReserves" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory, Finished Goods, Net of Reserves</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryFinishedGoodsNetOfReserves" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryFinishedGoodsNetOfReserves"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InventoryFinishedGoodsNetOfReserves" xlink:to="lab_us-gaap_InventoryFinishedGoodsNetOfReserves" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EmployeeStockOptionMember_32bc02a5-7b77-4f66-bf36-63428fa7e2f3_terseLabel_en-US" xlink:label="lab_us-gaap_EmployeeStockOptionMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Employee Stock Option [Member]</link:label>
    <link:label id="lab_us-gaap_EmployeeStockOptionMember_bd082503-c9d8-4874-8754-0542ae67a55d_verboseLabel_en-US" xlink:label="lab_us-gaap_EmployeeStockOptionMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Compensation Plan [Member]</link:label>
    <link:label id="lab_us-gaap_EmployeeStockOptionMember_label_en-US" xlink:label="lab_us-gaap_EmployeeStockOptionMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Option [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EmployeeStockOptionMember" xlink:to="lab_us-gaap_EmployeeStockOptionMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EquityAbstract_d37efa90-4e49-497b-9a73-fb72e9848378_terseLabel_en-US" xlink:label="lab_us-gaap_EquityAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Equity [Abstract]</link:label>
    <link:label id="lab_us-gaap_EquityAbstract_label_en-US" xlink:label="lab_us-gaap_EquityAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Equity [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquityAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EquityAbstract" xlink:to="lab_us-gaap_EquityAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueByFairValueHierarchyLevelAxis_56c813fd-cd3d-410a-b62c-40cd9991a0f2_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Hierarchy and NAV [Axis]</link:label>
    <link:label id="lab_us-gaap_FairValueByFairValueHierarchyLevelAxis_label_en-US" xlink:label="lab_us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Hierarchy and NAV [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:to="lab_us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ComprehensiveIncomePolicyPolicyTextBlock_99892fe1-4e29-49dc-a202-292a6632b17a_terseLabel_en-US" xlink:label="lab_us-gaap_ComprehensiveIncomePolicyPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Comprehensive Income</link:label>
    <link:label id="lab_us-gaap_ComprehensiveIncomePolicyPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_ComprehensiveIncomePolicyPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Comprehensive Income, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomePolicyPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ComprehensiveIncomePolicyPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ComprehensiveIncomePolicyPolicyTextBlock" xlink:to="lab_us-gaap_ComprehensiveIncomePolicyPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits_36b5d3f3-f56b-41f8-ba06-0376e384b429_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax credit</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Credit, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxCredits" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset_f4d94e39-9134-4294-9ff9-86d3c61525a4_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative liability gross amount offset</link:label>
    <link:label id="lab_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset_label_en-US" xlink:label="lab_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Liability, Collateral, Right to Reclaim Cash, Offset</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset" xlink:to="lab_us-gaap_DerivativeLiabilityCollateralRightToReclaimCashOffset" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StandardProductWarrantyPolicy_5bc79380-cc32-4b81-8553-777d802f3579_terseLabel_en-US" xlink:label="lab_us-gaap_StandardProductWarrantyPolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Warranty Obligations</link:label>
    <link:label id="lab_us-gaap_StandardProductWarrantyPolicy_label_en-US" xlink:label="lab_us-gaap_StandardProductWarrantyPolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Standard Product Warranty, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StandardProductWarrantyPolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StandardProductWarrantyPolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StandardProductWarrantyPolicy" xlink:to="lab_us-gaap_StandardProductWarrantyPolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_SovereignBondsFairValueDisclosure_0709cd83-25a6-4612-97be-62d9702013b6_terseLabel_en-US" xlink:label="lab_cgnx_SovereignBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sovereign bonds</link:label>
    <link:label id="lab_cgnx_SovereignBondsFairValueDisclosure_label_en-US" xlink:label="lab_cgnx_SovereignBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sovereign Bonds Fair Value Disclosure</link:label>
    <link:label id="lab_cgnx_SovereignBondsFairValueDisclosure_documentation_en-US" xlink:label="lab_cgnx_SovereignBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sovereign bonds fair value disclosure.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_SovereignBondsFairValueDisclosure" xlink:href="cgnx-20211231.xsd#cgnx_SovereignBondsFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_SovereignBondsFairValueDisclosure" xlink:to="lab_cgnx_SovereignBondsFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_50be8666-f9ad-43a9-b99f-1218ab472a89_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Less than 12 months</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Continuous Unrealized Loss Position, Less than 12 Months</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SegmentReportingDisclosureTextBlock_c61e6176-688b-4fc9-9497-1d549dbc474d_terseLabel_en-US" xlink:label="lab_us-gaap_SegmentReportingDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Segment and Geographic Information</link:label>
    <link:label id="lab_us-gaap_SegmentReportingDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_SegmentReportingDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Segment Reporting Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentReportingDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SegmentReportingDisclosureTextBlock" xlink:to="lab_us-gaap_SegmentReportingDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_CAD_90975b52-89a6-4854-876f-95d542c74010_terseLabel_en-US" xlink:label="lab_currency_CAD" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Canadian Dollar [Member]</link:label>
    <link:label id="lab_currency_CAD_label_en-US" xlink:label="lab_currency_CAD" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Canada, Dollars</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_CAD" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_CAD"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_CAD" xlink:to="lab_currency_CAD" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_de7827a1-9563-47c2-9d76-ebdb2d03a417_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:to="lab_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_bfe07f3c-fa4f-4b99-b5b9-9468f6b167df_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale [Line Items]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_label_en-US" xlink:label="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:to="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_20f92c7f-7cb2-4c38-8e4c-74c9d899b8fb_terseLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Stockholders' Equity [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Stockholders' Equity [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInStockholdersEquityRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward" xlink:to="lab_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_DocumentFiscalYearFocus_51f0eac6-a900-46f9-8cda-e6f9eb7f536c_terseLabel_en-US" xlink:label="lab_dei_DocumentFiscalYearFocus" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Fiscal Year Focus</link:label>
    <link:label id="lab_dei_DocumentFiscalYearFocus_label_en-US" xlink:label="lab_dei_DocumentFiscalYearFocus" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Fiscal Year Focus</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentFiscalYearFocus" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentFiscalYearFocus"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_DocumentFiscalYearFocus" xlink:to="lab_dei_DocumentFiscalYearFocus" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentAbstract_1c4833f7-7a09-4edd-b5e1-a08c48d0003d_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment [Abstract]</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentAbstract_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentAbstract" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AdditionalPaidInCapitalMember_2144c71d-95fd-4b1a-a1e2-33e6409b87da_terseLabel_en-US" xlink:label="lab_us-gaap_AdditionalPaidInCapitalMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Additional Paid-in Capital [Member]</link:label>
    <link:label id="lab_us-gaap_AdditionalPaidInCapitalMember_label_en-US" xlink:label="lab_us-gaap_AdditionalPaidInCapitalMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Additional Paid-in Capital [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdditionalPaidInCapitalMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AdditionalPaidInCapitalMember" xlink:to="lab_us-gaap_AdditionalPaidInCapitalMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet_3c9b957f-aa70-4cd6-845d-ac1da6388fc9_totalLabel_en-US" xlink:label="lab_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred income taxes</link:label>
    <link:label id="lab_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet_label_en-US" xlink:label="lab_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred income tax assets (liabilities), net</link:label>
    <link:label id="lab_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet_documentation_en-US" xlink:label="lab_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred income tax assets (liabilities), net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet" xlink:href="cgnx-20211231.xsd#cgnx_DeferredIncomeTaxAssetsLiabilitiesNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet" xlink:to="lab_cgnx_DeferredIncomeTaxAssetsLiabilitiesNet" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommonStockDividendsPerShareCashPaid_3de50a2a-926d-488f-9f33-777524a49900_terseLabel_en-US" xlink:label="lab_us-gaap_CommonStockDividendsPerShareCashPaid" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash dividends per common share (in dollars per share)</link:label>
    <link:label id="lab_us-gaap_CommonStockDividendsPerShareCashPaid_label_en-US" xlink:label="lab_us-gaap_CommonStockDividendsPerShareCashPaid" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock, Dividends, Per Share, Cash Paid</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareCashPaid" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockDividendsPerShareCashPaid"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommonStockDividendsPerShareCashPaid" xlink:to="lab_us-gaap_CommonStockDividendsPerShareCashPaid" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CashAndCashEquivalentsAbstract_70fc25a2-de0a-4fe9-9370-2d0256d698e2_terseLabel_en-US" xlink:label="lab_us-gaap_CashAndCashEquivalentsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash and Cash Equivalents [Abstract]</link:label>
    <link:label id="lab_us-gaap_CashAndCashEquivalentsAbstract_label_en-US" xlink:label="lab_us-gaap_CashAndCashEquivalentsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash and Cash Equivalents [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashAndCashEquivalentsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CashAndCashEquivalentsAbstract" xlink:to="lab_us-gaap_CashAndCashEquivalentsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_ScenarioPreviouslyReportedMember_598f0a08-0a97-4001-936f-cf4cb4d89969_terseLabel_en-US" xlink:label="lab_srt_ScenarioPreviouslyReportedMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Previously Reported [Member]</link:label>
    <link:label id="lab_srt_ScenarioPreviouslyReportedMember_label_en-US" xlink:label="lab_srt_ScenarioPreviouslyReportedMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Previously Reported [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioPreviouslyReportedMember" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ScenarioPreviouslyReportedMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_ScenarioPreviouslyReportedMember" xlink:to="lab_srt_ScenarioPreviouslyReportedMember" xlink:type="arc" order="1"/>
    <link:label id="lab_country_KP_fe051c96-391a-4d20-9425-dd2fd56559ba_terseLabel_en-US" xlink:label="lab_country_KP" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF</link:label>
    <link:label id="lab_country_KP_label_en-US" xlink:label="lab_country_KP" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_country_KP" xlink:href="https://xbrl.sec.gov/country/2021/country-2021.xsd#country_KP"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_country_KP" xlink:to="lab_country_KP" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherNonoperatingIncomeExpense_69ec01d7-e9f7-4254-a0f0-b81aad93eab9_terseLabel_en-US" xlink:label="lab_us-gaap_OtherNonoperatingIncomeExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other income (expense)</link:label>
    <link:label id="lab_us-gaap_OtherNonoperatingIncomeExpense_label_en-US" xlink:label="lab_us-gaap_OtherNonoperatingIncomeExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Nonoperating Income (Expense)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherNonoperatingIncomeExpense" xlink:to="lab_us-gaap_OtherNonoperatingIncomeExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationsAbstract_f0a7ca10-9ed3-43bf-ae1e-a3825d0b95e9_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combinations [Abstract]</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationsAbstract_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combinations [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationsAbstract" xlink:to="lab_us-gaap_BusinessCombinationsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_MaximumMember_9ed7d623-fc21-4a09-88b5-fe799525e071_terseLabel_en-US" xlink:label="lab_srt_MaximumMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum [Member]</link:label>
    <link:label id="lab_srt_MaximumMember_label_en-US" xlink:label="lab_srt_MaximumMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MaximumMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_MaximumMember" xlink:to="lab_srt_MaximumMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract_342fecfe-03fb-436b-ada8-c21c4214ce36_terseLabel_en-US" xlink:label="lab_us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Disclosure of Compensation Related Costs, Share-based Payments [Abstract]</link:label>
    <link:label id="lab_us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract_label_en-US" xlink:label="lab_us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:to="lab_us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InventoryRawMaterialsNetOfReserves_1c2631e1-28e7-4ba9-879b-21ed31ca9fea_terseLabel_en-US" xlink:label="lab_us-gaap_InventoryRawMaterialsNetOfReserves" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Raw materials</link:label>
    <link:label id="lab_us-gaap_InventoryRawMaterialsNetOfReserves_label_en-US" xlink:label="lab_us-gaap_InventoryRawMaterialsNetOfReserves" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory, Raw Materials, Net of Reserves</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryRawMaterialsNetOfReserves" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryRawMaterialsNetOfReserves"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InventoryRawMaterialsNetOfReserves" xlink:to="lab_us-gaap_InventoryRawMaterialsNetOfReserves" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DividendsPayableDateDeclaredDayMonthAndYear_5bfd7513-f3d9-4797-9783-1a0253115b01_terseLabel_en-US" xlink:label="lab_us-gaap_DividendsPayableDateDeclaredDayMonthAndYear" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Dividends Payable, Date Declared</link:label>
    <link:label id="lab_us-gaap_DividendsPayableDateDeclaredDayMonthAndYear_label_en-US" xlink:label="lab_us-gaap_DividendsPayableDateDeclaredDayMonthAndYear" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Dividends Payable, Date Declared</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsPayableDateDeclaredDayMonthAndYear" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DividendsPayableDateDeclaredDayMonthAndYear"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DividendsPayableDateDeclaredDayMonthAndYear" xlink:to="lab_us-gaap_DividendsPayableDateDeclaredDayMonthAndYear" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfAccruedLiabilitiesTableTextBlock_7502ca2f-762f-4693-a0d5-8a5b13a5d2bd_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfAccruedLiabilitiesTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Constituents of Accrued Expenses</link:label>
    <link:label id="lab_us-gaap_ScheduleOfAccruedLiabilitiesTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfAccruedLiabilitiesTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Accrued Liabilities [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAccruedLiabilitiesTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfAccruedLiabilitiesTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfAccruedLiabilitiesTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfAccruedLiabilitiesTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AwardTypeAxis_e6b98e7b-f383-4a27-9335-aaaf5bc9183e_terseLabel_en-US" xlink:label="lab_us-gaap_AwardTypeAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Award Type [Axis]</link:label>
    <link:label id="lab_us-gaap_AwardTypeAxis_label_en-US" xlink:label="lab_us-gaap_AwardTypeAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Award Type [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AwardTypeAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AwardTypeAxis" xlink:to="lab_us-gaap_AwardTypeAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_0915d2bc-a89a-4bb7-bfb0-ef268f9324a9_terseLabel_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash flows from financing activities:</link:label>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_label_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Cash Provided by (Used in) Financing Activities [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:to="lab_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock_96d7269a-b625-48d3-8f3d-7d11b28fd8b9_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of lease payments</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, Maturity [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityMaturityTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockholdersEquity_b0d01067-cc35-49eb-a9bd-139a558bdbcd_totalLabel_en-US" xlink:label="lab_us-gaap_StockholdersEquity" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total shareholders&#8217; equity</link:label>
    <link:label id="lab_us-gaap_StockholdersEquity_d90bc4e1-0e16-4e15-8177-95c870a6093a_periodStartLabel_en-US" xlink:label="lab_us-gaap_StockholdersEquity" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning Balance</link:label>
    <link:label id="lab_us-gaap_StockholdersEquity_a85f4972-98ad-48c1-8acc-3db941b726c7_periodEndLabel_en-US" xlink:label="lab_us-gaap_StockholdersEquity" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance</link:label>
    <link:label id="lab_us-gaap_StockholdersEquity_label_en-US" xlink:label="lab_us-gaap_StockholdersEquity" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stockholders' Equity Attributable to Parent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquity"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockholdersEquity" xlink:to="lab_us-gaap_StockholdersEquity" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_CityAreaCode_50dbc182-4577-4a64-b8ae-6a5697e442f6_terseLabel_en-US" xlink:label="lab_dei_CityAreaCode" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">City Area Code</link:label>
    <link:label id="lab_dei_CityAreaCode_label_en-US" xlink:label="lab_dei_CityAreaCode" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">City Area Code</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CityAreaCode" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_CityAreaCode"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_CityAreaCode" xlink:to="lab_dei_CityAreaCode" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized_a9712669-7086-4d31-9e1c-e12305b7a780_terseLabel_en-US" xlink:label="lab_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease expense for which no liability or asset was recognized</link:label>
    <link:label id="lab_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized_label_en-US" xlink:label="lab_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Expense, No Liability Or Asset Recognized</link:label>
    <link:label id="lab_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized_documentation_en-US" xlink:label="lab_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Expense, No Liability Or Asset Recognized</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized" xlink:href="cgnx-20211231.xsd#cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized" xlink:to="lab_cgnx_OperatingLeaseExpenseNoLiabilityOrAssetRecognized" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_MaximumInvestmentOfCompanyInPartnership_816c1206-b5e7-4c12-a2f4-3ea5aa6fcb93_terseLabel_en-US" xlink:label="lab_cgnx_MaximumInvestmentOfCompanyInPartnership" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum investment of the company in partnership</link:label>
    <link:label id="lab_cgnx_MaximumInvestmentOfCompanyInPartnership_label_en-US" xlink:label="lab_cgnx_MaximumInvestmentOfCompanyInPartnership" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum Investment Of Company In Partnership</link:label>
    <link:label id="lab_cgnx_MaximumInvestmentOfCompanyInPartnership_documentation_en-US" xlink:label="lab_cgnx_MaximumInvestmentOfCompanyInPartnership" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum investment of the company in partnership.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_MaximumInvestmentOfCompanyInPartnership" xlink:href="cgnx-20211231.xsd#cgnx_MaximumInvestmentOfCompanyInPartnership"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_MaximumInvestmentOfCompanyInPartnership" xlink:to="lab_cgnx_MaximumInvestmentOfCompanyInPartnership" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract_5d3bb872-842e-4fb5-89b5-3688508abe70_terseLabel_en-US" xlink:label="lab_us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill and Intangible Assets Disclosure [Abstract]</link:label>
    <link:label id="lab_us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract_label_en-US" xlink:label="lab_us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill and Intangible Assets Disclosure [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:to="lab_us-gaap_GoodwillAndIntangibleAssetsDisclosureAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseDomain_e209ade5-a28f-4b4e-806b-ecc4dd65c0ff_terseLabel_en-US" xlink:label="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property Subject to or Available for Operating Lease [Domain]</link:label>
    <link:label id="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseDomain_label_en-US" xlink:label="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property Subject to or Available for Operating Lease [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertySubjectToOrAvailableForOperatingLeaseDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseDomain" xlink:to="lab_us-gaap_PropertySubjectToOrAvailableForOperatingLeaseDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IntangibleAssetsDisclosureTextBlock_9fd842fb-7258-43e6-b2d1-e675ef6e8f50_terseLabel_en-US" xlink:label="lab_us-gaap_IntangibleAssetsDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible Assets</link:label>
    <link:label id="lab_us-gaap_IntangibleAssetsDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_IntangibleAssetsDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible Assets Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IntangibleAssetsDisclosureTextBlock" xlink:to="lab_us-gaap_IntangibleAssetsDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsForRepurchaseOfCommonStock_01104947-017c-4c1d-9459-f9b776e23f6c_negatedLabel_en-US" xlink:label="lab_us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase of common stock</link:label>
    <link:label id="lab_us-gaap_PaymentsForRepurchaseOfCommonStock_label_en-US" xlink:label="lab_us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments for Repurchase of Common Stock</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:to="lab_us-gaap_PaymentsForRepurchaseOfCommonStock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentUsefulLife_1ef44e2c-19ff-409f-96f6-fb4a761a067c_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment, Useful Life</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentUsefulLife_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment, Useful Life</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockholdersEquityAbstract_42db2780-e27a-44c5-aa98-3ff1598434c8_terseLabel_en-US" xlink:label="lab_us-gaap_StockholdersEquityAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Shareholders&#8217; equity:</link:label>
    <link:label id="lab_us-gaap_StockholdersEquityAbstract_label_en-US" xlink:label="lab_us-gaap_StockholdersEquityAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stockholders' Equity Attributable to Parent [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquityAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockholdersEquityAbstract" xlink:to="lab_us-gaap_StockholdersEquityAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxAuthorityNameDomain_d79d9567-c5b0-49a4-b394-2548c534dbd2_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxAuthorityNameDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Authority, Name [Domain]</link:label>
    <link:label id="lab_us-gaap_IncomeTaxAuthorityNameDomain_label_en-US" xlink:label="lab_us-gaap_IncomeTaxAuthorityNameDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Authority, Name [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityNameDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxAuthorityNameDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameDomain" xlink:to="lab_us-gaap_IncomeTaxAuthorityNameDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseLiabilityNoncurrent_4899443f-d095-4ffa-a31b-4d82ea940689_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Non-current operating lease liabilities</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseLiabilityNoncurrent_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Liability, Noncurrent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiabilityNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:to="lab_us-gaap_OperatingLeaseLiabilityNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CurrentIncomeTaxExpenseBenefit_5df6a520-5ef8-41dc-a0bf-1073cef7df2f_totalLabel_en-US" xlink:label="lab_us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current income tax expense (benefit), Total</link:label>
    <link:label id="lab_us-gaap_CurrentIncomeTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current Income Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:to="lab_us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_37bdc97e-9cf2-498a-8057-35066f4ed08c_terseLabel_en-US" xlink:label="lab_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax benefit recognized related to stock-based compensation expense</link:label>
    <link:label id="lab_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_label_en-US" xlink:label="lab_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Expense, Tax Benefit</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense" xlink:to="lab_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfTwoYear_c4145980-84eb-4609-ab27-3baf74cceea8_terseLabel_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfTwoYear" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company contributions vest at end of two years</link:label>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfTwoYear_label_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfTwoYear" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company Contributions Vest At End Of Two Year</link:label>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfTwoYear_documentation_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfTwoYear" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company contributions vest at end of two year.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompanyContributionsVestAtEndOfTwoYear" xlink:href="cgnx-20211231.xsd#cgnx_CompanyContributionsVestAtEndOfTwoYear"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CompanyContributionsVestAtEndOfTwoYear" xlink:to="lab_cgnx_CompanyContributionsVestAtEndOfTwoYear" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ResearchDevelopmentAndComputerSoftwarePolicyTextBlock_23ce5328-6b8e-40ab-83a4-5c1634894b2a_terseLabel_en-US" xlink:label="lab_us-gaap_ResearchDevelopmentAndComputerSoftwarePolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Research and Development</link:label>
    <link:label id="lab_us-gaap_ResearchDevelopmentAndComputerSoftwarePolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_ResearchDevelopmentAndComputerSoftwarePolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Research, Development, and Computer Software, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchDevelopmentAndComputerSoftwarePolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ResearchDevelopmentAndComputerSoftwarePolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ResearchDevelopmentAndComputerSoftwarePolicyTextBlock" xlink:to="lab_us-gaap_ResearchDevelopmentAndComputerSoftwarePolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativesFairValueLineItems_23757a21-f166-4e37-b8b2-fd4c304b54a2_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativesFairValueLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivatives, Fair Value [Line Items]</link:label>
    <link:label id="lab_us-gaap_DerivativesFairValueLineItems_label_en-US" xlink:label="lab_us-gaap_DerivativesFairValueLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivatives, Fair Value [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativesFairValueLineItems" xlink:to="lab_us-gaap_DerivativesFairValueLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestrictedStockUnitsRSUMember_920cb422-eb5b-49a4-9f5c-5ba9495d33d3_terseLabel_en-US" xlink:label="lab_us-gaap_RestrictedStockUnitsRSUMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restricted Stock Units (RSUs) [Member]</link:label>
    <link:label id="lab_us-gaap_RestrictedStockUnitsRSUMember_label_en-US" xlink:label="lab_us-gaap_RestrictedStockUnitsRSUMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restricted Stock Units (RSUs) [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestrictedStockUnitsRSUMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestrictedStockUnitsRSUMember" xlink:to="lab_us-gaap_RestrictedStockUnitsRSUMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_USTreasuryBillSecuritiesMember_9b0e466e-4028-4689-a6e6-9bdf55f665a8_verboseLabel_en-US" xlink:label="lab_us-gaap_USTreasuryBillSecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Treasury Bills [Member]</link:label>
    <link:label id="lab_us-gaap_USTreasuryBillSecuritiesMember_label_en-US" xlink:label="lab_us-gaap_USTreasuryBillSecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">US Treasury Bill Securities [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasuryBillSecuritiesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_USTreasuryBillSecuritiesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_USTreasuryBillSecuritiesMember" xlink:to="lab_us-gaap_USTreasuryBillSecuritiesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_RestatementDomain_657ffe8a-78d2-4be2-a7b6-5b98ac2146f1_terseLabel_en-US" xlink:label="lab_srt_RestatementDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restatement [Domain]</link:label>
    <link:label id="lab_srt_RestatementDomain_label_en-US" xlink:label="lab_srt_RestatementDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revision of Prior Period [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RestatementDomain" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RestatementDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_RestatementDomain" xlink:to="lab_srt_RestatementDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesChargedToOtherAccounts_9883675b-a580-4afa-b604-3a58cc1d87f4_terseLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesChargedToOtherAccounts" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves, Additions, Charge to Other Account</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesChargedToOtherAccounts_label_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesChargedToOtherAccounts" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves, Additions, Charge to Other Account</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesChargedToOtherAccounts" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ValuationAllowancesAndReservesChargedToOtherAccounts"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesChargedToOtherAccounts" xlink:to="lab_us-gaap_ValuationAllowancesAndReservesChargedToOtherAccounts" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessAcquisitionLineItems_e530d004-7fc9-4a75-83eb-1ed2af227eec_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessAcquisitionLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Acquisition [Line Items]</link:label>
    <link:label id="lab_us-gaap_BusinessAcquisitionLineItems_label_en-US" xlink:label="lab_us-gaap_BusinessAcquisitionLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Acquisition [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems" xlink:to="lab_us-gaap_BusinessAcquisitionLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredIncomeTaxLiabilities_b36db962-277a-46c3-b451-dcfb7d5e3eb5_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxLiabilities" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred tax liabilities</link:label>
    <link:label id="lab_us-gaap_DeferredIncomeTaxLiabilities_label_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxLiabilities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Liabilities, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities" xlink:to="lab_us-gaap_DeferredIncomeTaxLiabilities" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch_344ceaaf-9bbe-45a9-a7ed-ef53dd2305dc_terseLabel_en-US" xlink:label="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company match percent</link:label>
    <link:label id="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch_label_en-US" xlink:label="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Defined Contribution Plan, Employer Matching Contribution, Percent of Match</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch" xlink:to="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareRepurchaseProgramAxis_d92d8830-ff9c-46c3-b0be-9ffb532c9dde_terseLabel_en-US" xlink:label="lab_us-gaap_ShareRepurchaseProgramAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share Repurchase Program [Axis]</link:label>
    <link:label id="lab_us-gaap_ShareRepurchaseProgramAxis_label_en-US" xlink:label="lab_us-gaap_ShareRepurchaseProgramAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share Repurchase Program [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareRepurchaseProgramAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareRepurchaseProgramAxis" xlink:to="lab_us-gaap_ShareRepurchaseProgramAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeStatementAbstract_87ca9acc-f6ba-4874-9e0b-92af117d411a_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeStatementAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Statement [Abstract]</link:label>
    <link:label id="lab_us-gaap_IncomeStatementAbstract_label_en-US" xlink:label="lab_us-gaap_IncomeStatementAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Statement [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeStatementAbstract" xlink:to="lab_us-gaap_IncomeStatementAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityRegistrantName_0564268e-4f66-46c0-9048-3df38c6a597c_terseLabel_en-US" xlink:label="lab_dei_EntityRegistrantName" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Registrant Name</link:label>
    <link:label id="lab_dei_EntityRegistrantName_label_en-US" xlink:label="lab_dei_EntityRegistrantName" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Registrant Name</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityRegistrantName" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityRegistrantName"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityRegistrantName" xlink:to="lab_dei_EntityRegistrantName" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ChangeInAccountingEstimateLineItems_b71785e8-2829-4ff9-abd1-b505ba971759_terseLabel_en-US" xlink:label="lab_us-gaap_ChangeInAccountingEstimateLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in Accounting Estimate [Line Items]</link:label>
    <link:label id="lab_us-gaap_ChangeInAccountingEstimateLineItems_label_en-US" xlink:label="lab_us-gaap_ChangeInAccountingEstimateLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in Accounting Estimate [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ChangeInAccountingEstimateLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ChangeInAccountingEstimateLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ChangeInAccountingEstimateLineItems" xlink:to="lab_us-gaap_ChangeInAccountingEstimateLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_LongTermInvestmentsMember_add8e42c-4555-414f-b9fd-481e88e6cd95_terseLabel_en-US" xlink:label="lab_cgnx_LongTermInvestmentsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long-term investments [Member]</link:label>
    <link:label id="lab_cgnx_LongTermInvestmentsMember_label_en-US" xlink:label="lab_cgnx_LongTermInvestmentsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long Term Investments [Member]</link:label>
    <link:label id="lab_cgnx_LongTermInvestmentsMember_documentation_en-US" xlink:label="lab_cgnx_LongTermInvestmentsMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long-term investments.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_LongTermInvestmentsMember" xlink:href="cgnx-20211231.xsd#cgnx_LongTermInvestmentsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_LongTermInvestmentsMember" xlink:to="lab_cgnx_LongTermInvestmentsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesDeductions_366b7a10-bff8-468b-8d73-da8b5d4d2d67_negatedLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesDeductions" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deductions</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesDeductions_label_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesDeductions" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves, Deduction</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesDeductions" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ValuationAllowancesAndReservesDeductions"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesDeductions" xlink:to="lab_us-gaap_ValuationAllowancesAndReservesDeductions" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProductWarrantyAccrualWarrantiesIssued_e4547006-aa26-42c3-9998-74409e25dfb8_terseLabel_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrualWarrantiesIssued" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Provisions for warranties issued during the period</link:label>
    <link:label id="lab_us-gaap_ProductWarrantyAccrualWarrantiesIssued_label_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrualWarrantiesIssued" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Standard and Extended Product Warranty Accrual, Increase for Warranties Issued</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProductWarrantyAccrualWarrantiesIssued" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProductWarrantyAccrualWarrantiesIssued"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProductWarrantyAccrualWarrantiesIssued" xlink:to="lab_us-gaap_ProductWarrantyAccrualWarrantiesIssued" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxExpenseBenefit_e7461f00-502a-4e91-86bb-583d8224f1f9_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax expense on continuing operations</link:label>
    <link:label id="lab_us-gaap_IncomeTaxExpenseBenefit_2efbc698-765a-4059-93e1-c759502b7cb1_totalLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax expense (benefit), continuing operations, Total</link:label>
    <link:label id="lab_us-gaap_IncomeTaxExpenseBenefit_6ad62f38-e2cd-45e0-b395-ca10bdc6d08c_verboseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax expense (benefit)</link:label>
    <link:label id="lab_us-gaap_IncomeTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_IncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxExpenseBenefit" xlink:to="lab_us-gaap_IncomeTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GoodwillOtherIncreaseDecrease_df3e00af-5b35-428c-a78e-6d43e63c5570_terseLabel_en-US" xlink:label="lab_us-gaap_GoodwillOtherIncreaseDecrease" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill, Other Increase (Decrease)</link:label>
    <link:label id="lab_us-gaap_GoodwillOtherIncreaseDecrease_label_en-US" xlink:label="lab_us-gaap_GoodwillOtherIncreaseDecrease" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill, Other Increase (Decrease)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillOtherIncreaseDecrease" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillOtherIncreaseDecrease"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GoodwillOtherIncreaseDecrease" xlink:to="lab_us-gaap_GoodwillOtherIncreaseDecrease" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccountsReceivableNetCurrent_bdaa1d32-847d-49e0-bf8a-33e966dc97a7_terseLabel_en-US" xlink:label="lab_us-gaap_AccountsReceivableNetCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts receivable, allowance for credit losses of $776 and $831 in 2021 and 2020, respectively</link:label>
    <link:label id="lab_us-gaap_AccountsReceivableNetCurrent_label_en-US" xlink:label="lab_us-gaap_AccountsReceivableNetCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable, after Allowance for Credit Loss, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsReceivableNetCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsReceivableNetCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccountsReceivableNetCurrent" xlink:to="lab_us-gaap_AccountsReceivableNetCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsInventory_3744351a-ef7d-4622-b6a6-888e2b4b1ca1_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsInventory" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory and revenue related</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsInventory_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsInventory" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Inventory</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsInventory" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsInventory"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsInventory" xlink:to="lab_us-gaap_DeferredTaxAssetsInventory" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable_a17065bc-7291-4066-9ecb-d87e2d5fe4bc_terseLabel_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Other Comprehensive Income (Loss) [Table]</link:label>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable_label_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Other Comprehensive Income (Loss) [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable" xlink:to="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossTable" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityTaxIdentificationNumber_925a9fd6-ee81-480e-b864-19a86cbf22d5_terseLabel_en-US" xlink:label="lab_dei_EntityTaxIdentificationNumber" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Tax Identification Number</link:label>
    <link:label id="lab_dei_EntityTaxIdentificationNumber_label_en-US" xlink:label="lab_dei_EntityTaxIdentificationNumber" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Tax Identification Number</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityTaxIdentificationNumber" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityTaxIdentificationNumber"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityTaxIdentificationNumber" xlink:to="lab_dei_EntityTaxIdentificationNumber" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InvestmentTypeAxis_92924ffb-664c-45a7-b012-7d8c21f78d0e_terseLabel_en-US" xlink:label="lab_us-gaap_InvestmentTypeAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investment Type [Axis]</link:label>
    <link:label id="lab_us-gaap_InvestmentTypeAxis_label_en-US" xlink:label="lab_us-gaap_InvestmentTypeAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investment Type [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentTypeAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InvestmentTypeAxis" xlink:to="lab_us-gaap_InvestmentTypeAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_DocumentFiscalPeriodFocus_d2305af2-4bc0-4d61-be1e-0a35b14db7de_terseLabel_en-US" xlink:label="lab_dei_DocumentFiscalPeriodFocus" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Fiscal Period Focus</link:label>
    <link:label id="lab_dei_DocumentFiscalPeriodFocus_label_en-US" xlink:label="lab_dei_DocumentFiscalPeriodFocus" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Fiscal Period Focus</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentFiscalPeriodFocus" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentFiscalPeriodFocus"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_DocumentFiscalPeriodFocus" xlink:to="lab_dei_DocumentFiscalPeriodFocus" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AssetsCurrent_a5be63fd-ca8b-405f-9568-ba862d383d58_totalLabel_en-US" xlink:label="lab_us-gaap_AssetsCurrent" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total current assets</link:label>
    <link:label id="lab_us-gaap_AssetsCurrent_label_en-US" xlink:label="lab_us-gaap_AssetsCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Assets, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AssetsCurrent" xlink:to="lab_us-gaap_AssetsCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccountsReceivableMember_76fc4356-cab7-415c-b18a-d100477a651a_terseLabel_en-US" xlink:label="lab_us-gaap_AccountsReceivableMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable [Member]</link:label>
    <link:label id="lab_us-gaap_AccountsReceivableMember_label_en-US" xlink:label="lab_us-gaap_AccountsReceivableMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsReceivableMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsReceivableMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccountsReceivableMember" xlink:to="lab_us-gaap_AccountsReceivableMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_d8428268-c527-4edb-ba14-28ceff9918ca_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, Payments, Due</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_429411c5-bb80-4792-8b51-401345d1f42f_totalLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, to be Paid</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_087068f7-341e-4d72-9f91-f7b7bb0255ab_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Forfeited or expired</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Forfeited in Period</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfStockByClassTable_f70f2f74-16ac-424a-9cb1-9d20d5b29a37_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfStockByClassTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Stock by Class [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfStockByClassTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfStockByClassTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Stock by Class [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfStockByClassTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfStockByClassTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfStockByClassTable" xlink:to="lab_us-gaap_ScheduleOfStockByClassTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy_2a951cdb-7491-4c14-b0f1-9676a2e50959_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock-Based Compensation</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" xlink:to="lab_us-gaap_ShareBasedCompensationOptionAndIncentivePlansPolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockRepurchasedDuringPeriodValue_35f72449-961c-4a47-a9bd-0584f438e9ba_negatedLabel_en-US" xlink:label="lab_us-gaap_StockRepurchasedDuringPeriodValue" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase of common stock</link:label>
    <link:label id="lab_us-gaap_StockRepurchasedDuringPeriodValue_59268c59-f186-4fc0-87c2-7f93e219547e_verboseLabel_en-US" xlink:label="lab_us-gaap_StockRepurchasedDuringPeriodValue" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase of common stock</link:label>
    <link:label id="lab_us-gaap_StockRepurchasedDuringPeriodValue_label_en-US" xlink:label="lab_us-gaap_StockRepurchasedDuringPeriodValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Repurchased During Period, Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockRepurchasedDuringPeriodValue" xlink:to="lab_us-gaap_StockRepurchasedDuringPeriodValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StatementOfFinancialPositionAbstract_dc646e1b-c181-4ba7-92e0-07eecfd8c914_terseLabel_en-US" xlink:label="lab_us-gaap_StatementOfFinancialPositionAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement of Financial Position [Abstract]</link:label>
    <link:label id="lab_us-gaap_StatementOfFinancialPositionAbstract_label_en-US" xlink:label="lab_us-gaap_StatementOfFinancialPositionAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement of Financial Position [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementOfFinancialPositionAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementOfFinancialPositionAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StatementOfFinancialPositionAbstract" xlink:to="lab_us-gaap_StatementOfFinancialPositionAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_ValuationAndQualifyingAccountsAbstract_33671e68-06ed-4811-94cd-1bc4e33e4046_terseLabel_en-US" xlink:label="lab_srt_ValuationAndQualifyingAccountsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation and Qualifying Accounts [Abstract]</link:label>
    <link:label id="lab_srt_ValuationAndQualifyingAccountsAbstract_label_en-US" xlink:label="lab_srt_ValuationAndQualifyingAccountsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation and Qualifying Accounts [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ValuationAndQualifyingAccountsAbstract" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ValuationAndQualifyingAccountsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_ValuationAndQualifyingAccountsAbstract" xlink:to="lab_srt_ValuationAndQualifyingAccountsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTextBlock_1ce4dff1-23d8-44b1-8f20-8218e06756b9_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Change in Accounting Policy</link:label>
    <link:label id="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Change in Accounting Estimate [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfChangeInAccountingEstimateTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfChangeInAccountingEstimateTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfChangeInAccountingEstimateTextBlock" xlink:to="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions_48e805c3-6f90-46f0-8f53-ff05118ef497_terseLabel_en-US" xlink:label="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total unrecognized compensation expense related to non-vested stock options</link:label>
    <link:label id="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions_label_en-US" xlink:label="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Nonvested Award, Option, Cost Not yet Recognized, Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions" xlink:to="lab_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentTypeDomain_691dc65e-9716-4ded-9096-58d0115f5df4_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment, Type [Domain]</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentTypeDomain_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long-Lived Tangible Asset [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfWeightedAverageNumberOfSharesTableTextBlock_7984008b-f0a2-4f84-88b4-e3ead3dcc1d6_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfWeightedAverageNumberOfSharesTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Calculation of Weighted Average Shares</link:label>
    <link:label id="lab_us-gaap_ScheduleOfWeightedAverageNumberOfSharesTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfWeightedAverageNumberOfSharesTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Weighted Average Number of Shares [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfWeightedAverageNumberOfSharesTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfWeightedAverageNumberOfSharesTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfWeightedAverageNumberOfSharesTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfWeightedAverageNumberOfSharesTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeInstrumentsGainLossLineItems_f4e8594c-5135-4dd5-bdb4-65c3c8ab3788_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeInstrumentsGainLossLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments, Gain (Loss) [Line Items]</link:label>
    <link:label id="lab_us-gaap_DerivativeInstrumentsGainLossLineItems_label_en-US" xlink:label="lab_us-gaap_DerivativeInstrumentsGainLossLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments, Gain (Loss) [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossLineItems" xlink:to="lab_us-gaap_DerivativeInstrumentsGainLossLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SalesRevenueNetMember_86b65f37-dd91-449a-a3a2-005bef0275b1_verboseLabel_en-US" xlink:label="lab_us-gaap_SalesRevenueNetMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total Revenue</link:label>
    <link:label id="lab_us-gaap_SalesRevenueNetMember_label_en-US" xlink:label="lab_us-gaap_SalesRevenueNetMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue Benchmark [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SalesRevenueNetMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SalesRevenueNetMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SalesRevenueNetMember" xlink:to="lab_us-gaap_SalesRevenueNetMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_dd07326f-5152-480b-adf9-3c88b20d6b2a_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted-average grant-date fair values of stock options granted</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Grants in Period, Weighted Average Grant Date Fair Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EquityComponentDomain_385179cf-8a74-482c-97eb-d3721a5c5315_terseLabel_en-US" xlink:label="lab_us-gaap_EquityComponentDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Equity Component [Domain]</link:label>
    <link:label id="lab_us-gaap_EquityComponentDomain_label_en-US" xlink:label="lab_us-gaap_EquityComponentDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Equity Component [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquityComponentDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EquityComponentDomain" xlink:to="lab_us-gaap_EquityComponentDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_ddc4a8cc-3513-4ef2-96d8-8ca626907952_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2022</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, to be Paid, Year One</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ExcessAndObsoleteInventoryCharges_786f1807-6d68-4c0e-ab2b-dde903ed4a04_terseLabel_en-US" xlink:label="lab_cgnx_ExcessAndObsoleteInventoryCharges" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Excess and Obsolete Inventory Charges</link:label>
    <link:label id="lab_cgnx_ExcessAndObsoleteInventoryCharges_label_en-US" xlink:label="lab_cgnx_ExcessAndObsoleteInventoryCharges" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Excess and Obsolete Inventory Charges</link:label>
    <link:label id="lab_cgnx_ExcessAndObsoleteInventoryCharges_documentation_en-US" xlink:label="lab_cgnx_ExcessAndObsoleteInventoryCharges" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Excess and Obsolete Inventory Charges</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ExcessAndObsoleteInventoryCharges" xlink:href="cgnx-20211231.xsd#cgnx_ExcessAndObsoleteInventoryCharges"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ExcessAndObsoleteInventoryCharges" xlink:to="lab_cgnx_ExcessAndObsoleteInventoryCharges" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AssetBackedSecuritiesFairValueDisclosure_709158ce-d207-4510-98bc-84e678ddedd8_verboseLabel_en-US" xlink:label="lab_cgnx_AssetBackedSecuritiesFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Asset-backed securities</link:label>
    <link:label id="lab_cgnx_AssetBackedSecuritiesFairValueDisclosure_label_en-US" xlink:label="lab_cgnx_AssetBackedSecuritiesFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Asset Backed Securities Fair Value Disclosure</link:label>
    <link:label id="lab_cgnx_AssetBackedSecuritiesFairValueDisclosure_documentation_en-US" xlink:label="lab_cgnx_AssetBackedSecuritiesFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Asset Backed Securities Fair Value Disclosure</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AssetBackedSecuritiesFairValueDisclosure" xlink:href="cgnx-20211231.xsd#cgnx_AssetBackedSecuritiesFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AssetBackedSecuritiesFairValueDisclosure" xlink:to="lab_cgnx_AssetBackedSecuritiesFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ExpirationPeriodOfStockOptionPlan_5afe3274-63c8-4c95-8535-105003ae116c_terseLabel_en-US" xlink:label="lab_cgnx_ExpirationPeriodOfStockOptionPlan" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Expiration period of stock option plan</link:label>
    <link:label id="lab_cgnx_ExpirationPeriodOfStockOptionPlan_label_en-US" xlink:label="lab_cgnx_ExpirationPeriodOfStockOptionPlan" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Expiration Period Of Stock Option Plan</link:label>
    <link:label id="lab_cgnx_ExpirationPeriodOfStockOptionPlan_documentation_en-US" xlink:label="lab_cgnx_ExpirationPeriodOfStockOptionPlan" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Expiration period of stock option plan.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ExpirationPeriodOfStockOptionPlan" xlink:href="cgnx-20211231.xsd#cgnx_ExpirationPeriodOfStockOptionPlan"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ExpirationPeriodOfStockOptionPlan" xlink:to="lab_cgnx_ExpirationPeriodOfStockOptionPlan" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent_6737bf35-8bea-4c2e-b7e6-d9047370b9dd_terseLabel_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long-term investments</link:label>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent_label_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Noncurrent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent" xlink:to="lab_us-gaap_AvailableForSaleSecuritiesDebtSecuritiesNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsToAcquireInvestments_ee0e3385-89c5-4775-9d57-8b1698d10b52_negatedLabel_en-US" xlink:label="lab_us-gaap_PaymentsToAcquireInvestments" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Purchases of investments</link:label>
    <link:label id="lab_us-gaap_PaymentsToAcquireInvestments_label_en-US" xlink:label="lab_us-gaap_PaymentsToAcquireInvestments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments to Acquire Investments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireInvestments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireInvestments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsToAcquireInvestments" xlink:to="lab_us-gaap_PaymentsToAcquireInvestments" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_JPY_898e897f-39b5-4f8f-b677-6dd2d64b8a5e_terseLabel_en-US" xlink:label="lab_currency_JPY" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Japanese Yen [Member]</link:label>
    <link:label id="lab_currency_JPY_label_en-US" xlink:label="lab_currency_JPY" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Japan, Yen</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_JPY" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_JPY"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_JPY" xlink:to="lab_currency_JPY" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments_4612ed4a-e3bb-40ae-b0c2-fab489813df5_terseLabel_en-US" xlink:label="lab_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maturities and sales of investments</link:label>
    <link:label id="lab_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments_label_en-US" xlink:label="lab_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Proceeds from Sale, Maturity and Collection of Investments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments" xlink:to="lab_us-gaap_ProceedsFromSaleMaturityAndCollectionsOfInvestments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShortTermInvestmentsMember_d1d2396f-29e0-4e4b-b053-457655d9d0cd_terseLabel_en-US" xlink:label="lab_us-gaap_ShortTermInvestmentsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Short-term Investments [Member]</link:label>
    <link:label id="lab_us-gaap_ShortTermInvestmentsMember_label_en-US" xlink:label="lab_us-gaap_ShortTermInvestmentsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Short-term Investments [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermInvestmentsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortTermInvestmentsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShortTermInvestmentsMember" xlink:to="lab_us-gaap_ShortTermInvestmentsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent_3af384ab-ed87-45dc-bda8-8ca0bfb2e90d_terseLabel_en-US" xlink:label="lab_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Credit recoveries</link:label>
    <link:label id="lab_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent_label_en-US" xlink:label="lab_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Than Temporary Impairment Losses Investments Portion Recognized In Earnings Net, non current</link:label>
    <link:label id="lab_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent_documentation_en-US" xlink:label="lab_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Than Temporary Impairment Losses Investments Portion Recognized In Earnings Net, non current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent" xlink:href="cgnx-20211231.xsd#cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent" xlink:to="lab_cgnx_OtherThanTemporaryImpairmentLossesInvestmentsPortionRecognizedInEarningsNetnoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_d0c8a51f-8387-41f6-ae3d-88d2579ffc92_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2025</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, to be Paid, Year Four</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_32613f57-61e4-40e0-82b4-ff8dc9463162_totalLabel_en-US" xlink:label="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income before income tax expense (benefit)</link:label>
    <link:label id="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3016693d-433e-41ea-b000-5d5baae80a73_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income before income tax expense</link:label>
    <link:label id="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_label_en-US" xlink:label="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income (Loss) from Continuing Operations before Income Taxes, Noncontrolling Interest</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:to="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueInputsLevel2Member_d842ba22-e677-4575-a7a6-ad115b1ae38f_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueInputsLevel2Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Significant&#160;Other Observable Inputs (Level&#160;2)</link:label>
    <link:label id="lab_us-gaap_FairValueInputsLevel2Member_label_en-US" xlink:label="lab_us-gaap_FairValueInputsLevel2Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Inputs, Level 2 [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueInputsLevel2Member" xlink:to="lab_us-gaap_FairValueInputsLevel2Member" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_OtherAsiaMember_189aeb10-1663-4a56-b60c-3b60b596658c_terseLabel_en-US" xlink:label="lab_cgnx_OtherAsiaMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Asia [Member]</link:label>
    <link:label id="lab_cgnx_OtherAsiaMember_label_en-US" xlink:label="lab_cgnx_OtherAsiaMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Asia [Member]</link:label>
    <link:label id="lab_cgnx_OtherAsiaMember_documentation_en-US" xlink:label="lab_cgnx_OtherAsiaMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Asia [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_OtherAsiaMember" xlink:href="cgnx-20211231.xsd#cgnx_OtherAsiaMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_OtherAsiaMember" xlink:to="lab_cgnx_OtherAsiaMember" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_AuditorLocation_6ef1b04d-bf60-4e5a-89ae-b12943b40536_terseLabel_en-US" xlink:label="lab_dei_AuditorLocation" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Auditor Location</link:label>
    <link:label id="lab_dei_AuditorLocation_label_en-US" xlink:label="lab_dei_AuditorLocation" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Auditor Location</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_AuditorLocation" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_AuditorLocation"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_AuditorLocation" xlink:to="lab_dei_AuditorLocation" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeGainLossOnDerivativeNet_d668820e-2cbe-4bd3-bcaa-ba18b7001d39_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeGainLossOnDerivativeNet" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gains (losses) recognized in net income</link:label>
    <link:label id="lab_us-gaap_DerivativeGainLossOnDerivativeNet_label_en-US" xlink:label="lab_us-gaap_DerivativeGainLossOnDerivativeNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative, Gain (Loss) on Derivative, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeGainLossOnDerivativeNet" xlink:to="lab_us-gaap_DerivativeGainLossOnDerivativeNet" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_bc063183-2010-4cfd-a626-4b1b823a2318_totalLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Unrealized Loss Position</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SegmentReportingAbstract_67a97a98-2063-42e7-9a7a-73368402cd91_terseLabel_en-US" xlink:label="lab_us-gaap_SegmentReportingAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Segment Reporting [Abstract]</link:label>
    <link:label id="lab_us-gaap_SegmentReportingAbstract_label_en-US" xlink:label="lab_us-gaap_SegmentReportingAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Segment Reporting [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SegmentReportingAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SegmentReportingAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SegmentReportingAbstract" xlink:to="lab_us-gaap_SegmentReportingAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_TypeOfRestructuringDomain_91d63e40-2d1c-4d7d-a36e-be75c3a006e1_terseLabel_en-US" xlink:label="lab_us-gaap_TypeOfRestructuringDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Type of Restructuring [Domain]</link:label>
    <link:label id="lab_us-gaap_TypeOfRestructuringDomain_label_en-US" xlink:label="lab_us-gaap_TypeOfRestructuringDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Type of Restructuring [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_TypeOfRestructuringDomain" xlink:to="lab_us-gaap_TypeOfRestructuringDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_2f2dc850-5e40-4e60-8f11-c3d4673a4e42_totalLabel_en-US" xlink:label="lab_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Amortized Cost</link:label>
    <link:label id="lab_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_label_en-US" xlink:label="lab_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Amortized Cost</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis" xlink:to="lab_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostNoncurrent_291458d2-2d9e-47f8-a49e-bfa6a3258b68_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Amortized Cost, Noncurrent</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostNoncurrent_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Amortized Cost, Noncurrent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostNoncurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostNoncurrent" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetUsefulLife_b59ea79f-b8f6-4a1b-a4cb-82a2eeeb4f32_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Asset, Useful Life</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetUsefulLife_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Asset, Useful Life</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetUsefulLife" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ChiaroTechnologiesLLCMember_93722105-0008-4f1b-a892-105293c26544_terseLabel_en-US" xlink:label="lab_cgnx_ChiaroTechnologiesLLCMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Chiaro Technologies LLC</link:label>
    <link:label id="lab_cgnx_ChiaroTechnologiesLLCMember_label_en-US" xlink:label="lab_cgnx_ChiaroTechnologiesLLCMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Chiaro Technologies LLC [Member]</link:label>
    <link:label id="lab_cgnx_ChiaroTechnologiesLLCMember_documentation_en-US" xlink:label="lab_cgnx_ChiaroTechnologiesLLCMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Chiaro Technologies LLC [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ChiaroTechnologiesLLCMember" xlink:href="cgnx-20211231.xsd#cgnx_ChiaroTechnologiesLLCMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ChiaroTechnologiesLLCMember" xlink:to="lab_cgnx_ChiaroTechnologiesLLCMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UseOfEstimates_86d16ac9-8b4a-4391-afa9-97a3e4566afd_terseLabel_en-US" xlink:label="lab_us-gaap_UseOfEstimates" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Use of Estimates in the Preparation of Financial Statements</link:label>
    <link:label id="lab_us-gaap_UseOfEstimates_label_en-US" xlink:label="lab_us-gaap_UseOfEstimates" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Use of Estimates, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UseOfEstimates" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UseOfEstimates"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UseOfEstimates" xlink:to="lab_us-gaap_UseOfEstimates" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_af428b19-b86c-4f3c-8f33-dcba59ac4638_totalLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other comprehensive income (loss), net of tax</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Comprehensive Income (Loss), Net of Tax, Portion Attributable to Parent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:to="lab_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_Security12bTitle_f7911869-7598-4d3a-a982-03572af2992d_terseLabel_en-US" xlink:label="lab_dei_Security12bTitle" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Title of 12(b) Security</link:label>
    <link:label id="lab_dei_Security12bTitle_label_en-US" xlink:label="lab_dei_Security12bTitle" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Title of 12(b) Security</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_Security12bTitle" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_Security12bTitle"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_Security12bTitle" xlink:to="lab_dei_Security12bTitle" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsForeign_e011b6a2-4fb0-4d16-8e52-6a97fe041370_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsForeign" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Tax Credit Carryforwards, Foreign</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsForeign_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsForeign" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Tax Credit Carryforwards, Foreign</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsForeign" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsForeign"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsForeign" xlink:to="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsForeign" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_RestatementAdjustmentMember_a0e69423-6878-44e4-bcbf-a00fb188d906_terseLabel_en-US" xlink:label="lab_srt_RestatementAdjustmentMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revision of Prior Period, Adjustment [Member]</link:label>
    <link:label id="lab_srt_RestatementAdjustmentMember_label_en-US" xlink:label="lab_srt_RestatementAdjustmentMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revision of Prior Period, Adjustment [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RestatementAdjustmentMember" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RestatementAdjustmentMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_RestatementAdjustmentMember" xlink:to="lab_srt_RestatementAdjustmentMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommonStockSharesAuthorized_7196bbc2-c1ca-48f9-8aa7-8fab8eff9962_terseLabel_en-US" xlink:label="lab_us-gaap_CommonStockSharesAuthorized" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common stock, shares authorized</link:label>
    <link:label id="lab_us-gaap_CommonStockSharesAuthorized_label_en-US" xlink:label="lab_us-gaap_CommonStockSharesAuthorized" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock, Shares Authorized</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesAuthorized" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockSharesAuthorized"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommonStockSharesAuthorized" xlink:to="lab_us-gaap_CommonStockSharesAuthorized" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease_6c91edd0-b042-4539-8793-3de3e518bf03_terseLabel_en-US" xlink:label="lab_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred revenue and customer deposits</link:label>
    <link:label id="lab_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease_label_en-US" xlink:label="lab_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract With Customer, Liability, Period Increase (Decrease)</link:label>
    <link:label id="lab_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease_documentation_en-US" xlink:label="lab_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract With Customer, Liability, Period Increase (Decrease)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease" xlink:href="cgnx-20211231.xsd#cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease" xlink:to="lab_cgnx_ContractWithCustomerLiabilityPeriodIncreaseDecrease" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements_9d11a6e0-8020-4987-9901-84966356b65e_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete tax expense (benefit) related to tax return filings</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Settlement, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlements" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_DocumentType_517b8bab-9440-4cac-a916-2a6eb3b59821_terseLabel_en-US" xlink:label="lab_dei_DocumentType" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Type</link:label>
    <link:label id="lab_dei_DocumentType_label_en-US" xlink:label="lab_dei_DocumentType" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Type</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentType" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentType"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_DocumentType" xlink:to="lab_dei_DocumentType" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_ProductsAndServicesDomain_033c0315-0d76-4b24-9be2-3845c5f28d2d_terseLabel_en-US" xlink:label="lab_srt_ProductsAndServicesDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product and Service [Domain]</link:label>
    <link:label id="lab_srt_ProductsAndServicesDomain_label_en-US" xlink:label="lab_srt_ProductsAndServicesDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product and Service [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ProductsAndServicesDomain" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ProductsAndServicesDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_ProductsAndServicesDomain" xlink:to="lab_srt_ProductsAndServicesDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationContingentConsiderationLiability_d7806506-cbe1-4291-afcc-ba035b2585b8_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contingent consideration liabilities</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationContingentConsiderationLiability_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combination, Contingent Consideration, Liability</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationLiability"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:to="lab_us-gaap_BusinessCombinationContingentConsiderationLiability" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_a9ed1f2f-75c1-4511-84a3-0aff2c653e10_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award [Line Items]</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueByMeasurementFrequencyAxis_cef8561f-fb59-41a6-8bed-c33fcc7cf83c_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueByMeasurementFrequencyAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Measurement Frequency [Axis]</link:label>
    <link:label id="lab_us-gaap_FairValueByMeasurementFrequencyAxis_label_en-US" xlink:label="lab_us-gaap_FairValueByMeasurementFrequencyAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Measurement Frequency [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueByMeasurementFrequencyAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis" xlink:to="lab_us-gaap_FairValueByMeasurementFrequencyAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_dabff35b-1932-48da-8efa-7650b3a7f4a5_totalLabel_en-US" xlink:label="lab_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total</link:label>
    <link:label id="lab_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_label_en-US" xlink:label="lab_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash Cash Equivalents Short Term And Long Term Investments</link:label>
    <link:label id="lab_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments_documentation_en-US" xlink:label="lab_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash, cash equivalents, short term and long term investments.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments" xlink:href="cgnx-20211231.xsd#cgnx_CashCashEquivalentsShortTermAndLongTermInvestments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments" xlink:to="lab_cgnx_CashCashEquivalentsShortTermAndLongTermInvestments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_9f6f7486-9840-45aa-8570-dadfae739f95_negatedLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reclassification of net realized (gain) loss into current operations</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_c17a7761-d708-4754-9cb7-01d0ef6e5995_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reclassification of net realized (gain) loss on the sale of available-for-sale investments</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_985d7829-6486-4c5b-878d-90b31b4e8294_verboseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net realized gains reclassified into current operations</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Comprehensive Income (Loss), Reclassification Adjustment from AOCI for Sale of Securities, Net of Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:to="lab_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember_5ff9d302-128f-4991-b093-550800759d64_terseLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Valuation Allowance [Member]</link:label>
    <link:label id="lab_us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember_label_en-US" xlink:label="lab_us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowance, Deferred Tax Asset [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:to="lab_us-gaap_ValuationAllowanceOfDeferredTaxAssetsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeTable_4123c188-a114-463e-b168-3a3dec4fc73d_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Share-based Compensation, Shares Authorized under Stock Option Plans, by Exercise Price Range [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Option, Exercise Price Range [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeTable" xlink:to="lab_us-gaap_ScheduleOfShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CorporateBondSecuritiesMember_9fc36410-4189-4de5-8844-626b5c8685b5_terseLabel_en-US" xlink:label="lab_us-gaap_CorporateBondSecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Corporate Bonds [Member]</link:label>
    <link:label id="lab_us-gaap_CorporateBondSecuritiesMember_label_en-US" xlink:label="lab_us-gaap_CorporateBondSecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Corporate Bond Securities [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CorporateBondSecuritiesMember" xlink:to="lab_us-gaap_CorporateBondSecuritiesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ChangeInAccountingEstimateByTypeAxis_9e168312-9c5c-4956-813e-8d018f7ab94c_terseLabel_en-US" xlink:label="lab_us-gaap_ChangeInAccountingEstimateByTypeAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in Accounting Estimate by Type [Axis]</link:label>
    <link:label id="lab_us-gaap_ChangeInAccountingEstimateByTypeAxis_label_en-US" xlink:label="lab_us-gaap_ChangeInAccountingEstimateByTypeAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in Accounting Estimate by Type [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ChangeInAccountingEstimateByTypeAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ChangeInAccountingEstimateByTypeAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ChangeInAccountingEstimateByTypeAxis" xlink:to="lab_us-gaap_ChangeInAccountingEstimateByTypeAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_StatementGeographicalAxis_b8b7cff0-8095-455e-8a50-17a2ed0b341d_terseLabel_en-US" xlink:label="lab_srt_StatementGeographicalAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Geographical [Axis]</link:label>
    <link:label id="lab_srt_StatementGeographicalAxis_label_en-US" xlink:label="lab_srt_StatementGeographicalAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Geographical [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_StatementGeographicalAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_StatementGeographicalAxis" xlink:to="lab_srt_StatementGeographicalAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_c2deac37-7727-45b2-9c68-a85544cb907c_terseLabel_en-US" xlink:label="lab_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Values Derivatives, Balance Sheet Location, by Derivative Contract Type [Table]</link:label>
    <link:label id="lab_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_label_en-US" xlink:label="lab_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Values Derivatives, Balance Sheet Location, by Derivative Contract Type [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable" xlink:to="lab_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CapitalizedContractCostGross_ded3f26d-5127-4e82-8721-7602e0f0e906_terseLabel_en-US" xlink:label="lab_us-gaap_CapitalizedContractCostGross" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Capitalized Contract Cost, Gross</link:label>
    <link:label id="lab_us-gaap_CapitalizedContractCostGross_label_en-US" xlink:label="lab_us-gaap_CapitalizedContractCostGross" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Capitalized Contract Cost, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CapitalizedContractCostGross" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CapitalizedContractCostGross"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CapitalizedContractCostGross" xlink:to="lab_us-gaap_CapitalizedContractCostGross" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SubsequentEventsTextBlock_1df9c1a5-cde4-4e0c-acc9-b6d1d1043809_terseLabel_en-US" xlink:label="lab_us-gaap_SubsequentEventsTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Events</link:label>
    <link:label id="lab_us-gaap_SubsequentEventsTextBlock_label_en-US" xlink:label="lab_us-gaap_SubsequentEventsTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Events [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventsTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SubsequentEventsTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SubsequentEventsTextBlock" xlink:to="lab_us-gaap_SubsequentEventsTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxReconciliationForeignIncomeTaxRateDifferential_733d7df1-b697-4f8d-bfbe-cea41ee4c9c9_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxReconciliationForeignIncomeTaxRateDifferential" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete tax benefit for changes to international tax structure</link:label>
    <link:label id="lab_us-gaap_IncomeTaxReconciliationForeignIncomeTaxRateDifferential_label_en-US" xlink:label="lab_us-gaap_IncomeTaxReconciliationForeignIncomeTaxRateDifferential" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Foreign Income Tax Rate Differential, Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxReconciliationForeignIncomeTaxRateDifferential" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxReconciliationForeignIncomeTaxRateDifferential"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxReconciliationForeignIncomeTaxRateDifferential" xlink:to="lab_us-gaap_IncomeTaxReconciliationForeignIncomeTaxRateDifferential" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InvestmentPolicyTextBlock_220d1feb-ab67-4341-92eb-671e3959cb20_terseLabel_en-US" xlink:label="lab_us-gaap_InvestmentPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investment, Policy</link:label>
    <link:label id="lab_us-gaap_InvestmentPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_InvestmentPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investment, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InvestmentPolicyTextBlock" xlink:to="lab_us-gaap_InvestmentPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInFinancingActivities_1eb1979b-1c17-45a7-b299-dd463fc5b744_totalLabel_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net cash used in financing activities</link:label>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInFinancingActivities_014c11ec-7a38-47c3-bbcc-6dd373998b75_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net cash used in financing activities</link:label>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInFinancingActivities_label_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Cash Provided by (Used in) Financing Activities</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:to="lab_us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract_d217dd86-b1d9-429d-8c6b-dd6a0d26fc3f_terseLabel_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted-average common and common-equivalent shares outstanding:</link:label>
    <link:label id="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract_label_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted Average Number of Shares Outstanding, Diluted [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract" xlink:to="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_SGD_980fe8e7-5b32-4359-84b7-b1cf044cbb47_terseLabel_en-US" xlink:label="lab_currency_SGD" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Singapore Dollar [Member]</link:label>
    <link:label id="lab_currency_SGD_label_en-US" xlink:label="lab_currency_SGD" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Singapore, Dollars</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_SGD" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_SGD"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_SGD" xlink:to="lab_currency_SGD" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_0699745b-0070-45b6-8937-85c130ac5164_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Vesting period for stock option plans</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Award Vesting Period</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestExpense_db580ed1-cdf2-4b88-bb00-f7c0d79f4eeb_terseLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax penalties and interest expense</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestExpense_label_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Income Tax Penalties and Interest Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestExpense" xlink:to="lab_us-gaap_UnrecognizedTaxBenefitsIncomeTaxPenaltiesAndInterestExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueDisclosuresTextBlock_5b1328bb-7bcc-4687-82af-3c0dd4046828_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueDisclosuresTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Measurements</link:label>
    <link:label id="lab_us-gaap_FairValueDisclosuresTextBlock_label_en-US" xlink:label="lab_us-gaap_FairValueDisclosuresTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Disclosures [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueDisclosuresTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueDisclosuresTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueDisclosuresTextBlock" xlink:to="lab_us-gaap_FairValueDisclosuresTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DistributionRightsMember_a66ecb9d-0055-496e-9d6a-9a981a252796_verboseLabel_en-US" xlink:label="lab_us-gaap_DistributionRightsMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Distribution Rights [Member]</link:label>
    <link:label id="lab_us-gaap_DistributionRightsMember_6ea6dc6f-dabc-4e51-8d30-1e34b4c53364_terseLabel_en-US" xlink:label="lab_us-gaap_DistributionRightsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Distribution Networks [Member]</link:label>
    <link:label id="lab_us-gaap_DistributionRightsMember_label_en-US" xlink:label="lab_us-gaap_DistributionRightsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Distribution Rights [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DistributionRightsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DistributionRightsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DistributionRightsMember" xlink:to="lab_us-gaap_DistributionRightsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringCharges_1b67f3fd-74d4-4758-a173-4eab61ea6144_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringCharges" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring charges</link:label>
    <link:label id="lab_us-gaap_RestructuringCharges_9ebcdba6-0edb-4def-8e6b-7141da7351a6_verboseLabel_en-US" xlink:label="lab_us-gaap_RestructuringCharges" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring charges</link:label>
    <link:label id="lab_us-gaap_RestructuringCharges_label_en-US" xlink:label="lab_us-gaap_RestructuringCharges" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Charges</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCharges" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCharges"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringCharges" xlink:to="lab_us-gaap_RestructuringCharges" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ConcentrationRiskByTypeAxis_799afc87-1cd8-4d95-9961-b913b6bf60bf_terseLabel_en-US" xlink:label="lab_us-gaap_ConcentrationRiskByTypeAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk Type [Axis]</link:label>
    <link:label id="lab_us-gaap_ConcentrationRiskByTypeAxis_label_en-US" xlink:label="lab_us-gaap_ConcentrationRiskByTypeAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk Type [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskByTypeAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskByTypeAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis" xlink:to="lab_us-gaap_ConcentrationRiskByTypeAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccruedSalariesCurrent_1c9fa9b1-075d-4ec8-956a-7da287badb4b_terseLabel_en-US" xlink:label="lab_us-gaap_AccruedSalariesCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Salaries and payroll taxes</link:label>
    <link:label id="lab_us-gaap_AccruedSalariesCurrent_label_en-US" xlink:label="lab_us-gaap_AccruedSalariesCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Salaries, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedSalariesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedSalariesCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccruedSalariesCurrent" xlink:to="lab_us-gaap_AccruedSalariesCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_11b2a4c9-82d3-4706-a745-a3b09065a95e_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2024</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Asset, Expected Amortization, Year Three</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ForeignCountryMember_81cfb09e-8283-4940-9b37-51daf0de79ac_terseLabel_en-US" xlink:label="lab_us-gaap_ForeignCountryMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Tax Authority [Member]</link:label>
    <link:label id="lab_us-gaap_ForeignCountryMember_label_en-US" xlink:label="lab_us-gaap_ForeignCountryMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Tax Authority [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCountryMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignCountryMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ForeignCountryMember" xlink:to="lab_us-gaap_ForeignCountryMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxLiabilitiesAbstract_a48e86c2-2c66-4002-933f-06ee0a1b0025_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxLiabilitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross deferred tax liabilities:</link:label>
    <link:label id="lab_us-gaap_DeferredTaxLiabilitiesAbstract_label_en-US" xlink:label="lab_us-gaap_DeferredTaxLiabilitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Liabilities, Gross [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxLiabilitiesAbstract" xlink:to="lab_us-gaap_DeferredTaxLiabilitiesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationsPolicy_e30e8973-5344-4b07-a4c4-ed4724beef86_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationsPolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combinations</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationsPolicy_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationsPolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combinations Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationsPolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationsPolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationsPolicy" xlink:to="lab_us-gaap_BusinessCombinationsPolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeTable_163e3e8d-722f-484d-98e7-d64d8878a45a_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative [Table]</link:label>
    <link:label id="lab_us-gaap_DerivativeTable_label_en-US" xlink:label="lab_us-gaap_DerivativeTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeTable" xlink:to="lab_us-gaap_DerivativeTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy_42f5e09e-bfe9-476b-9be8-aef0b46dd7b9_terseLabel_en-US" xlink:label="lab_us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill</link:label>
    <link:label id="lab_us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy_label_en-US" xlink:label="lab_us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill and Intangible Assets, Goodwill, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" xlink:to="lab_us-gaap_GoodwillAndIntangibleAssetsGoodwillPolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_DocumentPeriodEndDate_ed94a32f-cca8-48d0-937c-01b849fd681c_terseLabel_en-US" xlink:label="lab_dei_DocumentPeriodEndDate" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Period End Date</link:label>
    <link:label id="lab_dei_DocumentPeriodEndDate_label_en-US" xlink:label="lab_dei_DocumentPeriodEndDate" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Period End Date</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentPeriodEndDate" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentPeriodEndDate"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_DocumentPeriodEndDate" xlink:to="lab_dei_DocumentPeriodEndDate" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_RetirementAllowance_8b13b541-a5bf-4c22-9729-25c98348501f_terseLabel_en-US" xlink:label="lab_cgnx_RetirementAllowance" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign retirement obligations</link:label>
    <link:label id="lab_cgnx_RetirementAllowance_label_en-US" xlink:label="lab_cgnx_RetirementAllowance" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retirement Allowance</link:label>
    <link:label id="lab_cgnx_RetirementAllowance_documentation_en-US" xlink:label="lab_cgnx_RetirementAllowance" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retirement allowance Japan.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_RetirementAllowance" xlink:href="cgnx-20211231.xsd#cgnx_RetirementAllowance"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_RetirementAllowance" xlink:to="lab_cgnx_RetirementAllowance" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ConcentrationRiskBenchmarkDomain_f2199ca9-0651-482d-8dfe-f00bb6a38052_terseLabel_en-US" xlink:label="lab_us-gaap_ConcentrationRiskBenchmarkDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk Benchmark [Domain]</link:label>
    <link:label id="lab_us-gaap_ConcentrationRiskBenchmarkDomain_label_en-US" xlink:label="lab_us-gaap_ConcentrationRiskBenchmarkDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk Benchmark [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskBenchmarkDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain" xlink:to="lab_us-gaap_ConcentrationRiskBenchmarkDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax_9aae40c7-085c-47d8-b6df-e797e441e468_verboseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net unrealized gain (loss) on available-for-sale investments, net of tax</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">OCI, Debt Securities, Available-for-Sale, Gain (Loss), after Adjustment and Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:to="lab_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingRollForward_993c22df-d60e-4513-8227-aa962b0d4e9b_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Shares</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingRollForward_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingRollForward" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationSaleOfPropertyPlantAndEquipment1_81c468e1-b336-4f62-9f9d-732ee63131c0_terseLabel_en-US" xlink:label="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationSaleOfPropertyPlantAndEquipment1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reduction of accumulated depreciation due to disposals</link:label>
    <link:label id="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationSaleOfPropertyPlantAndEquipment1_label_en-US" xlink:label="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationSaleOfPropertyPlantAndEquipment1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Depreciation, Depletion and Amortization, Sale or Disposal of Property, Plant and Equipment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationSaleOfPropertyPlantAndEquipment1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationSaleOfPropertyPlantAndEquipment1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationSaleOfPropertyPlantAndEquipment1" xlink:to="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationSaleOfPropertyPlantAndEquipment1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SalesReturnsAndAllowancesMember_beff14b9-e93f-4773-ba1d-0661322b11b1_terseLabel_en-US" xlink:label="lab_us-gaap_SalesReturnsAndAllowancesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sales Returns and Allowances [Member]</link:label>
    <link:label id="lab_us-gaap_SalesReturnsAndAllowancesMember_label_en-US" xlink:label="lab_us-gaap_SalesReturnsAndAllowancesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sales Returns and Allowances [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SalesReturnsAndAllowancesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SalesReturnsAndAllowancesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SalesReturnsAndAllowancesMember" xlink:to="lab_us-gaap_SalesReturnsAndAllowancesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_34be535f-4623-4aac-a2d7-3c81e3c2e300_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">State income taxes, net of federal benefit</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, State and Local Income Taxes, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit_952b0b1c-1ce6-4379-82e8-972ddd5d448f_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">State</link:label>
    <link:label id="lab_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred State and Local Income Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:to="lab_us-gaap_DeferredStateAndLocalIncomeTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentTextBlock_f1c16403-9d53-4972-9208-05948cbc058b_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant, and Equipment</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentTextBlock_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTextBlock" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch_2b48de5e-b386-4abd-bf0c-2d76194ffc17_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred tax assets, tax credit carryforwards, research</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Tax Credit Carryforwards, Research</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch" xlink:to="lab_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsResearch" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeStatementLocationDomain_88827509-2393-4c64-a58b-a82eb16635b7_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeStatementLocationDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Statement Location [Domain]</link:label>
    <link:label id="lab_us-gaap_IncomeStatementLocationDomain_4592ac76-7737-4cef-a9a0-18ee3fa67ab3_verboseLabel_en-US" xlink:label="lab_us-gaap_IncomeStatementLocationDomain" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Employee Service Share-based Compensation, Allocation of Recognized Period Costs, Report Line [Domain]</link:label>
    <link:label id="lab_us-gaap_IncomeStatementLocationDomain_label_en-US" xlink:label="lab_us-gaap_IncomeStatementLocationDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Statement Location [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeStatementLocationDomain" xlink:to="lab_us-gaap_IncomeStatementLocationDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DiscreteTaxItemsAxis_064a25ee-109e-4358-b8b9-1f1ca4d8d9fb_terseLabel_en-US" xlink:label="lab_cgnx_DiscreteTaxItemsAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Items [Axis]</link:label>
    <link:label id="lab_cgnx_DiscreteTaxItemsAxis_label_en-US" xlink:label="lab_cgnx_DiscreteTaxItemsAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Items [Axis]</link:label>
    <link:label id="lab_cgnx_DiscreteTaxItemsAxis_documentation_en-US" xlink:label="lab_cgnx_DiscreteTaxItemsAxis" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Items</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DiscreteTaxItemsAxis" xlink:href="cgnx-20211231.xsd#cgnx_DiscreteTaxItemsAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DiscreteTaxItemsAxis" xlink:to="lab_cgnx_DiscreteTaxItemsAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InterestReceivable_c880b4fa-d711-4974-a785-77833f7b1d34_terseLabel_en-US" xlink:label="lab_us-gaap_InterestReceivable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Interest Receivable</link:label>
    <link:label id="lab_us-gaap_InterestReceivable_label_en-US" xlink:label="lab_us-gaap_InterestReceivable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Interest Receivable</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestReceivable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InterestReceivable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InterestReceivable" xlink:to="lab_us-gaap_InterestReceivable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentNet_e052beec-da74-436b-bf5f-100f14512ac3_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentNet" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, plant, and equipment, net</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentNet_4fe56915-ca42-4a74-aedd-7cef1da3dc73_totalLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentNet" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, plant and equipment, net, total</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentNet_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentNet" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_RepurchaseProgramMarch2020Member_424247ff-7548-48e2-9c6f-ae577093c1b7_terseLabel_en-US" xlink:label="lab_cgnx_RepurchaseProgramMarch2020Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase Program March 2020 [Member]</link:label>
    <link:label id="lab_cgnx_RepurchaseProgramMarch2020Member_label_en-US" xlink:label="lab_cgnx_RepurchaseProgramMarch2020Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase Program March 2020 [Member]</link:label>
    <link:label id="lab_cgnx_RepurchaseProgramMarch2020Member_documentation_en-US" xlink:label="lab_cgnx_RepurchaseProgramMarch2020Member" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase Program March 2020</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_RepurchaseProgramMarch2020Member" xlink:href="cgnx-20211231.xsd#cgnx_RepurchaseProgramMarch2020Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_RepurchaseProgramMarch2020Member" xlink:to="lab_cgnx_RepurchaseProgramMarch2020Member" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_NatureOfOperationsPolicyTextBlock_243361d9-fc82-4c31-896f-47121e1ac180_terseLabel_en-US" xlink:label="lab_cgnx_NatureOfOperationsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nature of Operations</link:label>
    <link:label id="lab_cgnx_NatureOfOperationsPolicyTextBlock_label_en-US" xlink:label="lab_cgnx_NatureOfOperationsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nature Of Operations [Policy Text Block]</link:label>
    <link:label id="lab_cgnx_NatureOfOperationsPolicyTextBlock_documentation_en-US" xlink:label="lab_cgnx_NatureOfOperationsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nature of Operations.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_NatureOfOperationsPolicyTextBlock" xlink:href="cgnx-20211231.xsd#cgnx_NatureOfOperationsPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_NatureOfOperationsPolicyTextBlock" xlink:to="lab_cgnx_NatureOfOperationsPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleofFiniteLivedIntangibleAssetsFutureAmortizationExpenseTableTextBlock_6d691afa-e208-4978-bb0b-852777c6de56_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleofFiniteLivedIntangibleAssetsFutureAmortizationExpenseTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Estimated Amortization Expense Succeeding Fiscal Years</link:label>
    <link:label id="lab_us-gaap_ScheduleofFiniteLivedIntangibleAssetsFutureAmortizationExpenseTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleofFiniteLivedIntangibleAssetsFutureAmortizationExpenseTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Finite-Lived Intangible Assets, Future Amortization Expense [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleofFiniteLivedIntangibleAssetsFutureAmortizationExpenseTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleofFiniteLivedIntangibleAssetsFutureAmortizationExpenseTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleofFiniteLivedIntangibleAssetsFutureAmortizationExpenseTableTextBlock" xlink:to="lab_us-gaap_ScheduleofFiniteLivedIntangibleAssetsFutureAmortizationExpenseTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EarningsPerShareAbstract_a8f7e52e-cfd0-4fa6-b613-c400ae2313c2_terseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerShareAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Earnings Per Share [Abstract]</link:label>
    <link:label id="lab_us-gaap_EarningsPerShareAbstract_label_en-US" xlink:label="lab_us-gaap_EarningsPerShareAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Earnings Per Share [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EarningsPerShareAbstract" xlink:to="lab_us-gaap_EarningsPerShareAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentGross_f26fca68-4309-48b3-b7e7-3cd768e5a7d9_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentGross" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, plant and equipment, gross</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentGross_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentGross" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentGross"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentGross" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentGross" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AllowanceForDoubtfulAccountsReceivable_bbf02881-b740-4f35-a205-63eafcecb275_periodStartLabel_en-US" xlink:label="lab_us-gaap_AllowanceForDoubtfulAccountsReceivable" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning balance</link:label>
    <link:label id="lab_us-gaap_AllowanceForDoubtfulAccountsReceivable_b2ad5b5b-3fb7-485e-948b-4e49c0b6a9a2_periodEndLabel_en-US" xlink:label="lab_us-gaap_AllowanceForDoubtfulAccountsReceivable" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Ending balance</link:label>
    <link:label id="lab_us-gaap_AllowanceForDoubtfulAccountsReceivable_label_en-US" xlink:label="lab_us-gaap_AllowanceForDoubtfulAccountsReceivable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable, Allowance for Credit Loss</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllowanceForDoubtfulAccountsReceivable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AllowanceForDoubtfulAccountsReceivable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AllowanceForDoubtfulAccountsReceivable" xlink:to="lab_us-gaap_AllowanceForDoubtfulAccountsReceivable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent_3a9159ea-ce9c-41c8-8440-413e4e57f60b_totalLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net change related to foreign currency translation adjustments</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Comprehensive Income (Loss), Foreign Currency Transaction and Translation Adjustment, Net of Tax, Portion Attributable to Parent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent" xlink:to="lab_us-gaap_OtherComprehensiveIncomeForeignCurrencyTransactionAndTranslationAdjustmentNetOfTaxPortionAttributableToParent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_TrademarksMember_692569c4-e1b0-4600-982a-f8286e2339fc_terseLabel_en-US" xlink:label="lab_us-gaap_TrademarksMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Trademarks [Member]</link:label>
    <link:label id="lab_us-gaap_TrademarksMember_label_en-US" xlink:label="lab_us-gaap_TrademarksMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Trademarks [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TrademarksMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TrademarksMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_TrademarksMember" xlink:to="lab_us-gaap_TrademarksMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CustomerContractsLiabilityCurrentRollForward_66e05c36-d808-4c56-90d9-bde333de9dce_terseLabel_en-US" xlink:label="lab_cgnx_CustomerContractsLiabilityCurrentRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer Contracts Liability, Current</link:label>
    <link:label id="lab_cgnx_CustomerContractsLiabilityCurrentRollForward_label_en-US" xlink:label="lab_cgnx_CustomerContractsLiabilityCurrentRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer Contracts Liability Current [Roll Forward]</link:label>
    <link:label id="lab_cgnx_CustomerContractsLiabilityCurrentRollForward_documentation_en-US" xlink:label="lab_cgnx_CustomerContractsLiabilityCurrentRollForward" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer Contracts Liability Current [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CustomerContractsLiabilityCurrentRollForward" xlink:href="cgnx-20211231.xsd#cgnx_CustomerContractsLiabilityCurrentRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CustomerContractsLiabilityCurrentRollForward" xlink:to="lab_cgnx_CustomerContractsLiabilityCurrentRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice_af693686-d5e4-47ed-91e7-1124f0a0e766_periodStartLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning balance outstanding, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice_c35f93f1-1ad7-4a7c-8909-06577e1972ea_periodEndLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Ending balance outstanding, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding, Weighted Average Exercise Price</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_EuropeMember_86c0864e-36a8-4cb4-acb7-6887d17f9c44_terseLabel_en-US" xlink:label="lab_srt_EuropeMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Europe [Member]</link:label>
    <link:label id="lab_srt_EuropeMember_0d0ebda9-f01c-42a9-9f61-8af895f66834_verboseLabel_en-US" xlink:label="lab_srt_EuropeMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Europe [Member]</link:label>
    <link:label id="lab_srt_EuropeMember_label_en-US" xlink:label="lab_srt_EuropeMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Europe [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_EuropeMember" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_EuropeMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_EuropeMember" xlink:to="lab_srt_EuropeMember" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityCurrentReportingStatus_94c79001-8aaf-454a-9434-74cdea58610e_terseLabel_en-US" xlink:label="lab_dei_EntityCurrentReportingStatus" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Current Reporting Status</link:label>
    <link:label id="lab_dei_EntityCurrentReportingStatus_label_en-US" xlink:label="lab_dei_EntityCurrentReportingStatus" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Current Reporting Status</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCurrentReportingStatus" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityCurrentReportingStatus"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityCurrentReportingStatus" xlink:to="lab_dei_EntityCurrentReportingStatus" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_13e886c9-c53f-4ba8-ae4d-11947c21ff49_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted-Average Grant Fair Value</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Nonvested, Weighted Average Grant Date Fair Value [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateContinuingOperations_1d26965f-187f-4285-b386-7394be994e4d_totalLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax expense (benefit)</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateContinuingOperations_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_5d811e9b-0df7-40ac-8b27-bccd1faa8186_negatedLabel_en-US" xlink:label="lab_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Amortization of discounts or premiums on investments</link:label>
    <link:label id="lab_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_label_en-US" xlink:label="lab_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accretion (Amortization) of Discounts and Premiums, Investments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments" xlink:to="lab_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GainLossOnSaleOfPropertyPlantEquipment_ba6d81dd-eb25-4bbe-9de3-f29e93af51f7_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gain (Loss) on Disposition of Property Plant Equipment</link:label>
    <link:label id="lab_us-gaap_GainLossOnSaleOfPropertyPlantEquipment_label_en-US" xlink:label="lab_us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gain (Loss) on Disposition of Property Plant Equipment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GainLossOnSaleOfPropertyPlantEquipment"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:to="lab_us-gaap_GainLossOnSaleOfPropertyPlantEquipment" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SovereignDebtSecuritiesMember_ef0988fc-fe2b-4656-9c37-7d14fdf02052_terseLabel_en-US" xlink:label="lab_us-gaap_SovereignDebtSecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sovereign Bonds [Member]</link:label>
    <link:label id="lab_us-gaap_SovereignDebtSecuritiesMember_label_en-US" xlink:label="lab_us-gaap_SovereignDebtSecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sovereign Debt Securities [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SovereignDebtSecuritiesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SovereignDebtSecuritiesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SovereignDebtSecuritiesMember" xlink:to="lab_us-gaap_SovereignDebtSecuritiesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_TaxCreditCarryforwardNameDomain_a48f58f2-bef8-43f5-a083-d35e1c5b8cf7_terseLabel_en-US" xlink:label="lab_us-gaap_TaxCreditCarryforwardNameDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax Credit Carryforward, Name [Domain]</link:label>
    <link:label id="lab_us-gaap_TaxCreditCarryforwardNameDomain_label_en-US" xlink:label="lab_us-gaap_TaxCreditCarryforwardNameDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax Credit Carryforward, Name [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TaxCreditCarryforwardNameDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TaxCreditCarryforwardNameDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_TaxCreditCarryforwardNameDomain" xlink:to="lab_us-gaap_TaxCreditCarryforwardNameDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_country_US_aa706878-5110-4ea1-b3f8-138239681e06_terseLabel_en-US" xlink:label="lab_country_US" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">United States [Member]</link:label>
    <link:label id="lab_country_US_label_en-US" xlink:label="lab_country_US" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">UNITED STATES</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_country_US" xlink:href="https://xbrl.sec.gov/country/2021/country-2021.xsd#country_US"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_country_US" xlink:to="lab_country_US" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherInventoryPurchasedGoods_4ae96105-7c5c-4ff7-8fbf-66b7cc1034fd_terseLabel_en-US" xlink:label="lab_us-gaap_OtherInventoryPurchasedGoods" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Inventory, Purchased Goods, Gross</link:label>
    <link:label id="lab_us-gaap_OtherInventoryPurchasedGoods_label_en-US" xlink:label="lab_us-gaap_OtherInventoryPurchasedGoods" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Inventory, Purchased Goods, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherInventoryPurchasedGoods" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherInventoryPurchasedGoods"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherInventoryPurchasedGoods" xlink:to="lab_us-gaap_OtherInventoryPurchasedGoods" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LeasesAbstract_acf532bf-5fc5-4fee-b257-2e488008bf0c_terseLabel_en-US" xlink:label="lab_us-gaap_LeasesAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">New Accounting Pronouncements or Change in Accounting Principle [Table]</link:label>
    <link:label id="lab_us-gaap_LeasesAbstract_label_en-US" xlink:label="lab_us-gaap_LeasesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Leases [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LeasesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LeasesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LeasesAbstract" xlink:to="lab_us-gaap_LeasesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_HUF_430d4571-867a-47e6-b9cc-22d729e5406a_terseLabel_en-US" xlink:label="lab_currency_HUF" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Hungarian Forint [Member]</link:label>
    <link:label id="lab_currency_HUF_label_en-US" xlink:label="lab_currency_HUF" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Hungary, Forint</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_HUF" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_HUF"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_HUF" xlink:to="lab_currency_HUF" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxPolicyTextBlock_f5470168-0fe1-46a1-8010-c8e3591af2bf_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Taxes</link:label>
    <link:label id="lab_us-gaap_IncomeTaxPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_IncomeTaxPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxPolicyTextBlock" xlink:to="lab_us-gaap_IncomeTaxPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_09e318f9-261e-44eb-8b9c-5778b9085ee6_terseLabel_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Other Comprehensive Income (Loss) [Line Items]</link:label>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems_label_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Other Comprehensive Income (Loss) [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems" xlink:to="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityAddressPostalZipCode_8dc2e1d2-14a7-4798-a436-49084de30cc2_terseLabel_en-US" xlink:label="lab_dei_EntityAddressPostalZipCode" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Address, Postal Zip Code</link:label>
    <link:label id="lab_dei_EntityAddressPostalZipCode_label_en-US" xlink:label="lab_dei_EntityAddressPostalZipCode" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Address, Postal Zip Code</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressPostalZipCode" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityAddressPostalZipCode"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityAddressPostalZipCode" xlink:to="lab_dei_EntityAddressPostalZipCode" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock_1f57c02e-8d6e-4cc2-b943-c5b5034c0543_terseLabel_en-US" xlink:label="lab_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentrations of Risk</link:label>
    <link:label id="lab_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock_label_en-US" xlink:label="lab_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentrations Of Risk Policy [Policy Text Block]</link:label>
    <link:label id="lab_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock_documentation_en-US" xlink:label="lab_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentrations of Risk.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock" xlink:href="cgnx-20211231.xsd#cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock" xlink:to="lab_cgnx_ConcentrationsOfRiskPolicyPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_83983383-50d3-4c73-b085-39ba6858a52d_terseLabel_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Diluted (in shares)</link:label>
    <link:label id="lab_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_e75db321-6ce8-4124-b30a-a9847a27282d_totalLabel_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Diluted weighted-average common and common-equivalent shares outstanding</link:label>
    <link:label id="lab_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_label_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted Average Number of Shares Outstanding, Diluted</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:to="lab_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic_6c5cbcb6-ac9a-43a8-84ff-bbdfe023f86b_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Domestic income from continuing operations before taxes</link:label>
    <link:label id="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic_label_en-US" xlink:label="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income (Loss) from Continuing Operations before Income Taxes, Domestic</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic" xlink:to="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesDomestic" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxDisclosureTextBlock_71d5abcf-1afb-45c7-96c1-92e9d5e3af67_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Taxes</link:label>
    <link:label id="lab_us-gaap_IncomeTaxDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_IncomeTaxDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Tax Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxDisclosureTextBlock" xlink:to="lab_us-gaap_IncomeTaxDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock_72fa6dba-a720-4fe6-9d0a-0dd9622150a8_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Summary of Stock Option Activity</link:label>
    <link:label id="lab_us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Option, Activity [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfOneYear_c0c84f58-64e3-4180-a509-2d2aeb26d042_terseLabel_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfOneYear" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company contributions vest at end of one year</link:label>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfOneYear_label_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfOneYear" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company Contributions Vest At End Of One Year</link:label>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfOneYear_documentation_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfOneYear" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company Contributions Vest At End Of One Year</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompanyContributionsVestAtEndOfOneYear" xlink:href="cgnx-20211231.xsd#cgnx_CompanyContributionsVestAtEndOfOneYear"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CompanyContributionsVestAtEndOfOneYear" xlink:to="lab_cgnx_CompanyContributionsVestAtEndOfOneYear" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StatementOfCashFlowsAbstract_79a18dbd-2ea1-4605-8c18-655e03fa33b6_terseLabel_en-US" xlink:label="lab_us-gaap_StatementOfCashFlowsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement of Cash Flows [Abstract]</link:label>
    <link:label id="lab_us-gaap_StatementOfCashFlowsAbstract_label_en-US" xlink:label="lab_us-gaap_StatementOfCashFlowsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement of Cash Flows [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementOfCashFlowsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementOfCashFlowsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StatementOfCashFlowsAbstract" xlink:to="lab_us-gaap_StatementOfCashFlowsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber_d3db1de7-839b-4c47-850e-8c4dddbfacbc_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Options vested or expected to vest</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Vested and Expected to Vest, Exercisable, Number</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ForeignCurrencyGainLossMember_1ee940f6-30f7-48fa-bc0a-1788f22340e7_terseLabel_en-US" xlink:label="lab_us-gaap_ForeignCurrencyGainLossMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign currency gain (loss)</link:label>
    <link:label id="lab_us-gaap_ForeignCurrencyGainLossMember_label_en-US" xlink:label="lab_us-gaap_ForeignCurrencyGainLossMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Currency Gain (Loss) [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyGainLossMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignCurrencyGainLossMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ForeignCurrencyGainLossMember" xlink:to="lab_us-gaap_ForeignCurrencyGainLossMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ClassOfStockLineItems_0233249e-0311-4208-992e-2b2c16fbd2e3_terseLabel_en-US" xlink:label="lab_us-gaap_ClassOfStockLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Class of Stock [Line Items]</link:label>
    <link:label id="lab_us-gaap_ClassOfStockLineItems_label_en-US" xlink:label="lab_us-gaap_ClassOfStockLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Class of Stock [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ClassOfStockLineItems" xlink:to="lab_us-gaap_ClassOfStockLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NondesignatedMember_10449221-7cd0-481a-a832-452b9507fbc3_terseLabel_en-US" xlink:label="lab_us-gaap_NondesignatedMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Not Designated as Hedging Instrument [Member]</link:label>
    <link:label id="lab_us-gaap_NondesignatedMember_label_en-US" xlink:label="lab_us-gaap_NondesignatedMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Not Designated as Hedging Instrument [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NondesignatedMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NondesignatedMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NondesignatedMember" xlink:to="lab_us-gaap_NondesignatedMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_2345be54-2b5d-4d70-9dfb-ebdf1daa9487_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets, Major Class Name [Domain]</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets, Major Class Name [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityAddressAddressLine1_cc06aefa-a310-4698-abdd-e96d4301c288_terseLabel_en-US" xlink:label="lab_dei_EntityAddressAddressLine1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Address, Address Line One</link:label>
    <link:label id="lab_dei_EntityAddressAddressLine1_label_en-US" xlink:label="lab_dei_EntityAddressAddressLine1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Address, Address Line One</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressAddressLine1" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityAddressAddressLine1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityAddressAddressLine1" xlink:to="lab_dei_EntityAddressAddressLine1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_55edf4de-9956-4e38-aa3b-06c2c9b2c985_negatedLabel_en-US" xlink:label="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Less: accumulated depreciation</link:label>
    <link:label id="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_label_en-US" xlink:label="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Depreciation, Depletion and Amortization, Property, Plant, and Equipment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:to="lab_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_34d5ea72-a38f-475e-80e5-ac19aa813b89_totalLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net change related to available-for-sale investments</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Comprehensive Income (Loss), Available-for-sale Securities Adjustment, Net of Tax, Portion Attributable to Parent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent" xlink:to="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6c086d55-ab5e-4d83-88a9-338b772507eb_terseLabel_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash flows from operating activities:</link:label>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_label_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Cash Provided by (Used in) Operating Activities [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="lab_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ConsolidationPolicyTextBlock_748c6e84-8750-4c55-bb97-15b50f4f1f29_terseLabel_en-US" xlink:label="lab_us-gaap_ConsolidationPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Basis of Consolidation</link:label>
    <link:label id="lab_us-gaap_ConsolidationPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_ConsolidationPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Consolidation, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsolidationPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConsolidationPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ConsolidationPolicyTextBlock" xlink:to="lab_us-gaap_ConsolidationPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityShellCompany_9a980ee1-ea52-411c-9cc9-6e3a989123be_terseLabel_en-US" xlink:label="lab_dei_EntityShellCompany" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Shell Company</link:label>
    <link:label id="lab_dei_EntityShellCompany_label_en-US" xlink:label="lab_dei_EntityShellCompany" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Shell Company</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityShellCompany" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityShellCompany"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityShellCompany" xlink:to="lab_dei_EntityShellCompany" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PurchaseCommitmentRemainingMinimumAmountCommitted_01ee9375-714b-4a72-9fbc-4f989d263a16_terseLabel_en-US" xlink:label="lab_us-gaap_PurchaseCommitmentRemainingMinimumAmountCommitted" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Purchase order outstanding</link:label>
    <link:label id="lab_us-gaap_PurchaseCommitmentRemainingMinimumAmountCommitted_label_en-US" xlink:label="lab_us-gaap_PurchaseCommitmentRemainingMinimumAmountCommitted" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Purchase Commitment, Remaining Minimum Amount Committed</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PurchaseCommitmentRemainingMinimumAmountCommitted" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PurchaseCommitmentRemainingMinimumAmountCommitted"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PurchaseCommitmentRemainingMinimumAmountCommitted" xlink:to="lab_us-gaap_PurchaseCommitmentRemainingMinimumAmountCommitted" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_824ee809-c401-412e-a3fa-bed11c699613_terseLabel_en-US" xlink:label="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Expected term (in years)</link:label>
    <link:label id="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_label_en-US" xlink:label="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Expected Term</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:to="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LiabilitiesCurrent_ef578b62-b7a0-4b83-a3f2-ea5f3062f5b7_totalLabel_en-US" xlink:label="lab_us-gaap_LiabilitiesCurrent" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total current liabilities</link:label>
    <link:label id="lab_us-gaap_LiabilitiesCurrent_label_en-US" xlink:label="lab_us-gaap_LiabilitiesCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liabilities, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LiabilitiesCurrent" xlink:to="lab_us-gaap_LiabilitiesCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminatedInceptionToDatePercent_35d24f44-3b62-429f-9542-b0e4b2e4e283_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminatedInceptionToDatePercent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Global workforce reduction</link:label>
    <link:label id="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminatedInceptionToDatePercent_label_en-US" xlink:label="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminatedInceptionToDatePercent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring and Related Cost, Number of Positions Eliminated, Inception to Date Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminatedInceptionToDatePercent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminatedInceptionToDatePercent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminatedInceptionToDatePercent" xlink:to="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminatedInceptionToDatePercent" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_RevenuePaymentTerms_2a090f58-c9b9-4801-af0d-dac575ea50fe_terseLabel_en-US" xlink:label="lab_cgnx_RevenuePaymentTerms" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue, payment terms</link:label>
    <link:label id="lab_cgnx_RevenuePaymentTerms_label_en-US" xlink:label="lab_cgnx_RevenuePaymentTerms" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue, Payment Terms</link:label>
    <link:label id="lab_cgnx_RevenuePaymentTerms_documentation_en-US" xlink:label="lab_cgnx_RevenuePaymentTerms" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue, Payment Terms</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_RevenuePaymentTerms" xlink:href="cgnx-20211231.xsd#cgnx_RevenuePaymentTerms"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_RevenuePaymentTerms" xlink:to="lab_cgnx_RevenuePaymentTerms" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_VoteEntitledForEachCommonShareOutstanding_93ee7afd-df6a-47ca-8974-ba2cd2fbf510_terseLabel_en-US" xlink:label="lab_cgnx_VoteEntitledForEachCommonShareOutstanding" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Vote entitled for each common share outstanding</link:label>
    <link:label id="lab_cgnx_VoteEntitledForEachCommonShareOutstanding_label_en-US" xlink:label="lab_cgnx_VoteEntitledForEachCommonShareOutstanding" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Vote Entitled For Each Common Share Outstanding</link:label>
    <link:label id="lab_cgnx_VoteEntitledForEachCommonShareOutstanding_documentation_en-US" xlink:label="lab_cgnx_VoteEntitledForEachCommonShareOutstanding" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Vote entitled for each common share outstanding.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_VoteEntitledForEachCommonShareOutstanding" xlink:href="cgnx-20211231.xsd#cgnx_VoteEntitledForEachCommonShareOutstanding"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_VoteEntitledForEachCommonShareOutstanding" xlink:to="lab_cgnx_VoteEntitledForEachCommonShareOutstanding" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent_bdb7269f-0931-4358-9fb5-1c61e4d7d63a_terseLabel_en-US" xlink:label="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Percent of employee contribution</link:label>
    <link:label id="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent_label_en-US" xlink:label="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Defined Contribution Plan, Employer Matching Contribution, Percent of Employees' Gross Pay</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent" xlink:to="lab_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue_14e57216-c8cb-408e-b6fd-3b1d09f686d9_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Options vested or expected to vest, aggregate intrinsic value</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Vested and Expected to Vest, Outstanding, Aggregate Intrinsic Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingAggregateIntrinsicValue" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_CurrentFiscalYearEndDate_a45b95f7-83cb-4c5c-a154-e8aea649d36f_terseLabel_en-US" xlink:label="lab_dei_CurrentFiscalYearEndDate" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current Fiscal Year End Date</link:label>
    <link:label id="lab_dei_CurrentFiscalYearEndDate_label_en-US" xlink:label="lab_dei_CurrentFiscalYearEndDate" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current Fiscal Year End Date</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CurrentFiscalYearEndDate" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_CurrentFiscalYearEndDate"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_CurrentFiscalYearEndDate" xlink:to="lab_dei_CurrentFiscalYearEndDate" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_f59e4633-8928-4a50-ba57-086db591a32e_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments, Gain (Loss) [Table]</link:label>
    <link:label id="lab_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable_label_en-US" xlink:label="lab_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments, Gain (Loss) [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable" xlink:to="lab_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipByIncomeStatementLocationByDerivativeInstrumentRiskTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StatementTable_5de0ef01-f0b3-44f6-b486-e9ecf463d20f_terseLabel_en-US" xlink:label="lab_us-gaap_StatementTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement [Table]</link:label>
    <link:label id="lab_us-gaap_StatementTable_label_en-US" xlink:label="lab_us-gaap_StatementTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StatementTable" xlink:to="lab_us-gaap_StatementTable" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_SualabCo.Ltd.Member_594907ca-42c9-4506-92ac-221d412f2f42_terseLabel_en-US" xlink:label="lab_cgnx_SualabCo.Ltd.Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sualab Co., Ltd. [Member]</link:label>
    <link:label id="lab_cgnx_SualabCo.Ltd.Member_label_en-US" xlink:label="lab_cgnx_SualabCo.Ltd.Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sualab Co., Ltd. [Member]</link:label>
    <link:label id="lab_cgnx_SualabCo.Ltd.Member_documentation_en-US" xlink:label="lab_cgnx_SualabCo.Ltd.Member" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Sualab Co., Ltd. [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_SualabCo.Ltd.Member" xlink:href="cgnx-20211231.xsd#cgnx_SualabCo.Ltd.Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_SualabCo.Ltd.Member" xlink:to="lab_cgnx_SualabCo.Ltd.Member" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock_c037f1e3-e03a-4baf-b279-090906271a50_terseLabel_en-US" xlink:label="lab_us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">New Accounting Pronouncements, Policy</link:label>
    <link:label id="lab_us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">New Accounting Pronouncements, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" xlink:to="lab_us-gaap_NewAccountingPronouncementsPolicyPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AgencyBondsMember_2835f048-7c05-4571-a21b-c614fd68b40c_terseLabel_en-US" xlink:label="lab_cgnx_AgencyBondsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Agency Bonds [Member]</link:label>
    <link:label id="lab_cgnx_AgencyBondsMember_label_en-US" xlink:label="lab_cgnx_AgencyBondsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Agency Bonds [Member]</link:label>
    <link:label id="lab_cgnx_AgencyBondsMember_documentation_en-US" xlink:label="lab_cgnx_AgencyBondsMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Agency bond.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AgencyBondsMember" xlink:href="cgnx-20211231.xsd#cgnx_AgencyBondsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AgencyBondsMember" xlink:to="lab_cgnx_AgencyBondsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_RangeAxis_b324ec16-1c06-450d-b7ff-20ae899f14cc_terseLabel_en-US" xlink:label="lab_srt_RangeAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Range [Axis]</link:label>
    <link:label id="lab_srt_RangeAxis_label_en-US" xlink:label="lab_srt_RangeAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statistical Measurement [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_RangeAxis" xlink:to="lab_srt_RangeAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_TradeAndOtherAccountsReceivablePolicy_97c22cab-6048-4050-9c5c-024e951725ea_terseLabel_en-US" xlink:label="lab_us-gaap_TradeAndOtherAccountsReceivablePolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable</link:label>
    <link:label id="lab_us-gaap_TradeAndOtherAccountsReceivablePolicy_label_en-US" xlink:label="lab_us-gaap_TradeAndOtherAccountsReceivablePolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TradeAndOtherAccountsReceivablePolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TradeAndOtherAccountsReceivablePolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_TradeAndOtherAccountsReceivablePolicy" xlink:to="lab_us-gaap_TradeAndOtherAccountsReceivablePolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SubsequentEventMember_843e7763-3a7d-4086-a066-d29d1250e733_terseLabel_en-US" xlink:label="lab_us-gaap_SubsequentEventMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event [Member]</link:label>
    <link:label id="lab_us-gaap_SubsequentEventMember_label_en-US" xlink:label="lab_us-gaap_SubsequentEventMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SubsequentEventMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SubsequentEventMember" xlink:to="lab_us-gaap_SubsequentEventMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign_66f4b45e-bf82-41d8-afc1-7707b2540604_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign net operating losses</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Operating Loss Carryforwards, Foreign</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign" xlink:to="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsForeign" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsNet_4ede4e35-d655-48eb-961e-52b21cb6d880_totalLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsNet" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Carrying Value</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsNet_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsNet" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsNet" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_Goodwill_5163d722-ac69-4d8c-959b-19cb45ba728b_terseLabel_en-US" xlink:label="lab_us-gaap_Goodwill" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill</link:label>
    <link:label id="lab_us-gaap_Goodwill_2b714969-cf5e-46ac-bfa9-3911ebf6c7df_periodStartLabel_en-US" xlink:label="lab_us-gaap_Goodwill" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill, Beginning Balance</link:label>
    <link:label id="lab_us-gaap_Goodwill_82a11fc9-bc43-4a4b-be08-6f9c202f440b_periodEndLabel_en-US" xlink:label="lab_us-gaap_Goodwill" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill, Ending Balance</link:label>
    <link:label id="lab_us-gaap_Goodwill_label_en-US" xlink:label="lab_us-gaap_Goodwill" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_Goodwill" xlink:to="lab_us-gaap_Goodwill" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsForProceedsFromPreviousAcquisition_bed2c333-ef96-4d6c-8756-f54b3f018fe5_terseLabel_en-US" xlink:label="lab_us-gaap_PaymentsForProceedsFromPreviousAcquisition" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Credit to goodwill</link:label>
    <link:label id="lab_us-gaap_PaymentsForProceedsFromPreviousAcquisition_label_en-US" xlink:label="lab_us-gaap_PaymentsForProceedsFromPreviousAcquisition" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments for (Proceeds from) Previous Acquisition</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForProceedsFromPreviousAcquisition" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsForProceedsFromPreviousAcquisition"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsForProceedsFromPreviousAcquisition" xlink:to="lab_us-gaap_PaymentsForProceedsFromPreviousAcquisition" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential_78fbd9d1-e9a1-44dd-b94c-35fd80a05dcd_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign tax rate differential</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential_7074b58c-cc96-4e43-a923-097d6a975309_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign tax rate differential</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Foreign Income Tax Rate Differential, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationForeignIncomeTaxRateDifferential" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_08decc35-bb71-449d-8d14-a2f8d440a9da_negatedLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrealized Losses, Less than 12 months</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Continuous Unrealized Loss Position, Less than 12 Months, Accumulated Loss</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfGoodwillTextBlock_1bf9faec-1e25-4f1e-9273-4992458992ca_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfGoodwillTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Changes in the Carrying Value of Goodwill</link:label>
    <link:label id="lab_us-gaap_ScheduleOfGoodwillTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfGoodwillTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Goodwill [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfGoodwillTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfGoodwillTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfGoodwillTextBlock" xlink:to="lab_us-gaap_ScheduleOfGoodwillTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_620ce40a-1ba8-4677-93e6-17816db9d0a0_terseLabel_en-US" xlink:label="lab_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Adjustments to reconcile net income to net cash provided by operating activities:</link:label>
    <link:label id="lab_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_label_en-US" xlink:label="lab_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Adjustments to Reconcile Net Income (Loss) to Cash Provided by (Used in) Operating Activities [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:to="lab_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SubsequentEventTypeAxis_2d470974-2c96-43c0-9688-68810999426a_terseLabel_en-US" xlink:label="lab_us-gaap_SubsequentEventTypeAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event Type [Axis]</link:label>
    <link:label id="lab_us-gaap_SubsequentEventTypeAxis_label_en-US" xlink:label="lab_us-gaap_SubsequentEventTypeAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event Type [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SubsequentEventTypeAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SubsequentEventTypeAxis" xlink:to="lab_us-gaap_SubsequentEventTypeAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfDerivativeInstrumentsInStatementOfFinancialPositionFairValueTextBlock_12ddb949-e557-4b4f-b452-1de219a064a0_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfDerivativeInstrumentsInStatementOfFinancialPositionFairValueTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Derivative Instruments in Statement of Financial Position, Fair Value</link:label>
    <link:label id="lab_us-gaap_ScheduleOfDerivativeInstrumentsInStatementOfFinancialPositionFairValueTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfDerivativeInstrumentsInStatementOfFinancialPositionFairValueTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Derivative Instruments in Statement of Financial Position, Fair Value [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDerivativeInstrumentsInStatementOfFinancialPositionFairValueTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfDerivativeInstrumentsInStatementOfFinancialPositionFairValueTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfDerivativeInstrumentsInStatementOfFinancialPositionFairValueTextBlock" xlink:to="lab_us-gaap_ScheduleOfDerivativeInstrumentsInStatementOfFinancialPositionFairValueTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_fb61d826-e2b1-4235-beee-5d640d5991b3_negatedLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrealized Losses, Greater than 12 Months</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Continuous Unrealized Loss Position, 12 Months or Longer, Accumulated Loss</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent_ae675724-9332-4b28-8e40-1636d1fd4b6e_terseLabel_en-US" xlink:label="lab_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum contribution by company expressed as percentage of employee pre-tax salary</link:label>
    <link:label id="lab_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent_label_en-US" xlink:label="lab_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Defined Contribution Plan, Maximum Annual Contributions Per Employee, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent" xlink:to="lab_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredIncomeTaxExpenseBenefit_a3c05e22-4cd4-4b13-bdf3-22323ffe31c3_totalLabel_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred income tax expense (benefit), Total</link:label>
    <link:label id="lab_us-gaap_DeferredIncomeTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Income Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:to="lab_us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm1_21b06d73-6fa6-4752-a0a8-ff12d00c4a96_terseLabel_en-US" xlink:label="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Options vested or expected to vest, weighted-average remaining contractual term (in years)</link:label>
    <link:label id="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm1_label_en-US" xlink:label="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Vested and Expected to Vest, Outstanding, Weighted Average Remaining Contractual Term</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm1" xlink:to="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageRemainingContractualTerm1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockRepurchaseProgramAuthorizedAmount1_8650b16e-43a1-43d2-9e63-65bb177e1ea9_terseLabel_en-US" xlink:label="lab_us-gaap_StockRepurchaseProgramAuthorizedAmount1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase of authorized common stock</link:label>
    <link:label id="lab_us-gaap_StockRepurchaseProgramAuthorizedAmount1_label_en-US" xlink:label="lab_us-gaap_StockRepurchaseProgramAuthorizedAmount1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Repurchase Program, Authorized Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockRepurchaseProgramAuthorizedAmount1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1" xlink:to="lab_us-gaap_StockRepurchaseProgramAuthorizedAmount1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_HedgingDesignationDomain_d2ca94a7-da24-4c31-aa1f-b3427673239a_terseLabel_en-US" xlink:label="lab_us-gaap_HedgingDesignationDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Hedging Designation [Domain]</link:label>
    <link:label id="lab_us-gaap_HedgingDesignationDomain_label_en-US" xlink:label="lab_us-gaap_HedgingDesignationDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Hedging Designation [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_HedgingDesignationDomain" xlink:to="lab_us-gaap_HedgingDesignationDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_StateResearchAndExperimentationMember_ea043a2d-b446-4b01-83a1-8f4f318aae24_terseLabel_en-US" xlink:label="lab_cgnx_StateResearchAndExperimentationMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">State Research And Experimentation [Member]</link:label>
    <link:label id="lab_cgnx_StateResearchAndExperimentationMember_label_en-US" xlink:label="lab_cgnx_StateResearchAndExperimentationMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">State Research And Experimentation [Member]</link:label>
    <link:label id="lab_cgnx_StateResearchAndExperimentationMember_documentation_en-US" xlink:label="lab_cgnx_StateResearchAndExperimentationMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">State research and experimentation.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_StateResearchAndExperimentationMember" xlink:href="cgnx-20211231.xsd#cgnx_StateResearchAndExperimentationMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_StateResearchAndExperimentationMember" xlink:to="lab_cgnx_StateResearchAndExperimentationMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_e1f26c33-45c8-4f7b-b3ac-755e4d1c3f40_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax expense at U.S. federal statutory corporate tax rate</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_79516a70-51a8-47d0-830c-745de4c6d787_verboseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax rate</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, at Federal Statutory Income Tax Rate, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EarningsPerSharePolicyTextBlock_497540f1-62cb-433e-a3aa-71b99936efa0_terseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerSharePolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Income Per Share</link:label>
    <link:label id="lab_us-gaap_EarningsPerSharePolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_EarningsPerSharePolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Earnings Per Share, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerSharePolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerSharePolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EarningsPerSharePolicyTextBlock" xlink:to="lab_us-gaap_EarningsPerSharePolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_a33eaaab-f4c8-4306-b545-69d289a4bc24_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Measurements, Fair Value Hierarchy [Domain]</link:label>
    <link:label id="lab_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_label_en-US" xlink:label="lab_us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Hierarchy and NAV [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:to="lab_us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NetIncomeLoss_3170674a-cdfa-4481-a867-3ff76cae8cac_totalLabel_en-US" xlink:label="lab_us-gaap_NetIncomeLoss" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net income</link:label>
    <link:label id="lab_us-gaap_NetIncomeLoss_263deb1c-42be-4061-bf30-c1e6217a391c_terseLabel_en-US" xlink:label="lab_us-gaap_NetIncomeLoss" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net income</link:label>
    <link:label id="lab_us-gaap_NetIncomeLoss_4dd70987-fa2e-4d9e-a7dd-1e308acb5d55_verboseLabel_en-US" xlink:label="lab_us-gaap_NetIncomeLoss" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net income</link:label>
    <link:label id="lab_us-gaap_NetIncomeLoss_label_en-US" xlink:label="lab_us-gaap_NetIncomeLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Income (Loss) Attributable to Parent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NetIncomeLoss" xlink:to="lab_us-gaap_NetIncomeLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseRightOfUseAsset_fa804e51-6dca-4302-bfdb-bc71b84d3ac3_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseRightOfUseAsset" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease assets</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseRightOfUseAsset_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseRightOfUseAsset" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Right-of-Use Asset</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseRightOfUseAsset" xlink:to="lab_us-gaap_OperatingLeaseRightOfUseAsset" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfNotionalAmountsOfOutstandingDerivativePositionsTableTextBlock_d1e6aa0d-36b2-4fbd-b307-fd936e511510_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfNotionalAmountsOfOutstandingDerivativePositionsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Notional Amounts of Outstanding Derivative Positions</link:label>
    <link:label id="lab_us-gaap_ScheduleOfNotionalAmountsOfOutstandingDerivativePositionsTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfNotionalAmountsOfOutstandingDerivativePositionsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Notional Amounts of Outstanding Derivative Positions [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfNotionalAmountsOfOutstandingDerivativePositionsTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfNotionalAmountsOfOutstandingDerivativePositionsTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfNotionalAmountsOfOutstandingDerivativePositionsTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfNotionalAmountsOfOutstandingDerivativePositionsTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock_81e06881-3213-499d-be5a-9f10d7519d64_terseLabel_en-US" xlink:label="lab_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Components of Cash, Cash Equivalents and Investments</link:label>
    <link:label id="lab_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock_label_en-US" xlink:label="lab_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Components Of Cash Cash Equivalents And Investments Table [Table Text Block]</link:label>
    <link:label id="lab_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock_documentation_en-US" xlink:label="lab_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Components of cash cash equivalents and investments.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock" xlink:href="cgnx-20211231.xsd#cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock" xlink:to="lab_cgnx_ComponentsOfCashCashEquivalentsAndInvestmentsTableTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeStatementLocationAxis_afe0c176-4406-4597-ab91-f2e0a0dec379_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeStatementLocationAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Statement Location [Axis]</link:label>
    <link:label id="lab_us-gaap_IncomeStatementLocationAxis_ef621eb4-a5b6-468c-9e35-217895b5933f_verboseLabel_en-US" xlink:label="lab_us-gaap_IncomeStatementLocationAxis" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Employee Service Share-Based Compensation, Allocation of Recognized Period Costs, by Report Line [Axis]</link:label>
    <link:label id="lab_us-gaap_IncomeStatementLocationAxis_label_en-US" xlink:label="lab_us-gaap_IncomeStatementLocationAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Statement Location [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeStatementLocationAxis" xlink:to="lab_us-gaap_IncomeStatementLocationAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_3c54d510-7ce3-4242-86da-0e017e4e1f68_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Amortization</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_e66f6991-e2f4-4c21-8324-fabba45845ee_verboseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated amortization</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets, Accumulated Amortization</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsAccumulatedAmortization" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_RangeMember_428c4d73-5103-4ff2-9d67-1661174e2955_terseLabel_en-US" xlink:label="lab_srt_RangeMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Range [Domain]</link:label>
    <link:label id="lab_srt_RangeMember_label_en-US" xlink:label="lab_srt_RangeMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statistical Measurement [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_RangeMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_RangeMember" xlink:to="lab_srt_RangeMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OffsettingAssetsTableTextBlock_bbb7c89c-89b9-4403-9443-254f8749a6a1_terseLabel_en-US" xlink:label="lab_us-gaap_OffsettingAssetsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Offsetting Assets</link:label>
    <link:label id="lab_us-gaap_OffsettingAssetsTableTextBlock_label_en-US" xlink:label="lab_us-gaap_OffsettingAssetsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Offsetting Assets [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OffsettingAssetsTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OffsettingAssetsTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OffsettingAssetsTableTextBlock" xlink:to="lab_us-gaap_OffsettingAssetsTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityIncorporationStateCountryCode_8c1aaf93-e4c8-4b3a-8681-131802e22e5c_terseLabel_en-US" xlink:label="lab_dei_EntityIncorporationStateCountryCode" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Incorporation, State or Country Code</link:label>
    <link:label id="lab_dei_EntityIncorporationStateCountryCode_label_en-US" xlink:label="lab_dei_EntityIncorporationStateCountryCode" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Incorporation, State or Country Code</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityIncorporationStateCountryCode" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityIncorporationStateCountryCode"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityIncorporationStateCountryCode" xlink:to="lab_dei_EntityIncorporationStateCountryCode" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RevenueFromContractWithCustomerAbstract_d4863d07-7cfb-40bc-b62e-12d836fbda49_terseLabel_en-US" xlink:label="lab_us-gaap_RevenueFromContractWithCustomerAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue from Contract with Customer [Abstract]</link:label>
    <link:label id="lab_us-gaap_RevenueFromContractWithCustomerAbstract_label_en-US" xlink:label="lab_us-gaap_RevenueFromContractWithCustomerAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue from Contract with Customer [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueFromContractWithCustomerAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RevenueFromContractWithCustomerAbstract" xlink:to="lab_us-gaap_RevenueFromContractWithCustomerAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AdditionalPaidInCapitalCommonStock_377398f7-6423-4028-8869-9b8a6ea991b7_terseLabel_en-US" xlink:label="lab_us-gaap_AdditionalPaidInCapitalCommonStock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Additional paid-in capital</link:label>
    <link:label id="lab_us-gaap_AdditionalPaidInCapitalCommonStock_label_en-US" xlink:label="lab_us-gaap_AdditionalPaidInCapitalCommonStock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Additional Paid in Capital, Common Stock</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalCommonStock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdditionalPaidInCapitalCommonStock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AdditionalPaidInCapitalCommonStock" xlink:to="lab_us-gaap_AdditionalPaidInCapitalCommonStock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill_49ffdea4-8389-4af5-be95-0f82cc50e040_terseLabel_en-US" xlink:label="lab_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible asset impairment charges</link:label>
    <link:label id="lab_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill_label_en-US" xlink:label="lab_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Impairment of Intangible Assets (Excluding Goodwill)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill" xlink:to="lab_us-gaap_ImpairmentOfIntangibleAssetsExcludingGoodwill" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OneTimeTerminationBenefitsMember_0bc208d5-6216-4cee-83a7-acd8ade4cd07_terseLabel_en-US" xlink:label="lab_us-gaap_OneTimeTerminationBenefitsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">One-time Termination Benefits [Member]</link:label>
    <link:label id="lab_us-gaap_OneTimeTerminationBenefitsMember_label_en-US" xlink:label="lab_us-gaap_OneTimeTerminationBenefitsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">One-time Termination Benefits [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OneTimeTerminationBenefitsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OneTimeTerminationBenefitsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OneTimeTerminationBenefitsMember" xlink:to="lab_us-gaap_OneTimeTerminationBenefitsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringCostAndReserveAxis_132ea6da-8173-4e93-9ec2-30021e33e56b_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringCostAndReserveAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Type [Axis]</link:label>
    <link:label id="lab_us-gaap_RestructuringCostAndReserveAxis_label_en-US" xlink:label="lab_us-gaap_RestructuringCostAndReserveAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Type [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCostAndReserveAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis" xlink:to="lab_us-gaap_RestructuringCostAndReserveAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherAssetsNoncurrent_8bb9a85f-0a83-48e3-87bb-dd913bcfbdb5_terseLabel_en-US" xlink:label="lab_us-gaap_OtherAssetsNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other assets</link:label>
    <link:label id="lab_us-gaap_OtherAssetsNoncurrent_label_en-US" xlink:label="lab_us-gaap_OtherAssetsNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Assets, Noncurrent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsNoncurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAssetsNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherAssetsNoncurrent" xlink:to="lab_us-gaap_OtherAssetsNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_2493f126-78b6-48d2-b753-c3efe272e549_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Expected dividend yield</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Expected Dividend Rate</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CompensationAndRetirementDisclosureAbstract_b457781b-cd50-453c-9fc8-79addec0b60a_terseLabel_en-US" xlink:label="lab_us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retirement Benefits [Abstract]</link:label>
    <link:label id="lab_us-gaap_CompensationAndRetirementDisclosureAbstract_label_en-US" xlink:label="lab_us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retirement Benefits [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CompensationAndRetirementDisclosureAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:to="lab_us-gaap_CompensationAndRetirementDisclosureAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement_fd9a00d6-ed92-4c92-a396-beb16e72a92f_terseLabel_en-US" xlink:label="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Estimated forfeiture rate for unvested options for all non-senior management</link:label>
    <link:label id="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement_label_en-US" xlink:label="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Estimated Forfeiture Rate For Unvested Options For All Non Senior Management</link:label>
    <link:label id="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement_documentation_en-US" xlink:label="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Estimated forfeiture rate for unvested options for all non-senior management.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" xlink:href="cgnx-20211231.xsd#cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" xlink:to="lab_cgnx_EstimatedForfeitureRateForUnvestedOptionsForAllNonSeniorManagement" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InProcessResearchAndDevelopmentMember_6c766210-bb3d-4695-a11e-225dbec0ebc8_terseLabel_en-US" xlink:label="lab_us-gaap_InProcessResearchAndDevelopmentMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">In Process Research and Development [Member]</link:label>
    <link:label id="lab_us-gaap_InProcessResearchAndDevelopmentMember_label_en-US" xlink:label="lab_us-gaap_InProcessResearchAndDevelopmentMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">In Process Research and Development [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InProcessResearchAndDevelopmentMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InProcessResearchAndDevelopmentMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InProcessResearchAndDevelopmentMember" xlink:to="lab_us-gaap_InProcessResearchAndDevelopmentMember" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityFileNumber_61697655-131c-49ac-8ece-1c9ffaa41414_terseLabel_en-US" xlink:label="lab_dei_EntityFileNumber" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity File Number</link:label>
    <link:label id="lab_dei_EntityFileNumber_label_en-US" xlink:label="lab_dei_EntityFileNumber" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity File Number</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityFileNumber" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityFileNumber"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityFileNumber" xlink:to="lab_dei_EntityFileNumber" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_TWD_5f978e16-2b46-4acd-ad0b-28f7184c5126_terseLabel_en-US" xlink:label="lab_currency_TWD" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Taiwanese Dollar [Member]</link:label>
    <link:label id="lab_currency_TWD_label_en-US" xlink:label="lab_currency_TWD" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Taiwan, New Dollars</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_TWD" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_TWD"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_TWD" xlink:to="lab_currency_TWD" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_d0321a9f-4aa4-427c-9c04-8feca74e246e_terseLabel_en-US" xlink:label="lab_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock-based compensation expense</link:label>
    <link:label id="lab_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_label_en-US" xlink:label="lab_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">APIC, Share-based Payment Arrangement, Increase for Cost Recognition</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue" xlink:to="lab_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriod_257475cb-f661-4277-a7b6-bb7c6ebf3c84_negatedLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriod" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Forfeited or expired</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriod_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriod" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Forfeitures and Expirations in Period</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriod" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriod"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriod" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriod" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_ValuationAndQualifyingAccountsDisclosureLineItems_fbd9e923-1a5e-4a12-bf40-ca0baf1cf5bd_terseLabel_en-US" xlink:label="lab_srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation and Qualifying Accounts Disclosure [Line Items]</link:label>
    <link:label id="lab_srt_ValuationAndQualifyingAccountsDisclosureLineItems_label_en-US" xlink:label="lab_srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation and Qualifying Accounts Disclosure [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ValuationAndQualifyingAccountsDisclosureLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:to="lab_srt_ValuationAndQualifyingAccountsDisclosureLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InvestmentsInDebtAndEquityInstrumentsCashAndCashEquivalentsUnrealizedAndRealizedGainsLossesTextBlock_aaa6767c-5803-40c3-b753-5373e947572f_terseLabel_en-US" xlink:label="lab_us-gaap_InvestmentsInDebtAndEquityInstrumentsCashAndCashEquivalentsUnrealizedAndRealizedGainsLossesTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash, Cash Equivalents, and Investments</link:label>
    <link:label id="lab_us-gaap_InvestmentsInDebtAndEquityInstrumentsCashAndCashEquivalentsUnrealizedAndRealizedGainsLossesTextBlock_label_en-US" xlink:label="lab_us-gaap_InvestmentsInDebtAndEquityInstrumentsCashAndCashEquivalentsUnrealizedAndRealizedGainsLossesTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investments in Debt and Equity Instruments, Cash and Cash Equivalents, Unrealized and Realized Gains (Losses) [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentsInDebtAndEquityInstrumentsCashAndCashEquivalentsUnrealizedAndRealizedGainsLossesTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentsInDebtAndEquityInstrumentsCashAndCashEquivalentsUnrealizedAndRealizedGainsLossesTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InvestmentsInDebtAndEquityInstrumentsCashAndCashEquivalentsUnrealizedAndRealizedGainsLossesTextBlock" xlink:to="lab_us-gaap_InvestmentsInDebtAndEquityInstrumentsCashAndCashEquivalentsUnrealizedAndRealizedGainsLossesTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PreferredStockValueOutstanding_de2e5ef8-7507-45fc-9303-c53018f4dec0_terseLabel_en-US" xlink:label="lab_us-gaap_PreferredStockValueOutstanding" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred stock, $.01 par value - Authorized: 400 shares in 2021 and 2020, respectively, no shares issued and outstanding</link:label>
    <link:label id="lab_us-gaap_PreferredStockValueOutstanding_label_en-US" xlink:label="lab_us-gaap_PreferredStockValueOutstanding" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred Stock, Value, Outstanding</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockValueOutstanding" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockValueOutstanding"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PreferredStockValueOutstanding" xlink:to="lab_us-gaap_PreferredStockValueOutstanding" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BuildingMember_2a6ae73b-c41f-4c09-b634-0c99cea9c463_terseLabel_en-US" xlink:label="lab_us-gaap_BuildingMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Building [Member]</link:label>
    <link:label id="lab_us-gaap_BuildingMember_label_en-US" xlink:label="lab_us-gaap_BuildingMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Building [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BuildingMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BuildingMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BuildingMember" xlink:to="lab_us-gaap_BuildingMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_HardwareAndSoftwareMember_d8ec7412-8e1f-4d7e-96d7-38892da5ff76_terseLabel_en-US" xlink:label="lab_cgnx_HardwareAndSoftwareMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Computer Hardware And Software [Member]</link:label>
    <link:label id="lab_cgnx_HardwareAndSoftwareMember_label_en-US" xlink:label="lab_cgnx_HardwareAndSoftwareMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Hardware And Software [Member]</link:label>
    <link:label id="lab_cgnx_HardwareAndSoftwareMember_documentation_en-US" xlink:label="lab_cgnx_HardwareAndSoftwareMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Hardware and software.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_HardwareAndSoftwareMember" xlink:href="cgnx-20211231.xsd#cgnx_HardwareAndSoftwareMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_HardwareAndSoftwareMember" xlink:to="lab_cgnx_HardwareAndSoftwareMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_3110d645-9e57-4acd-8c6c-f42280204077_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Granted, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Grants in Period, Weighted Average Grant Date Fair Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_MunicipalBondsMember_b93f472d-cbde-4e22-8726-4417bbd54204_terseLabel_en-US" xlink:label="lab_us-gaap_MunicipalBondsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Municipal Bonds [Member]</link:label>
    <link:label id="lab_us-gaap_MunicipalBondsMember_label_en-US" xlink:label="lab_us-gaap_MunicipalBondsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Municipal Bonds [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MunicipalBondsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_MunicipalBondsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_MunicipalBondsMember" xlink:to="lab_us-gaap_MunicipalBondsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_9d145153-a0a5-406e-aaa0-a1ad4ec6184c_terseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net unrealized gain (loss), net of tax of $(2,206), $981, and $515 in 2021, 2020, and 2019, respectively</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">OCI, Debt Securities, Available-for-Sale, Unrealized Holding Gain (Loss), before Adjustment, after Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax" xlink:to="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther_382eb12a-db4f-4f27-89cf-b2859cd32926_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Bonuses, commissions, and other compensation</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Tax Deferred Expense, Compensation and Benefits, Other</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther" xlink:to="lab_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsOther" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_OtherGeographicAreaMember_07595842-3a02-483f-8ed5-6e20353b8497_terseLabel_en-US" xlink:label="lab_cgnx_OtherGeographicAreaMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other [Member]</link:label>
    <link:label id="lab_cgnx_OtherGeographicAreaMember_label_en-US" xlink:label="lab_cgnx_OtherGeographicAreaMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Geographic Area [Member]</link:label>
    <link:label id="lab_cgnx_OtherGeographicAreaMember_documentation_en-US" xlink:label="lab_cgnx_OtherGeographicAreaMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Geographic Area [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_OtherGeographicAreaMember" xlink:href="cgnx-20211231.xsd#cgnx_OtherGeographicAreaMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_OtherGeographicAreaMember" xlink:to="lab_cgnx_OtherGeographicAreaMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareRepurchaseProgramDomain_50fb1114-0f21-4bdd-b154-70ce39420fbc_terseLabel_en-US" xlink:label="lab_us-gaap_ShareRepurchaseProgramDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share Repurchase Program [Domain]</link:label>
    <link:label id="lab_us-gaap_ShareRepurchaseProgramDomain_label_en-US" xlink:label="lab_us-gaap_ShareRepurchaseProgramDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share Repurchase Program [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareRepurchaseProgramDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareRepurchaseProgramDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareRepurchaseProgramDomain" xlink:to="lab_us-gaap_ShareRepurchaseProgramDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AssetsAbstract_d4b1c614-e268-47be-a6eb-31b883d3c5ec_terseLabel_en-US" xlink:label="lab_us-gaap_AssetsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">ASSETS</link:label>
    <link:label id="lab_us-gaap_AssetsAbstract_label_en-US" xlink:label="lab_us-gaap_AssetsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Assets [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AssetsAbstract" xlink:to="lab_us-gaap_AssetsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LandMember_149ae3ae-8aa2-4b74-b274-e8a17105d531_terseLabel_en-US" xlink:label="lab_us-gaap_LandMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Land [Member]</link:label>
    <link:label id="lab_us-gaap_LandMember_label_en-US" xlink:label="lab_us-gaap_LandMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Land [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LandMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LandMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LandMember" xlink:to="lab_us-gaap_LandMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageExercisePrice_9ec1349d-526f-4d2f-8038-bd4d83f18439_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Options vested or expected to vest, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageExercisePrice_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Vested and Expected to Vest, Outstanding, Weighted Average Exercise Price</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageExercisePrice" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageExercisePrice"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageExercisePrice" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestOutstandingWeightedAverageExercisePrice" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum_4db900e8-95dd-4eeb-8a06-0a629cf81534_terseLabel_en-US" xlink:label="lab_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective maturity of investments</link:label>
    <link:label id="lab_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum_label_en-US" xlink:label="lab_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available-for-sale Securities, Debt Maturities, Effective Term, Maximum</link:label>
    <link:label id="lab_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum_documentation_en-US" xlink:label="lab_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available-for-sale Securities, Debt Maturities, Effective Term, Maximum</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum" xlink:href="cgnx-20211231.xsd#cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum" xlink:to="lab_cgnx_AvailableforsaleSecuritiesDebtMaturitiesEffectiveTermMaximum" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureTextBlock_bbaded0d-3836-40e5-8ca5-f743f73788de_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments</link:label>
    <link:label id="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments and Hedging Activities Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureTextBlock" xlink:to="lab_us-gaap_DerivativeInstrumentsAndHedgingActivitiesDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic_2be7369b-9667-43f1-97a1-d9688f13ab7d_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Federal and state tax credit carryforwards</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Operating Loss Carryforwards, Domestic</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic" xlink:to="lab_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsDomestic" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_6776db42-66e8-4b61-89f9-1ccdb225bca0_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Granted</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Grants in Period</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ConcentrationRiskPercentage1_f1239721-2e27-4b83-8b2b-fe7f45d7dac1_verboseLabel_en-US" xlink:label="lab_us-gaap_ConcentrationRiskPercentage1" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum percentage of revenue accountability</link:label>
    <link:label id="lab_us-gaap_ConcentrationRiskPercentage1_d2a5178a-198b-4185-ab1b-4abf7143222c_terseLabel_en-US" xlink:label="lab_us-gaap_ConcentrationRiskPercentage1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk, Percentage</link:label>
    <link:label id="lab_us-gaap_ConcentrationRiskPercentage1_label_en-US" xlink:label="lab_us-gaap_ConcentrationRiskPercentage1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk, Percentage</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskPercentage1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskPercentage1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ConcentrationRiskPercentage1" xlink:to="lab_us-gaap_ConcentrationRiskPercentage1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentPolicyTextBlock_126ac4da-c800-4dba-a8e3-b42b48679d66_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant, and Equipment</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_73417985-2380-4043-b3d3-2d63cc934a04_terseLabel_en-US" xlink:label="lab_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net proceeds from issuance of common stock under stock plans</link:label>
    <link:label id="lab_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_label_en-US" xlink:label="lab_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Proceeds, Issuance of Shares, Share-based Payment Arrangement, Including Option Exercised</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:to="lab_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber_925ba40f-1899-401b-bb46-2717141c87ba_periodStartLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning balance outstanding</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber_da62821b-5b46-400f-ab58-5c1034115e89_periodEndLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Ending balance outstanding</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding, Number</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_b057a76c-744f-4049-8a1b-f07bd5a48590_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Prepaid expenses and other current assets</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Prepaid Expense and Other Assets</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:to="lab_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AdvertisingCostsPolicyTextBlock_665a803f-52a1-4d4d-9a2d-50a6377bfc7e_terseLabel_en-US" xlink:label="lab_us-gaap_AdvertisingCostsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Advertising Costs</link:label>
    <link:label id="lab_us-gaap_AdvertisingCostsPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_AdvertisingCostsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Advertising Cost [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdvertisingCostsPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdvertisingCostsPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AdvertisingCostsPolicyTextBlock" xlink:to="lab_us-gaap_AdvertisingCostsPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommitmentsAndContingenciesDisclosureTextBlock_fc907807-3d44-4930-aaf1-ae521ffb6d35_terseLabel_en-US" xlink:label="lab_us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Commitments and Contingencies</link:label>
    <link:label id="lab_us-gaap_CommitmentsAndContingenciesDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Commitments and Contingencies Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommitmentsAndContingenciesDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" xlink:to="lab_us-gaap_CommitmentsAndContingenciesDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems_c7bc81eb-6664-4b52-a7b9-63bbfd20b513_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation [Line Items]</link:label>
    <link:label id="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems_label_en-US" xlink:label="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems" xlink:to="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock_dcfa6e45-3147-401e-9db4-bb322ecb92ab_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Constituents of Deferred Tax Assets</link:label>
    <link:label id="lab_us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Deferred Tax Assets and Liabilities [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfDeferredTaxAssetsAndLiabilitiesTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_EnShapeGmbHAbstract_4ac45e81-9ee7-4c34-9202-bde46bcce826_terseLabel_en-US" xlink:label="lab_cgnx_EnShapeGmbHAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">EnShape GmbH [Abstract]</link:label>
    <link:label id="lab_cgnx_EnShapeGmbHAbstract_label_en-US" xlink:label="lab_cgnx_EnShapeGmbHAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">EnShape GmbH [Abstract]</link:label>
    <link:label id="lab_cgnx_EnShapeGmbHAbstract_documentation_en-US" xlink:label="lab_cgnx_EnShapeGmbHAbstract" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">EnShape GmbH</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EnShapeGmbHAbstract" xlink:href="cgnx-20211231.xsd#cgnx_EnShapeGmbHAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_EnShapeGmbHAbstract" xlink:to="lab_cgnx_EnShapeGmbHAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InvestmentIncomeNonoperating_b7d8938a-adfe-4614-bd11-7a6318505b15_terseLabel_en-US" xlink:label="lab_us-gaap_InvestmentIncomeNonoperating" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investment income</link:label>
    <link:label id="lab_us-gaap_InvestmentIncomeNonoperating_label_en-US" xlink:label="lab_us-gaap_InvestmentIncomeNonoperating" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investment Income, Nonoperating</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeNonoperating" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentIncomeNonoperating"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InvestmentIncomeNonoperating" xlink:to="lab_us-gaap_InvestmentIncomeNonoperating" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommitmentsAndContingenciesDisclosureAbstract_6c53a4ac-c53a-4a76-8f96-8bda13f74ee8_terseLabel_en-US" xlink:label="lab_us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Commitments and Contingencies Disclosure [Abstract]</link:label>
    <link:label id="lab_us-gaap_CommitmentsAndContingenciesDisclosureAbstract_label_en-US" xlink:label="lab_us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Commitments and Contingencies Disclosure [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommitmentsAndContingenciesDisclosureAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:to="lab_us-gaap_CommitmentsAndContingenciesDisclosureAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_TaxCreditCarryforwardTable_09c8cc9b-45b1-4f4b-a2f4-ba224be4cdf0_terseLabel_en-US" xlink:label="lab_us-gaap_TaxCreditCarryforwardTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax Credit Carryforward [Table]</link:label>
    <link:label id="lab_us-gaap_TaxCreditCarryforwardTable_label_en-US" xlink:label="lab_us-gaap_TaxCreditCarryforwardTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax Credit Carryforward [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TaxCreditCarryforwardTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TaxCreditCarryforwardTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_TaxCreditCarryforwardTable" xlink:to="lab_us-gaap_TaxCreditCarryforwardTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRecovery_c79a9e21-e535-4a30-b2f3-04f2f4395860_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRecovery" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Decreases to the allowance for credit losses</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRecovery_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRecovery" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss, Recovery</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRecovery" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRecovery"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRecovery" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRecovery" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GuaranteesAbstract_e4b21c02-f775-4946-9a3b-4b30c081c52f_terseLabel_en-US" xlink:label="lab_us-gaap_GuaranteesAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Guarantees [Abstract]</link:label>
    <link:label id="lab_us-gaap_GuaranteesAbstract_label_en-US" xlink:label="lab_us-gaap_GuaranteesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Guarantees [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GuaranteesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GuaranteesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GuaranteesAbstract" xlink:to="lab_us-gaap_GuaranteesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_54b09cb4-0bfb-48e6-820e-2fa5deb540ad_terseLabel_en-US" xlink:label="lab_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Indefinite-lived Intangible Assets, Major Class Name [Domain]</link:label>
    <link:label id="lab_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_label_en-US" xlink:label="lab_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Indefinite-lived Intangible Assets, Major Class Name [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:to="lab_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_6cf8129a-3129-4600-a3d6-e4465f198b54_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2024</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, to be Paid, Year Three</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive_36e76c02-ab3c-4a2a-81e5-11db63d99e9e_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Thereafter</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Asset, Expected Amortization, after Year Five</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringReserveTranslationAdjustment_c09a2b60-6c20-43d5-aed0-d013f379df76_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringReserveTranslationAdjustment" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign exchange rate changes</link:label>
    <link:label id="lab_us-gaap_RestructuringReserveTranslationAdjustment_label_en-US" xlink:label="lab_us-gaap_RestructuringReserveTranslationAdjustment" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Reserve, Foreign Currency Translation Gain (Loss)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringReserveTranslationAdjustment" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringReserveTranslationAdjustment"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringReserveTranslationAdjustment" xlink:to="lab_us-gaap_RestructuringReserveTranslationAdjustment" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesTypeAxis_eefd488d-e0a9-47ac-88ab-d00ea98dbb6f_terseLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves Type [Axis]</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesTypeAxis_label_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves Type [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ValuationAllowancesAndReservesTypeAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:to="lab_us-gaap_ValuationAllowancesAndReservesTypeAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommitmentsAndContingenciesPolicyTextBlock_452e734c-a55f-4b15-8c53-6342ea72b47e_terseLabel_en-US" xlink:label="lab_us-gaap_CommitmentsAndContingenciesPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contingencies</link:label>
    <link:label id="lab_us-gaap_CommitmentsAndContingenciesPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_CommitmentsAndContingenciesPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Commitments and Contingencies, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingenciesPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommitmentsAndContingenciesPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommitmentsAndContingenciesPolicyTextBlock" xlink:to="lab_us-gaap_CommitmentsAndContingenciesPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DisaggregationOfRevenueTableTextBlock_19b4fdc9-a944-4e2f-a2dd-7d0111ef8303_terseLabel_en-US" xlink:label="lab_us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Disaggregation of Revenue</link:label>
    <link:label id="lab_us-gaap_DisaggregationOfRevenueTableTextBlock_label_en-US" xlink:label="lab_us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Disaggregation of Revenue [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DisaggregationOfRevenueTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:to="lab_us-gaap_DisaggregationOfRevenueTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockOptionPlanExpense_05446b35-97d4-4209-9b48-34cddd8d51d1_terseLabel_en-US" xlink:label="lab_us-gaap_StockOptionPlanExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock-based compensation expense</link:label>
    <link:label id="lab_us-gaap_StockOptionPlanExpense_label_en-US" xlink:label="lab_us-gaap_StockOptionPlanExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock or Unit Option Plan Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockOptionPlanExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockOptionPlanExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockOptionPlanExpense" xlink:to="lab_us-gaap_StockOptionPlanExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DefinedContributionPlanCostRecognized_c7ee1549-4f03-4562-af9f-f88d0312c69d_terseLabel_en-US" xlink:label="lab_us-gaap_DefinedContributionPlanCostRecognized" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company contributions to employee savings plan</link:label>
    <link:label id="lab_us-gaap_DefinedContributionPlanCostRecognized_label_en-US" xlink:label="lab_us-gaap_DefinedContributionPlanCostRecognized" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Defined Contribution Plan, Cost</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedContributionPlanCostRecognized" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DefinedContributionPlanCostRecognized"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DefinedContributionPlanCostRecognized" xlink:to="lab_us-gaap_DefinedContributionPlanCostRecognized" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParentAbstract_5be70024-9027-422a-9a6b-6b9a0c729c85_terseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParentAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available-for-sale investments:</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParentAbstract_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParentAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Comprehensive Income (Loss), Available-for-sale Securities Adjustment, Net of Tax, Portion Attributable to Parent [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParentAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParentAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParentAbstract" xlink:to="lab_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParentAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_2dc3f1ed-65c3-40aa-8681-7550ed911a3e_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Nonvested, Number of Shares [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Nonvested, Number of Shares [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock_dc4a4d93-b2ab-4341-93be-df2ad78c85c9_terseLabel_en-US" xlink:label="lab_us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nonvested Restricted Stock Shares Activity [Table Text Block]</link:label>
    <link:label id="lab_us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock_label_en-US" xlink:label="lab_us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Nonvested Restricted Stock Shares Activity [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:to="lab_us-gaap_NonvestedRestrictedStockSharesActivityTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1_6d197d30-6175-49e1-baaa-b2ae85aec57e_terseLabel_en-US" xlink:label="lab_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maturities of forward of contracts</link:label>
    <link:label id="lab_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1_label_en-US" xlink:label="lab_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum Remaining Maturity of Foreign Currency Derivatives</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1" xlink:to="lab_us-gaap_MaximumRemainingMaturityOfForeignCurrencyDerivatives1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeasePayments_4e984ed0-1dc9-4492-9bfa-111b7c13c802_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeasePayments" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease payments</link:label>
    <link:label id="lab_us-gaap_OperatingLeasePayments_label_en-US" xlink:label="lab_us-gaap_OperatingLeasePayments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Payments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeasePayments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeasePayments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeasePayments" xlink:to="lab_us-gaap_OperatingLeasePayments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent_82f91982-12ab-49ee-ac0e-1329acc2ebb3_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete tax benefit related to employee stock option exercises</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent_34ce6589-21a2-4c62-af11-795d020a1619_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete tax benefit related to employee stock options</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Expense (Benefit), Share-based Payment Arrangement, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitPercent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminated_ac831795-a54b-4da4-9f5a-69a90b5d8f7c_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminated" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Number of positions eliminated</link:label>
    <link:label id="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminated_label_en-US" xlink:label="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminated" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring and Related Cost, Number of Positions Eliminated</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminated" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminated"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminated" xlink:to="lab_us-gaap_RestructuringAndRelatedCostNumberOfPositionsEliminated" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationConsiderationTransferred1_873c8cd9-eadd-4e6d-8425-8f3e1561ba80_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationConsiderationTransferred1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Purchase price</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationConsiderationTransferred1_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationConsiderationTransferred1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combination, Consideration Transferred</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationConsiderationTransferred1" xlink:to="lab_us-gaap_BusinessCombinationConsiderationTransferred1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProvisionForDoubtfulAccounts_28e853ae-2128-427f-be24-e1f823d25b34_terseLabel_en-US" xlink:label="lab_us-gaap_ProvisionForDoubtfulAccounts" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increases to the allowance for credit losses</link:label>
    <link:label id="lab_us-gaap_ProvisionForDoubtfulAccounts_label_en-US" xlink:label="lab_us-gaap_ProvisionForDoubtfulAccounts" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable, Credit Loss Expense (Reversal)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProvisionForDoubtfulAccounts" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProvisionForDoubtfulAccounts"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProvisionForDoubtfulAccounts" xlink:to="lab_us-gaap_ProvisionForDoubtfulAccounts" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar_9f1bab4e-80e8-4bc0-af61-3034ee2769c0_terseLabel_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Migration of Acquired Intellectual Property Dollar</link:label>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar_label_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Migration of Acquired Intellectual Property Dollar</link:label>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar_documentation_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Migration of Acquired Intellectual Property Dollar</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar" xlink:href="cgnx-20211231.xsd#cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar" xlink:to="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationOfAcquiredIntellectualPropertyDollar" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GoodwillRollForward_407d5dea-c9e0-438c-b7a9-05524a861d69_terseLabel_en-US" xlink:label="lab_us-gaap_GoodwillRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_GoodwillRollForward_label_en-US" xlink:label="lab_us-gaap_GoodwillRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GoodwillRollForward" xlink:to="lab_us-gaap_GoodwillRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue_3d7e2ab8-456f-49d0-b14d-5ffc682e47ba_terseLabel_en-US" xlink:label="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Exercisable, aggregate intrinsic value</link:label>
    <link:label id="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue_label_en-US" xlink:label="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share Based Compensation Arrangement By Share Based Payment Award Options Exercisable Aggregate Intrinsic Value</link:label>
    <link:label id="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue_documentation_en-US" xlink:label="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share based compensation arrangement by share based payment award options exercisable aggregate intrinsic value.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" xlink:href="cgnx-20211231.xsd#cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" xlink:to="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableAggregateIntrinsicValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ReconciliationOfUnrecognizedTaxBenefitsExcludingAmountsPertainingToExaminedTaxReturnsRollForward_93c5338c-12ad-40c6-a0df-a04095b58754_terseLabel_en-US" xlink:label="lab_us-gaap_ReconciliationOfUnrecognizedTaxBenefitsExcludingAmountsPertainingToExaminedTaxReturnsRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reconciliation of Unrecognized Tax Benefits, Excluding Amounts Pertaining to Examined Tax Returns [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_ReconciliationOfUnrecognizedTaxBenefitsExcludingAmountsPertainingToExaminedTaxReturnsRollForward_label_en-US" xlink:label="lab_us-gaap_ReconciliationOfUnrecognizedTaxBenefitsExcludingAmountsPertainingToExaminedTaxReturnsRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reconciliation of Unrecognized Tax Benefits, Excluding Amounts Pertaining to Examined Tax Returns [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReconciliationOfUnrecognizedTaxBenefitsExcludingAmountsPertainingToExaminedTaxReturnsRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ReconciliationOfUnrecognizedTaxBenefitsExcludingAmountsPertainingToExaminedTaxReturnsRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ReconciliationOfUnrecognizedTaxBenefitsExcludingAmountsPertainingToExaminedTaxReturnsRollForward" xlink:to="lab_us-gaap_ReconciliationOfUnrecognizedTaxBenefitsExcludingAmountsPertainingToExaminedTaxReturnsRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_SouthboroughMassachusettsMember_f004e00e-ad7d-4a0c-8ea4-541f1ae972cd_terseLabel_en-US" xlink:label="lab_cgnx_SouthboroughMassachusettsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Southborough, Massachusetts</link:label>
    <link:label id="lab_cgnx_SouthboroughMassachusettsMember_label_en-US" xlink:label="lab_cgnx_SouthboroughMassachusettsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Southborough, Massachusetts [Member]</link:label>
    <link:label id="lab_cgnx_SouthboroughMassachusettsMember_documentation_en-US" xlink:label="lab_cgnx_SouthboroughMassachusettsMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Southborough, Massachusetts</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_SouthboroughMassachusettsMember" xlink:href="cgnx-20211231.xsd#cgnx_SouthboroughMassachusettsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_SouthboroughMassachusettsMember" xlink:to="lab_cgnx_SouthboroughMassachusettsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LiabilitiesAndStockholdersEquity_3516e3e2-78ac-45f8-91c0-65da00d9ae67_totalLabel_en-US" xlink:label="lab_us-gaap_LiabilitiesAndStockholdersEquity" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total liabilities and shareholders' equity</link:label>
    <link:label id="lab_us-gaap_LiabilitiesAndStockholdersEquity_label_en-US" xlink:label="lab_us-gaap_LiabilitiesAndStockholdersEquity" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liabilities and Equity</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity" xlink:to="lab_us-gaap_LiabilitiesAndStockholdersEquity" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_a3022f82-cf31-492b-80c7-ad713dd9c3e3_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Other Adjustments, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherAccruedLiabilitiesCurrent_fbbf3eb9-b734-4b36-a83e-da30561b7b8e_terseLabel_en-US" xlink:label="lab_us-gaap_OtherAccruedLiabilitiesCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other</link:label>
    <link:label id="lab_us-gaap_OtherAccruedLiabilitiesCurrent_label_en-US" xlink:label="lab_us-gaap_OtherAccruedLiabilitiesCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Accrued Liabilities, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAccruedLiabilitiesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAccruedLiabilitiesCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherAccruedLiabilitiesCurrent" xlink:to="lab_us-gaap_OtherAccruedLiabilitiesCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_AmericasMember_f3692a35-630b-4291-8bc6-40826b164c43_terseLabel_en-US" xlink:label="lab_srt_AmericasMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Americas [Member]</link:label>
    <link:label id="lab_srt_AmericasMember_label_en-US" xlink:label="lab_srt_AmericasMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Americas [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_AmericasMember" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_AmericasMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_AmericasMember" xlink:to="lab_srt_AmericasMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ContractWithCustomerLiabilityCurrent_1d0f4746-0c17-40b0-8186-4b5e9b3e4360_terseLabel_en-US" xlink:label="lab_us-gaap_ContractWithCustomerLiabilityCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred revenue and customer deposits</link:label>
    <link:label id="lab_us-gaap_ContractWithCustomerLiabilityCurrent_0edb6e5f-ad3e-4404-9088-17e9a59498f2_periodStartLabel_en-US" xlink:label="lab_us-gaap_ContractWithCustomerLiabilityCurrent" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning balance</link:label>
    <link:label id="lab_us-gaap_ContractWithCustomerLiabilityCurrent_8d1cf19d-8e6a-4096-b80b-f428e1995051_periodEndLabel_en-US" xlink:label="lab_us-gaap_ContractWithCustomerLiabilityCurrent" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">End balance</link:label>
    <link:label id="lab_us-gaap_ContractWithCustomerLiabilityCurrent_label_en-US" xlink:label="lab_us-gaap_ContractWithCustomerLiabilityCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract with Customer, Liability, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ContractWithCustomerLiabilityCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ContractWithCustomerLiabilityCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ContractWithCustomerLiabilityCurrent" xlink:to="lab_us-gaap_ContractWithCustomerLiabilityCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_554434e0-2431-4c98-ad0b-66c352fdc784_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2026</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, to be Paid, Year Five</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsExercisesInPeriodWeightedAverageExercisePrice_57b59823-d151-4f30-a06b-b829388b9450_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsExercisesInPeriodWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Exercised, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsExercisesInPeriodWeightedAverageExercisePrice_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsExercisesInPeriodWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangements by Share-based Payment Award, Options, Exercises in Period, Weighted Average Exercise Price</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsExercisesInPeriodWeightedAverageExercisePrice" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsExercisesInPeriodWeightedAverageExercisePrice"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsExercisesInPeriodWeightedAverageExercisePrice" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsExercisesInPeriodWeightedAverageExercisePrice" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeLeaseDescriptionTable_c195ece9-8e4e-4e3d-ad1e-a99395979487_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeLeaseDescriptionTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Lease, Description [Table]</link:label>
    <link:label id="lab_us-gaap_LesseeLeaseDescriptionTable_label_en-US" xlink:label="lab_us-gaap_LesseeLeaseDescriptionTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Lease, Description [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeLeaseDescriptionTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeLeaseDescriptionTable" xlink:to="lab_us-gaap_LesseeLeaseDescriptionTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ConcentrationRiskLineItems_b6a446b4-a240-41ae-8787-0af56ce2a0c2_terseLabel_en-US" xlink:label="lab_us-gaap_ConcentrationRiskLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk [Line Items]</link:label>
    <link:label id="lab_us-gaap_ConcentrationRiskLineItems_label_en-US" xlink:label="lab_us-gaap_ConcentrationRiskLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ConcentrationRiskLineItems" xlink:to="lab_us-gaap_ConcentrationRiskLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeLineItems_6a74dcf7-81dd-44b6-b7d9-da52f23b14c8_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative [Line Items]</link:label>
    <link:label id="lab_us-gaap_DerivativeLineItems_label_en-US" xlink:label="lab_us-gaap_DerivativeLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeLineItems" xlink:to="lab_us-gaap_DerivativeLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringReserveRollForward_dba1afa5-2b73-40c3-a770-55b74f64be3d_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringReserveRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Reserve [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_RestructuringReserveRollForward_label_en-US" xlink:label="lab_us-gaap_RestructuringReserveRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Reserve [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringReserveRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringReserveRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringReserveRollForward" xlink:to="lab_us-gaap_RestructuringReserveRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure_f73b5e4a-c0ed-4998-ab63-985db450f549_terseLabel_en-US" xlink:label="lab_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Economic hedge forward contracts</link:label>
    <link:label id="lab_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure_label_en-US" xlink:label="lab_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Currency Contract, Asset, Fair Value Disclosure</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignCurrencyContractAssetFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure" xlink:to="lab_us-gaap_ForeignCurrencyContractAssetFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EarningsPerShareTextBlock_79e10c6a-90cc-4638-b4f6-4d8abcca1c23_terseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerShareTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted Average Shares</link:label>
    <link:label id="lab_us-gaap_EarningsPerShareTextBlock_label_en-US" xlink:label="lab_us-gaap_EarningsPerShareTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Earnings Per Share [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EarningsPerShareTextBlock" xlink:to="lab_us-gaap_EarningsPerShareTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseImpairmentLoss_a686f457-d378-4745-800f-6529ada54a9a_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseImpairmentLoss" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Impairment Loss</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseImpairmentLoss_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseImpairmentLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Impairment Loss</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseImpairmentLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseImpairmentLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseImpairmentLoss" xlink:to="lab_us-gaap_OperatingLeaseImpairmentLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DiscreteTaxItemsDomain_0bf00902-2cdd-4013-a405-792c59c6a820_terseLabel_en-US" xlink:label="lab_cgnx_DiscreteTaxItemsDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Items [Domain]</link:label>
    <link:label id="lab_cgnx_DiscreteTaxItemsDomain_label_en-US" xlink:label="lab_cgnx_DiscreteTaxItemsDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Items [Domain]</link:label>
    <link:label id="lab_cgnx_DiscreteTaxItemsDomain_documentation_en-US" xlink:label="lab_cgnx_DiscreteTaxItemsDomain" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Items</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DiscreteTaxItemsDomain" xlink:href="cgnx-20211231.xsd#cgnx_DiscreteTaxItemsDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DiscreteTaxItemsDomain" xlink:to="lab_cgnx_DiscreteTaxItemsDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccountingChangesAndErrorCorrectionsAbstract_13cd54c3-a75c-4a2a-86e1-5ba600645e1a_terseLabel_en-US" xlink:label="lab_us-gaap_AccountingChangesAndErrorCorrectionsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounting Changes and Error Corrections [Abstract]</link:label>
    <link:label id="lab_us-gaap_AccountingChangesAndErrorCorrectionsAbstract_label_en-US" xlink:label="lab_us-gaap_AccountingChangesAndErrorCorrectionsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounting Changes and Error Corrections [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountingChangesAndErrorCorrectionsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountingChangesAndErrorCorrectionsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccountingChangesAndErrorCorrectionsAbstract" xlink:to="lab_us-gaap_AccountingChangesAndErrorCorrectionsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_MinimumMember_41185c07-1a6f-425a-8336-64a1e0798686_terseLabel_en-US" xlink:label="lab_srt_MinimumMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Minimum [Member]</link:label>
    <link:label id="lab_srt_MinimumMember_label_en-US" xlink:label="lab_srt_MinimumMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Minimum [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MinimumMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_MinimumMember" xlink:to="lab_srt_MinimumMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet_d42adbc4-646b-442b-9653-e1b2d13bc8e2_negatedLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Other Operating Assets and Liabilities, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet" xlink:to="lab_us-gaap_IncreaseDecreaseInOtherOperatingCapitalNet" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized_2d5ea881-8f1d-4ece-a33a-44fa89dad518_negatedTerseLabel_en-US" xlink:label="lab_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Recognition of revenue deferred in prior period</link:label>
    <link:label id="lab_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized_label_en-US" xlink:label="lab_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract with Customer, Liability, Current And Prior Period Revenue Recognized</link:label>
    <link:label id="lab_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized_documentation_en-US" xlink:label="lab_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract with Customer, Liability, Current And Prior Period Revenue Recognized</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized" xlink:href="cgnx-20211231.xsd#cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized" xlink:to="lab_cgnx_ContractWithCustomerLiabilityCurrentAndPriorPeriodRevenueRecognized" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GrossProfit_a0c72284-d686-41d6-9318-d1237906b0b4_totalLabel_en-US" xlink:label="lab_us-gaap_GrossProfit" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross margin</link:label>
    <link:label id="lab_us-gaap_GrossProfit_label_en-US" xlink:label="lab_us-gaap_GrossProfit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross Profit</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GrossProfit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GrossProfit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GrossProfit" xlink:to="lab_us-gaap_GrossProfit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_b105bbf0-1513-4a7f-82f4-1f6f8796ee50_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2023</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, to be Paid, Year Two</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_59cbd786-ddae-400c-8232-7561c33b94af_terseLabel_en-US" xlink:label="lab_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effect of foreign exchange rate changes on cash and cash equivalents</link:label>
    <link:label id="lab_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_label_en-US" xlink:label="lab_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effect of Exchange Rate on Cash, Cash Equivalents, Restricted Cash and Restricted Cash Equivalents</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:to="lab_us-gaap_EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsTable_c8ee318b-f4a4-4ae6-9f9f-c95aa62f710e_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Revenues from External Customers and Long-Lived Assets [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Revenues from External Customers and Long-Lived Assets [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsTable" xlink:to="lab_us-gaap_ScheduleOfRevenuesFromExternalCustomersAndLongLivedAssetsTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SellingGeneralAndAdministrativeExpense_45e4503c-238e-4d21-9e72-a171df7cb7f6_terseLabel_en-US" xlink:label="lab_us-gaap_SellingGeneralAndAdministrativeExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Selling, general, and administrative expenses</link:label>
    <link:label id="lab_us-gaap_SellingGeneralAndAdministrativeExpense_label_en-US" xlink:label="lab_us-gaap_SellingGeneralAndAdministrativeExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Selling, General and Administrative Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SellingGeneralAndAdministrativeExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SellingGeneralAndAdministrativeExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SellingGeneralAndAdministrativeExpense" xlink:to="lab_us-gaap_SellingGeneralAndAdministrativeExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriodWeightedAverageExercisePrice_9e1ded63-5fa9-4123-8c59-6a1692fce456_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriodWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Forfeited or expired, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriodWeightedAverageExercisePrice_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriodWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Forfeitures and Expirations in Period, Weighted Average Exercise Price</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriodWeightedAverageExercisePrice" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriodWeightedAverageExercisePrice"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriodWeightedAverageExercisePrice" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsForfeituresAndExpirationsInPeriodWeightedAverageExercisePrice" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_7b6bfb80-1f48-4e60-b9fc-1d9eb06c0082_terseLabel_en-US" xlink:label="lab_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Indefinite-lived Intangible Assets [Axis]</link:label>
    <link:label id="lab_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_label_en-US" xlink:label="lab_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Indefinite-lived Intangible Assets [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="lab_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PreferredStockSharesAuthorized_558dd2f9-cc54-4d4d-86e6-6b0e88e77281_verboseLabel_en-US" xlink:label="lab_us-gaap_PreferredStockSharesAuthorized" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred stock, shares authorized</link:label>
    <link:label id="lab_us-gaap_PreferredStockSharesAuthorized_1ffc2c45-e6a7-4f35-af3f-65d2a5cef4f1_terseLabel_en-US" xlink:label="lab_us-gaap_PreferredStockSharesAuthorized" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Authorized shares</link:label>
    <link:label id="lab_us-gaap_PreferredStockSharesAuthorized_label_en-US" xlink:label="lab_us-gaap_PreferredStockSharesAuthorized" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred Stock, Shares Authorized</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockSharesAuthorized" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockSharesAuthorized"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PreferredStockSharesAuthorized" xlink:to="lab_us-gaap_PreferredStockSharesAuthorized" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_ab01fbe6-1859-4b00-a349-ae77f95d89a9_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Greater than 12 Months</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Continuous Unrealized Loss Position, 12 Months or Longer</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_TreasuryBillsFairValueDisclosure_3df6922d-a895-4df0-abc6-b8f1db54d519_terseLabel_en-US" xlink:label="lab_cgnx_TreasuryBillsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Treasury bills</link:label>
    <link:label id="lab_cgnx_TreasuryBillsFairValueDisclosure_label_en-US" xlink:label="lab_cgnx_TreasuryBillsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Treasury Bills Fair Value Disclosure</link:label>
    <link:label id="lab_cgnx_TreasuryBillsFairValueDisclosure_documentation_en-US" xlink:label="lab_cgnx_TreasuryBillsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Treasury bills fair value disclosure.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_TreasuryBillsFairValueDisclosure" xlink:href="cgnx-20211231.xsd#cgnx_TreasuryBillsFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_TreasuryBillsFairValueDisclosure" xlink:to="lab_cgnx_TreasuryBillsFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ContractLiabilityForeignExchangeRateChanges_5b5e56ae-62e6-4d98-92b9-83558e116fda_terseLabel_en-US" xlink:label="lab_cgnx_ContractLiabilityForeignExchangeRateChanges" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign exchange rate changes</link:label>
    <link:label id="lab_cgnx_ContractLiabilityForeignExchangeRateChanges_label_en-US" xlink:label="lab_cgnx_ContractLiabilityForeignExchangeRateChanges" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract Liability Foreign Exchange Rate Changes</link:label>
    <link:label id="lab_cgnx_ContractLiabilityForeignExchangeRateChanges_documentation_en-US" xlink:label="lab_cgnx_ContractLiabilityForeignExchangeRateChanges" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contract Liability Foreign Exchange Rate Changes</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ContractLiabilityForeignExchangeRateChanges" xlink:href="cgnx-20211231.xsd#cgnx_ContractLiabilityForeignExchangeRateChanges"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ContractLiabilityForeignExchangeRateChanges" xlink:to="lab_cgnx_ContractLiabilityForeignExchangeRateChanges" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RevenueRecognitionPolicyTextBlock_c98ac4d9-5752-42f2-8ca8-c0cd11d5a054_terseLabel_en-US" xlink:label="lab_us-gaap_RevenueRecognitionPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue Recognition</link:label>
    <link:label id="lab_us-gaap_RevenueRecognitionPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_RevenueRecognitionPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenue [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueRecognitionPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenueRecognitionPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RevenueRecognitionPolicyTextBlock" xlink:to="lab_us-gaap_RevenueRecognitionPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired_eef7416a-e47b-47d9-8664-c33ebcea683f_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business acquisitions</link:label>
    <link:label id="lab_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired_label_en-US" xlink:label="lab_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments to Acquire Businesses, Net of Cash Acquired</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired" xlink:to="lab_us-gaap_PaymentsToAcquireBusinessesNetOfCashAcquired" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherRestructuringMember_759649a7-7453-40c6-8b7a-9b0448b543bd_terseLabel_en-US" xlink:label="lab_us-gaap_OtherRestructuringMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Restructuring [Member]</link:label>
    <link:label id="lab_us-gaap_OtherRestructuringMember_label_en-US" xlink:label="lab_us-gaap_OtherRestructuringMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Restructuring [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherRestructuringMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherRestructuringMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherRestructuringMember" xlink:to="lab_us-gaap_OtherRestructuringMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock_3665e736-5a95-4e8c-b72c-874a861d8d98_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Constituents of Provision for Income Taxes</link:label>
    <link:label id="lab_us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Components of Income Tax Expense (Benefit) [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfComponentsOfIncomeTaxExpenseBenefitTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock_c95ed802-c57a-4994-99a9-3085058c21c8_terseLabel_en-US" xlink:label="lab_us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock-Based Compensation</link:label>
    <link:label id="lab_us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock_label_en-US" xlink:label="lab_us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" xlink:to="lab_us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueInputsLevel3Member_7d952185-a92e-402a-852d-30efe7638719_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueInputsLevel3Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unobservable Inputs (Level 3)</link:label>
    <link:label id="lab_us-gaap_FairValueInputsLevel3Member_label_en-US" xlink:label="lab_us-gaap_FairValueInputsLevel3Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Inputs, Level 3 [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueInputsLevel3Member" xlink:to="lab_us-gaap_FairValueInputsLevel3Member" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsOfDividendsCommonStock_dd064324-65bb-4565-833a-b73dc67e556a_negatedLabel_en-US" xlink:label="lab_us-gaap_PaymentsOfDividendsCommonStock" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payment of dividends</link:label>
    <link:label id="lab_us-gaap_PaymentsOfDividendsCommonStock_label_en-US" xlink:label="lab_us-gaap_PaymentsOfDividendsCommonStock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments of Ordinary Dividends, Common Stock</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDividendsCommonStock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsOfDividendsCommonStock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsOfDividendsCommonStock" xlink:to="lab_us-gaap_PaymentsOfDividendsCommonStock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeLeasesPolicyTextBlock_40eae93c-4edb-4322-873d-c5c7578cf757_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeLeasesPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Leases</link:label>
    <link:label id="lab_us-gaap_LesseeLeasesPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_LesseeLeasesPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Leases [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeasesPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeLeasesPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeLeasesPolicyTextBlock" xlink:to="lab_us-gaap_LesseeLeasesPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax_86587937-47bf-4b1f-b94f-dbe178b5538e_terseLabel_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net unrealized losses on available-for-sale investments, net of tax</link:label>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax_label_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">AOCI, Debt Securities, Available-for-sale, Adjustment, after Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:to="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossAvailableForSaleSecuritiesAdjustmentNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NumberOfReportableSegments_5d559c9d-49e8-4c88-b52a-a38ee6faae65_terseLabel_en-US" xlink:label="lab_us-gaap_NumberOfReportableSegments" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Number of reportable segments</link:label>
    <link:label id="lab_us-gaap_NumberOfReportableSegments_label_en-US" xlink:label="lab_us-gaap_NumberOfReportableSegments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Number of Reportable Segments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NumberOfReportableSegments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NumberOfReportableSegments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NumberOfReportableSegments" xlink:to="lab_us-gaap_NumberOfReportableSegments" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AccruedExpensesMember_47a7cd31-563e-4820-8054-0a4e706d4945_terseLabel_en-US" xlink:label="lab_cgnx_AccruedExpensesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Expenses [Member]</link:label>
    <link:label id="lab_cgnx_AccruedExpensesMember_label_en-US" xlink:label="lab_cgnx_AccruedExpensesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Expenses [Member]</link:label>
    <link:label id="lab_cgnx_AccruedExpensesMember_documentation_en-US" xlink:label="lab_cgnx_AccruedExpensesMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued expenses.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AccruedExpensesMember" xlink:href="cgnx-20211231.xsd#cgnx_AccruedExpensesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AccruedExpensesMember" xlink:to="lab_cgnx_AccruedExpensesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax_aad6c698-d7e9-4de0-94ac-bf32f20a8ac1_terseLabel_en-US" xlink:label="lab_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign currency gain (loss)</link:label>
    <link:label id="lab_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax_label_en-US" xlink:label="lab_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Currency Transaction Gain (Loss), before Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ForeignCurrencyTransactionGainLossBeforeTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax" xlink:to="lab_us-gaap_ForeignCurrencyTransactionGainLossBeforeTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DisaggregationOfRevenueLineItems_b90a6770-289e-4120-a6ae-b160e9211991_terseLabel_en-US" xlink:label="lab_us-gaap_DisaggregationOfRevenueLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Disaggregation of Revenue [Line Items]</link:label>
    <link:label id="lab_us-gaap_DisaggregationOfRevenueLineItems_label_en-US" xlink:label="lab_us-gaap_DisaggregationOfRevenueLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Disaggregation of Revenue [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DisaggregationOfRevenueLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DisaggregationOfRevenueLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DisaggregationOfRevenueLineItems" xlink:to="lab_us-gaap_DisaggregationOfRevenueLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PerformanceSharesMember_cf8fcdcd-e72b-4ca5-86b2-f1b06bb59457_terseLabel_en-US" xlink:label="lab_us-gaap_PerformanceSharesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Performance Shares [Member]</link:label>
    <link:label id="lab_us-gaap_PerformanceSharesMember_label_en-US" xlink:label="lab_us-gaap_PerformanceSharesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Performance Shares [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PerformanceSharesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PerformanceSharesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PerformanceSharesMember" xlink:to="lab_us-gaap_PerformanceSharesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommitmentsAndContingencies_13bf5ea2-3b5f-4cc5-b7b0-8754d46d7d0d_terseLabel_en-US" xlink:label="lab_us-gaap_CommitmentsAndContingencies" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Commitments and contingencies (Note 11)</link:label>
    <link:label id="lab_us-gaap_CommitmentsAndContingencies_label_en-US" xlink:label="lab_us-gaap_CommitmentsAndContingencies" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Commitments and Contingencies</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingencies" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommitmentsAndContingencies"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommitmentsAndContingencies" xlink:to="lab_us-gaap_CommitmentsAndContingencies" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SubsequentEventTable_a0208b8a-de8e-4497-be14-9346473d8292_terseLabel_en-US" xlink:label="lab_us-gaap_SubsequentEventTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event [Table]</link:label>
    <link:label id="lab_us-gaap_SubsequentEventTable_label_en-US" xlink:label="lab_us-gaap_SubsequentEventTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SubsequentEventTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SubsequentEventTable" xlink:to="lab_us-gaap_SubsequentEventTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_203f79e7-8d6e-4cb6-ae4c-59418cf38a7b_terseLabel_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated other comprehensive loss, net of tax</link:label>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_label_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Other Comprehensive Income (Loss), Net of Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:to="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityEmergingGrowthCompany_f04b1140-ab91-4579-a965-106609a8df59_terseLabel_en-US" xlink:label="lab_dei_EntityEmergingGrowthCompany" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Small Business</link:label>
    <link:label id="lab_dei_EntityEmergingGrowthCompany_label_en-US" xlink:label="lab_dei_EntityEmergingGrowthCompany" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Emerging Growth Company</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityEmergingGrowthCompany" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityEmergingGrowthCompany"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityEmergingGrowthCompany" xlink:to="lab_dei_EntityEmergingGrowthCompany" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccruedIncomeTaxesNoncurrent_f78e4523-4319-4282-bc1c-8adeb4b95522_terseLabel_en-US" xlink:label="lab_us-gaap_AccruedIncomeTaxesNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Non-current accrued income taxes</link:label>
    <link:label id="lab_us-gaap_AccruedIncomeTaxesNoncurrent_label_en-US" xlink:label="lab_us-gaap_AccruedIncomeTaxesNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Income Taxes, Noncurrent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesNoncurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedIncomeTaxesNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccruedIncomeTaxesNoncurrent" xlink:to="lab_us-gaap_AccruedIncomeTaxesNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestrictedStockMember_8e097720-87c4-4efc-a733-01ed859acd72_terseLabel_en-US" xlink:label="lab_us-gaap_RestrictedStockMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restricted Stock [Member]</link:label>
    <link:label id="lab_us-gaap_RestrictedStockMember_label_en-US" xlink:label="lab_us-gaap_RestrictedStockMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restricted Stock [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestrictedStockMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestrictedStockMember" xlink:to="lab_us-gaap_RestrictedStockMember" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_AuditorName_714e6b40-e730-45cf-8bd5-2646c3825492_terseLabel_en-US" xlink:label="lab_dei_AuditorName" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Auditor Name</link:label>
    <link:label id="lab_dei_AuditorName_label_en-US" xlink:label="lab_dei_AuditorName" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Auditor Name</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_AuditorName" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_AuditorName"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_AuditorName" xlink:to="lab_dei_AuditorName" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_CoverAbstract_67e90474-8848-4ee4-9332-97fd0e313a81_terseLabel_en-US" xlink:label="lab_dei_CoverAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cover [Abstract]</link:label>
    <link:label id="lab_dei_CoverAbstract_label_en-US" xlink:label="lab_dei_CoverAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cover [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_CoverAbstract" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_CoverAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_CoverAbstract" xlink:to="lab_dei_CoverAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RevenuesFromExternalCustomersAndLongLivedAssetsLineItems_471fe3cc-3f6f-42ce-8296-e7851de5212b_terseLabel_en-US" xlink:label="lab_us-gaap_RevenuesFromExternalCustomersAndLongLivedAssetsLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenues from External Customers and Long-Lived Assets [Line Items]</link:label>
    <link:label id="lab_us-gaap_RevenuesFromExternalCustomersAndLongLivedAssetsLineItems_label_en-US" xlink:label="lab_us-gaap_RevenuesFromExternalCustomersAndLongLivedAssetsLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Revenues from External Customers and Long-Lived Assets [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenuesFromExternalCustomersAndLongLivedAssetsLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RevenuesFromExternalCustomersAndLongLivedAssetsLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RevenuesFromExternalCustomersAndLongLivedAssetsLineItems" xlink:to="lab_us-gaap_RevenuesFromExternalCustomersAndLongLivedAssetsLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CashAndCashEquivalentsPolicyTextBlock_3c6cae6d-b5a6-4141-93f8-e9ba875ea047_terseLabel_en-US" xlink:label="lab_us-gaap_CashAndCashEquivalentsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash, Cash Equivalents, and Investments</link:label>
    <link:label id="lab_us-gaap_CashAndCashEquivalentsPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_CashAndCashEquivalentsPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash and Cash Equivalents, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashAndCashEquivalentsPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CashAndCashEquivalentsPolicyTextBlock" xlink:to="lab_us-gaap_CashAndCashEquivalentsPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfUnrealizedLossOnInvestmentsTableTextBlock_87880dd2-9ce5-4230-afa8-95081d3af063_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfUnrealizedLossOnInvestmentsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross Unrealized Losses and Fair Value for Available-for-Sale Investments</link:label>
    <link:label id="lab_us-gaap_ScheduleOfUnrealizedLossOnInvestmentsTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfUnrealizedLossOnInvestmentsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Unrealized Loss on Investments [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfUnrealizedLossOnInvestmentsTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfUnrealizedLossOnInvestmentsTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfUnrealizedLossOnInvestmentsTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfUnrealizedLossOnInvestmentsTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_1c800273-dca3-459f-85f8-41cfae700526_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, Undiscounted Excess Amount</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, Undiscounted Excess Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_Cash_6603ebb1-d4fc-4a9f-8efb-c95488a0ab4b_terseLabel_en-US" xlink:label="lab_us-gaap_Cash" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash</link:label>
    <link:label id="lab_us-gaap_Cash_label_en-US" xlink:label="lab_us-gaap_Cash" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Cash" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Cash"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_Cash" xlink:to="lab_us-gaap_Cash" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax_6eeeb2eb-aa3c-44de-b542-0e7f75271b89_terseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax effect of unrealized gain (loss) on available-for-sale investments</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax_f727393c-f4ed-4028-9d1b-94fe49111ab9_verboseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax effect of unrealized gain on available-for-sale investments</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">OCI, Debt Securities, Available-for-Sale, Unrealized Holding Gain (Loss), before Adjustment, Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax" xlink:to="lab_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FinancialInstrumentAxis_82cc5359-b398-4f28-8261-bb6175492559_terseLabel_en-US" xlink:label="lab_us-gaap_FinancialInstrumentAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Financial Instrument [Axis]</link:label>
    <link:label id="lab_us-gaap_FinancialInstrumentAxis_label_en-US" xlink:label="lab_us-gaap_FinancialInstrumentAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Financial Instrument [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FinancialInstrumentAxis" xlink:to="lab_us-gaap_FinancialInstrumentAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsOfDividends_d141d668-549b-4870-9dad-2bdbff673c06_terseLabel_en-US" xlink:label="lab_us-gaap_PaymentsOfDividends" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments of dividends</link:label>
    <link:label id="lab_us-gaap_PaymentsOfDividends_label_en-US" xlink:label="lab_us-gaap_PaymentsOfDividends" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments of Dividends</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDividends" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsOfDividends"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsOfDividends" xlink:to="lab_us-gaap_PaymentsOfDividends" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_b1356dee-f8e8-4da5-918c-547e74f82948_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Available-for-sale Securities [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Available-for-sale Securities [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable" xlink:to="lab_us-gaap_ScheduleOfAvailableForSaleSecuritiesTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccruedVacationCurrent_1024f3fb-46d1-4cbb-bf7f-8f046fe234e2_terseLabel_en-US" xlink:label="lab_us-gaap_AccruedVacationCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Vacation</link:label>
    <link:label id="lab_us-gaap_AccruedVacationCurrent_label_en-US" xlink:label="lab_us-gaap_AccruedVacationCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Vacation, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedVacationCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedVacationCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccruedVacationCurrent" xlink:to="lab_us-gaap_AccruedVacationCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract_9dd67969-9951-4ca9-8016-46a3af9c0172_terseLabel_en-US" xlink:label="lab_us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current:</link:label>
    <link:label id="lab_us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract_label_en-US" xlink:label="lab_us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current Income Tax Expense (Benefit), Continuing Operations [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="lab_us-gaap_CurrentIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CustomerContractsAndRelationshipsMember_191a8b09-558b-42c1-b20d-27c948220676_verboseLabel_en-US" xlink:label="lab_cgnx_CustomerContractsAndRelationshipsMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer Relationships [Member]</link:label>
    <link:label id="lab_cgnx_CustomerContractsAndRelationshipsMember_7c4f425d-e25b-4253-aae3-f10e0f01aa82_terseLabel_en-US" xlink:label="lab_cgnx_CustomerContractsAndRelationshipsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer Contracts And Relationships [Member]</link:label>
    <link:label id="lab_cgnx_CustomerContractsAndRelationshipsMember_label_en-US" xlink:label="lab_cgnx_CustomerContractsAndRelationshipsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer Contracts And Relationships [Member]</link:label>
    <link:label id="lab_cgnx_CustomerContractsAndRelationshipsMember_documentation_en-US" xlink:label="lab_cgnx_CustomerContractsAndRelationshipsMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer Contracts And Relationships [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CustomerContractsAndRelationshipsMember" xlink:href="cgnx-20211231.xsd#cgnx_CustomerContractsAndRelationshipsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CustomerContractsAndRelationshipsMember" xlink:to="lab_cgnx_CustomerContractsAndRelationshipsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsForRestructuring_916ea18c-13e7-418d-b264-c139481b14a2_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_PaymentsForRestructuring" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash payments</link:label>
    <link:label id="lab_us-gaap_PaymentsForRestructuring_label_en-US" xlink:label="lab_us-gaap_PaymentsForRestructuring" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments for Restructuring</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRestructuring" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsForRestructuring"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsForRestructuring" xlink:to="lab_us-gaap_PaymentsForRestructuring" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommonStockMember_2815d077-f057-4528-a012-1df2af634966_terseLabel_en-US" xlink:label="lab_us-gaap_CommonStockMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock [Member]</link:label>
    <link:label id="lab_us-gaap_CommonStockMember_label_en-US" xlink:label="lab_us-gaap_CommonStockMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommonStockMember" xlink:to="lab_us-gaap_CommonStockMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign_3cbe4508-cac5-4935-b14f-2aaf9a9fa88a_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign income from continuing operations before taxes</link:label>
    <link:label id="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign_label_en-US" xlink:label="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income (Loss) from Continuing Operations before Income Taxes, Foreign</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign" xlink:to="lab_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesForeign" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BuildingImprovementsMember_242700cd-a39b-4521-aaa9-04c0d4ca364f_terseLabel_en-US" xlink:label="lab_us-gaap_BuildingImprovementsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Building Improvements [Member]</link:label>
    <link:label id="lab_us-gaap_BuildingImprovementsMember_label_en-US" xlink:label="lab_us-gaap_BuildingImprovementsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Building Improvements [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BuildingImprovementsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BuildingImprovementsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BuildingImprovementsMember" xlink:to="lab_us-gaap_BuildingImprovementsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingIncomeLoss_db6f1f62-7fdf-4d28-bfe4-40c6d382ba95_totalLabel_en-US" xlink:label="lab_us-gaap_OperatingIncomeLoss" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating income</link:label>
    <link:label id="lab_us-gaap_OperatingIncomeLoss_label_en-US" xlink:label="lab_us-gaap_OperatingIncomeLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Income (Loss)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingIncomeLoss" xlink:to="lab_us-gaap_OperatingIncomeLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeaseLiabilityCurrent_ece908f2-feb6-4e09-800c-cb5622bc59aa_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeaseLiabilityCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating lease liabilities</link:label>
    <link:label id="lab_us-gaap_OperatingLeaseLiabilityCurrent_label_en-US" xlink:label="lab_us-gaap_OperatingLeaseLiabilityCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Operating Lease, Liability, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiabilityCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiabilityCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeaseLiabilityCurrent" xlink:to="lab_us-gaap_OperatingLeaseLiabilityCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_b82f7781-c3b0-422a-95b1-ef19633c0187_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross Unrealized Losses</link:label>
    <link:label id="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_label_en-US" xlink:label="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Accumulated Gross Unrealized Loss, before Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax" xlink:to="lab_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_d98108b5-be91-4d5c-96ed-3293170aabeb_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2023</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Asset, Expected Amortization, Year Two</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_HedgingDesignationAxis_a010eb92-2206-4b4b-9b33-8feda3440305_terseLabel_en-US" xlink:label="lab_us-gaap_HedgingDesignationAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Hedging Designation [Axis]</link:label>
    <link:label id="lab_us-gaap_HedgingDesignationAxis_label_en-US" xlink:label="lab_us-gaap_HedgingDesignationAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Hedging Designation [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_HedgingDesignationAxis" xlink:to="lab_us-gaap_HedgingDesignationAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ChangeInAccountingEstimateTypeDomain_be1ebdd8-4e63-40d4-90dc-13b0580ea406_terseLabel_en-US" xlink:label="lab_us-gaap_ChangeInAccountingEstimateTypeDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in Accounting Estimate, Type [Domain]</link:label>
    <link:label id="lab_us-gaap_ChangeInAccountingEstimateTypeDomain_label_en-US" xlink:label="lab_us-gaap_ChangeInAccountingEstimateTypeDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in Accounting Estimate, Type [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ChangeInAccountingEstimateTypeDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ChangeInAccountingEstimateTypeDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ChangeInAccountingEstimateTypeDomain" xlink:to="lab_us-gaap_ChangeInAccountingEstimateTypeDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax_958fd16c-9043-46c2-bde6-496869a0aaf6_terseLabel_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated other comprehensive loss consists of foreign currency translation adjustments, net of tax</link:label>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax_label_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Other Comprehensive Income (Loss), Foreign Currency Translation Adjustment, Net of Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax" xlink:to="lab_us-gaap_AccumulatedOtherComprehensiveIncomeLossForeignCurrencyTranslationAdjustmentNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensation_9898a749-ff9d-4a84-b5ed-b6c6e02c2cc7_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensation" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock-based compensation expense and the related income tax benefit recognized, credits</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensation_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensation" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Noncash Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensation"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensation" xlink:to="lab_us-gaap_ShareBasedCompensation" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringAndRelatedActivitiesDisclosureTextBlock_f8a5a560-523d-42e3-9ad8-293babec06b4_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringAndRelatedActivitiesDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Charges</link:label>
    <link:label id="lab_us-gaap_RestructuringAndRelatedActivitiesDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_RestructuringAndRelatedActivitiesDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring and Related Activities Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedActivitiesDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringAndRelatedActivitiesDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringAndRelatedActivitiesDisclosureTextBlock" xlink:to="lab_us-gaap_RestructuringAndRelatedActivitiesDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CashAndCashEquivalentsAtCarryingValue_4dadc371-60f0-42d5-8ee5-a2911d723651_terseLabel_en-US" xlink:label="lab_us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash and cash equivalents</link:label>
    <link:label id="lab_us-gaap_CashAndCashEquivalentsAtCarryingValue_487d8171-1f95-4d13-8135-32b4cf8a48a4_totalLabel_en-US" xlink:label="lab_us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash and cash equivalents</link:label>
    <link:label id="lab_us-gaap_CashAndCashEquivalentsAtCarryingValue_label_en-US" xlink:label="lab_us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash and Cash Equivalents, at Carrying Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:to="lab_us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_Depreciation_ee725df0-ef25-48b6-b12a-e7b2f4b20923_terseLabel_en-US" xlink:label="lab_us-gaap_Depreciation" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Depreciation of property, plant, and equipment</link:label>
    <link:label id="lab_us-gaap_Depreciation_label_en-US" xlink:label="lab_us-gaap_Depreciation" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Depreciation</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Depreciation" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Depreciation"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_Depreciation" xlink:to="lab_us-gaap_Depreciation" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_UnrecognizedTaxBenefitsGross_f0e2857b-393b-4a49-92c2-b16ffe38ad52_terseLabel_en-US" xlink:label="lab_cgnx_UnrecognizedTaxBenefitsGross" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Gross</link:label>
    <link:label id="lab_cgnx_UnrecognizedTaxBenefitsGross_label_en-US" xlink:label="lab_cgnx_UnrecognizedTaxBenefitsGross" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Gross</link:label>
    <link:label id="lab_cgnx_UnrecognizedTaxBenefitsGross_documentation_en-US" xlink:label="lab_cgnx_UnrecognizedTaxBenefitsGross" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_UnrecognizedTaxBenefitsGross" xlink:href="cgnx-20211231.xsd#cgnx_UnrecognizedTaxBenefitsGross"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_UnrecognizedTaxBenefitsGross" xlink:to="lab_cgnx_UnrecognizedTaxBenefitsGross" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes_8fddd672-6360-4427-b415-11a66754524d_negatedLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in deferred income taxes</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Deferred Income Taxes</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInDeferredIncomeTaxes"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes" xlink:to="lab_us-gaap_IncreaseDecreaseInDeferredIncomeTaxes" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AdjustmentForLongTermIntercompanyTransactionsNetOfTax_7bbaee4e-0de6-4792-8fea-2cc8150bef91_terseLabel_en-US" xlink:label="lab_us-gaap_AdjustmentForLongTermIntercompanyTransactionsNetOfTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Losses on currency swaps, net of gains on long-term intercompany loans</link:label>
    <link:label id="lab_us-gaap_AdjustmentForLongTermIntercompanyTransactionsNetOfTax_label_en-US" xlink:label="lab_us-gaap_AdjustmentForLongTermIntercompanyTransactionsNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Adjustment for Long-term Intercompany Transactions, Net of Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentForLongTermIntercompanyTransactionsNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdjustmentForLongTermIntercompanyTransactionsNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AdjustmentForLongTermIntercompanyTransactionsNetOfTax" xlink:to="lab_us-gaap_AdjustmentForLongTermIntercompanyTransactionsNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock_0d1c9077-d001-48d3-957b-64c69108d7ea_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Changes in Warranty Obligations</link:label>
    <link:label id="lab_us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Product Warranty Liability [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfProductWarrantyLiabilityTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInAccruedLiabilities_9f6a5c9f-882c-4a8b-b65a-790eb8e4a004_terseLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInAccruedLiabilities" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued expenses</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInAccruedLiabilities_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInAccruedLiabilities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Accrued Liabilities</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedLiabilities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInAccruedLiabilities" xlink:to="lab_us-gaap_IncreaseDecreaseInAccruedLiabilities" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleChangeInPresentValueExpenseReversal_d86756e9-cd96-4aec-8960-18033bd278e1_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleChangeInPresentValueExpenseReversal" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increases to the allowance for credit losses</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleChangeInPresentValueExpenseReversal_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleChangeInPresentValueExpenseReversal" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Change in Present Value, Expense (Reversal)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleChangeInPresentValueExpenseReversal" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleChangeInPresentValueExpenseReversal"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleChangeInPresentValueExpenseReversal" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleChangeInPresentValueExpenseReversal" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProductWarrantyAccrualPayments_2199304c-13a5-42cc-8edb-eb8a57402180_negatedLabel_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrualPayments" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fulfillment of warranty obligations</link:label>
    <link:label id="lab_us-gaap_ProductWarrantyAccrualPayments_label_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrualPayments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Standard and Extended Product Warranty Accrual, Decrease for Payments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProductWarrantyAccrualPayments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProductWarrantyAccrualPayments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProductWarrantyAccrualPayments" xlink:to="lab_us-gaap_ProductWarrantyAccrualPayments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_b5e59781-7847-4170-a564-e95720b06600_negatedLabel_en-US" xlink:label="lab_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Purchases of property, plant, and equipment</link:label>
    <link:label id="lab_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_label_en-US" xlink:label="lab_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments to Acquire Property, Plant, and Equipment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:to="lab_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_Liabilities_4a507502-4f83-4abf-8d11-9d4729e7bd2b_totalLabel_en-US" xlink:label="lab_us-gaap_Liabilities" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total liabilities</link:label>
    <link:label id="lab_us-gaap_Liabilities_label_en-US" xlink:label="lab_us-gaap_Liabilities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liabilities</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Liabilities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_Liabilities" xlink:to="lab_us-gaap_Liabilities" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_dce9245c-6810-4655-9f66-2823d7fcce3d_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2022</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Asset, Expected Amortization, Year One</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageExercisePrice_da7187b7-416f-4f69-850d-6dcc492a7dd1_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Granted, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageExercisePrice_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageExercisePrice" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangements by Share-based Payment Award, Options, Grants in Period, Weighted Average Exercise Price</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageExercisePrice" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageExercisePrice"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageExercisePrice" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardOptionsGrantsInPeriodWeightedAverageExercisePrice" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue_ca60f1b9-dcb1-493f-9ae9-4d00e481b449_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Outstanding, aggregate intrinsic value</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding, Intrinsic Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingIntrinsicValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OperatingLeasesOfLessorDisclosureTextBlock_64be6f02-fb9d-4e3f-a345-b15bdafabb10_terseLabel_en-US" xlink:label="lab_us-gaap_OperatingLeasesOfLessorDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Leases</link:label>
    <link:label id="lab_us-gaap_OperatingLeasesOfLessorDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_OperatingLeasesOfLessorDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessor, Operating Leases [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeasesOfLessorDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeasesOfLessorDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OperatingLeasesOfLessorDisclosureTextBlock" xlink:to="lab_us-gaap_OperatingLeasesOfLessorDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember_f1555936-66d5-4989-9825-304e0f202751_terseLabel_en-US" xlink:label="lab_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Tax Expense - Transfer Price Adjustment [Member]</link:label>
    <link:label id="lab_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember_label_en-US" xlink:label="lab_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Tax Expense - Transfer Price Adjustment [Member]</link:label>
    <link:label id="lab_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember_documentation_en-US" xlink:label="lab_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Tax Expense - Transfer Price Adjustment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember" xlink:href="cgnx-20211231.xsd#cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember" xlink:to="lab_cgnx_ForeignTaxExpenseTransferPriceAdjustmentMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommonStockSharesIssued_ca2aec28-5c2a-4c39-86fe-3188dff3bfc6_terseLabel_en-US" xlink:label="lab_us-gaap_CommonStockSharesIssued" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common stock, shares issued</link:label>
    <link:label id="lab_us-gaap_CommonStockSharesIssued_aea6ad91-7c88-4934-920d-1ea7e82f6280_periodStartLabel_en-US" xlink:label="lab_us-gaap_CommonStockSharesIssued" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning Balance, shares</link:label>
    <link:label id="lab_us-gaap_CommonStockSharesIssued_a5b3c981-5d1c-43ca-b88a-316c08c7a2e5_periodEndLabel_en-US" xlink:label="lab_us-gaap_CommonStockSharesIssued" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance, shares</link:label>
    <link:label id="lab_us-gaap_CommonStockSharesIssued_label_en-US" xlink:label="lab_us-gaap_CommonStockSharesIssued" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock, Shares, Issued</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesIssued" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockSharesIssued"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommonStockSharesIssued" xlink:to="lab_us-gaap_CommonStockSharesIssued" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PreferredStockSharesIssued_84402ae6-fdfd-4ef7-ba91-d96d665df7f1_terseLabel_en-US" xlink:label="lab_us-gaap_PreferredStockSharesIssued" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred stock, shares issued</link:label>
    <link:label id="lab_us-gaap_PreferredStockSharesIssued_label_en-US" xlink:label="lab_us-gaap_PreferredStockSharesIssued" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred Stock, Shares Issued</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockSharesIssued" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockSharesIssued"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PreferredStockSharesIssued" xlink:to="lab_us-gaap_PreferredStockSharesIssued" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityAddressCityOrTown_7d4b831d-7732-4562-a760-5a8358befdf9_terseLabel_en-US" xlink:label="lab_dei_EntityAddressCityOrTown" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Address, City or Town</link:label>
    <link:label id="lab_dei_EntityAddressCityOrTown_label_en-US" xlink:label="lab_dei_EntityAddressCityOrTown" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Address, City or Town</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityAddressCityOrTown" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityAddressCityOrTown"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityAddressCityOrTown" xlink:to="lab_dei_EntityAddressCityOrTown" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_a98ecaa4-2bbe-4562-a6d1-0f71431c0e0d_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross realized gains</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Realized Loss</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BalanceSheetLocationAxis_ba5bf32e-f1d1-4524-80c3-a09f719978d8_terseLabel_en-US" xlink:label="lab_us-gaap_BalanceSheetLocationAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance Sheet Location [Axis]</link:label>
    <link:label id="lab_us-gaap_BalanceSheetLocationAxis_label_en-US" xlink:label="lab_us-gaap_BalanceSheetLocationAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance Sheet Location [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BalanceSheetLocationAxis" xlink:to="lab_us-gaap_BalanceSheetLocationAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccruedLiabilitiesMember_b6eab36b-711b-43ce-8567-10413a19ab7e_terseLabel_en-US" xlink:label="lab_us-gaap_AccruedLiabilitiesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Liabilities [Member]</link:label>
    <link:label id="lab_us-gaap_AccruedLiabilitiesMember_label_en-US" xlink:label="lab_us-gaap_AccruedLiabilitiesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Liabilities [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedLiabilitiesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccruedLiabilitiesMember" xlink:to="lab_us-gaap_AccruedLiabilitiesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueMeasurementFrequencyDomain_ffa25239-d3d9-411e-9def-5b0038b1495d_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueMeasurementFrequencyDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Measurement Frequency [Domain]</link:label>
    <link:label id="lab_us-gaap_FairValueMeasurementFrequencyDomain_label_en-US" xlink:label="lab_us-gaap_FairValueMeasurementFrequencyDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Measurement Frequency [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueMeasurementFrequencyDomain" xlink:to="lab_us-gaap_FairValueMeasurementFrequencyDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract_d7befc2e-873b-44cb-a811-43aead8f6d73_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred:</link:label>
    <link:label id="lab_us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract_label_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Income Tax Expense (Benefit), Continuing Operations [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:to="lab_us-gaap_DeferredIncomeTaxExpenseBenefitContinuingOperationsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentDisposals_ca599f8c-2d47-4865-ae63-e78b4785729b_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentDisposals" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Disposals in period</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentDisposals_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentDisposals" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment, Disposals</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentDisposals" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentDisposals"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentDisposals" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentDisposals" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RetainedEarningsAccumulatedDeficit_ea13b8ee-fe7e-4374-badf-b21ea3f97c1a_terseLabel_en-US" xlink:label="lab_us-gaap_RetainedEarningsAccumulatedDeficit" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retained earnings</link:label>
    <link:label id="lab_us-gaap_RetainedEarningsAccumulatedDeficit_1cf962dd-55d4-4b6f-b6df-b41a26becd3c_verboseLabel_en-US" xlink:label="lab_us-gaap_RetainedEarningsAccumulatedDeficit" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retained Earnings (Accumulated Deficit)</link:label>
    <link:label id="lab_us-gaap_RetainedEarningsAccumulatedDeficit_label_en-US" xlink:label="lab_us-gaap_RetainedEarningsAccumulatedDeficit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retained Earnings (Accumulated Deficit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RetainedEarningsAccumulatedDeficit" xlink:to="lab_us-gaap_RetainedEarningsAccumulatedDeficit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StatementOfStockholdersEquityAbstract_d69b8ebf-7876-4135-8440-a93afc707aeb_terseLabel_en-US" xlink:label="lab_us-gaap_StatementOfStockholdersEquityAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement of Stockholders' Equity [Abstract]</link:label>
    <link:label id="lab_us-gaap_StatementOfStockholdersEquityAbstract_label_en-US" xlink:label="lab_us-gaap_StatementOfStockholdersEquityAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement of Stockholders' Equity [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementOfStockholdersEquityAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementOfStockholdersEquityAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StatementOfStockholdersEquityAbstract" xlink:to="lab_us-gaap_StatementOfStockholdersEquityAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityFilerCategory_02920503-21c9-4222-8270-e34b2cd982b4_terseLabel_en-US" xlink:label="lab_dei_EntityFilerCategory" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Filer Category</link:label>
    <link:label id="lab_dei_EntityFilerCategory_label_en-US" xlink:label="lab_dei_EntityFilerCategory" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Filer Category</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityFilerCategory" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityFilerCategory"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityFilerCategory" xlink:to="lab_dei_EntityFilerCategory" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent_1122d65a-5189-4c25-80e4-14bc687d4b88_terseLabel_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete tax expense related to GILTI impact of change in tax structure</link:label>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent_label_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Cuts and Jobs Act, Global Intangible Low Tax Income, Percent</link:label>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent_documentation_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Cuts and Jobs Act, Global Intangible Low Tax Income, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent" xlink:href="cgnx-20211231.xsd#cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent" xlink:to="lab_cgnx_EffectiveIncomeTaxRateReconciliationTaxCutsandJobsActGlobalIntangibleLowTaxIncomePercent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_70b057f9-2547-4ea9-9e84-78dd9ede1cf8_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Risk-free rate</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Risk Free Interest Rate</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_StandardProductandServicesMember_c4a606df-adcb-4283-98d0-515e55021019_terseLabel_en-US" xlink:label="lab_cgnx_StandardProductandServicesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Standard products and services</link:label>
    <link:label id="lab_cgnx_StandardProductandServicesMember_label_en-US" xlink:label="lab_cgnx_StandardProductandServicesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Standard Product and Services [Member]</link:label>
    <link:label id="lab_cgnx_StandardProductandServicesMember_documentation_en-US" xlink:label="lab_cgnx_StandardProductandServicesMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Standard Product and Services [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_StandardProductandServicesMember" xlink:href="cgnx-20211231.xsd#cgnx_StandardProductandServicesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_StandardProductandServicesMember" xlink:to="lab_cgnx_StandardProductandServicesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfDerivativeInstrumentsGainLossInStatementOfFinancialPerformanceTextBlock_55d63fa6-c1f8-424f-8972-99bde4d4608c_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfDerivativeInstrumentsGainLossInStatementOfFinancialPerformanceTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments, Gain (Loss)</link:label>
    <link:label id="lab_us-gaap_ScheduleOfDerivativeInstrumentsGainLossInStatementOfFinancialPerformanceTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfDerivativeInstrumentsGainLossInStatementOfFinancialPerformanceTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Instruments, Gain (Loss) [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDerivativeInstrumentsGainLossInStatementOfFinancialPerformanceTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfDerivativeInstrumentsGainLossInStatementOfFinancialPerformanceTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfDerivativeInstrumentsGainLossInStatementOfFinancialPerformanceTextBlock" xlink:to="lab_us-gaap_ScheduleOfDerivativeInstrumentsGainLossInStatementOfFinancialPerformanceTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_USTreasurySecuritiesMember_0dc633b4-f6ac-4b9f-a4c5-7dcec27f65e6_terseLabel_en-US" xlink:label="lab_us-gaap_USTreasurySecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Treasury Bills [Member]</link:label>
    <link:label id="lab_us-gaap_USTreasurySecuritiesMember_label_en-US" xlink:label="lab_us-gaap_USTreasurySecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">US Treasury Securities [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_USTreasurySecuritiesMember" xlink:to="lab_us-gaap_USTreasurySecuritiesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ConcentrationRiskTable_5f921611-f2c0-47c3-ab9d-d5427ff504eb_terseLabel_en-US" xlink:label="lab_us-gaap_ConcentrationRiskTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk [Table]</link:label>
    <link:label id="lab_us-gaap_ConcentrationRiskTable_label_en-US" xlink:label="lab_us-gaap_ConcentrationRiskTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ConcentrationRiskTable" xlink:to="lab_us-gaap_ConcentrationRiskTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTable_8635f068-acf6-46e5-bba0-5dcedd8cf5c9_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Change in Accounting Estimate [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Change in Accounting Estimate [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfChangeInAccountingEstimateTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfChangeInAccountingEstimateTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfChangeInAccountingEstimateTable" xlink:to="lab_us-gaap_ScheduleOfChangeInAccountingEstimateTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InventoryDisclosureAbstract_e5393c12-dcaa-4196-9cd8-a0ca18614475_terseLabel_en-US" xlink:label="lab_us-gaap_InventoryDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory Disclosure [Abstract]</link:label>
    <link:label id="lab_us-gaap_InventoryDisclosureAbstract_label_en-US" xlink:label="lab_us-gaap_InventoryDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory Disclosure [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryDisclosureAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryDisclosureAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InventoryDisclosureAbstract" xlink:to="lab_us-gaap_InventoryDisclosureAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTextBlock_a387e94a-8485-463f-a8a8-1f6afea01ea9_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation</link:label>
    <link:label id="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTextBlock_label_en-US" xlink:label="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTextBlock" xlink:to="lab_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_NoncurrentDeferredTaxAssetsDeprecation_7497b91a-1019-4eb1-b2c1-96d929d5ad3f_terseLabel_en-US" xlink:label="lab_cgnx_NoncurrentDeferredTaxAssetsDeprecation" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Depreciation</link:label>
    <link:label id="lab_cgnx_NoncurrentDeferredTaxAssetsDeprecation_label_en-US" xlink:label="lab_cgnx_NoncurrentDeferredTaxAssetsDeprecation" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Noncurrent Deferred Tax Assets Deprecation</link:label>
    <link:label id="lab_cgnx_NoncurrentDeferredTaxAssetsDeprecation_documentation_en-US" xlink:label="lab_cgnx_NoncurrentDeferredTaxAssetsDeprecation" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Noncurrent deferred tax assets deprecation.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_NoncurrentDeferredTaxAssetsDeprecation" xlink:href="cgnx-20211231.xsd#cgnx_NoncurrentDeferredTaxAssetsDeprecation"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_NoncurrentDeferredTaxAssetsDeprecation" xlink:to="lab_cgnx_NoncurrentDeferredTaxAssetsDeprecation" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NewAccountingPronouncementsAndChangesInAccountingPrinciplesTextBlock_9f730e37-f3bf-43d3-9deb-864390f7f14c_terseLabel_en-US" xlink:label="lab_us-gaap_NewAccountingPronouncementsAndChangesInAccountingPrinciplesTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">New Pronouncements</link:label>
    <link:label id="lab_us-gaap_NewAccountingPronouncementsAndChangesInAccountingPrinciplesTextBlock_label_en-US" xlink:label="lab_us-gaap_NewAccountingPronouncementsAndChangesInAccountingPrinciplesTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounting Standards Update and Change in Accounting Principle [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NewAccountingPronouncementsAndChangesInAccountingPrinciplesTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NewAccountingPronouncementsAndChangesInAccountingPrinciplesTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NewAccountingPronouncementsAndChangesInAccountingPrinciplesTextBlock" xlink:to="lab_us-gaap_NewAccountingPronouncementsAndChangesInAccountingPrinciplesTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_4931b564-6514-496a-b0b1-39f13e427d59_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets by Major Class [Axis]</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets by Major Class [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_24ade2c0-5347-46f4-ba22-f5c96eef178c_terseLabel_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">3-4 Years</link:label>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_label_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available For Sale Securities Debt Maturities After Three Years Before Four Years Fair Value</link:label>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue_documentation_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available-for-sale securities, debt maturities after third year but before fourth year, fair value.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" xlink:href="cgnx-20211231.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" xlink:to="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterThreeYearsBeforeFourYearsFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_AmendmentFlag_c5e477de-7537-48d1-b734-b442e1d041c5_terseLabel_en-US" xlink:label="lab_dei_AmendmentFlag" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Amendment Flag</link:label>
    <link:label id="lab_dei_AmendmentFlag_label_en-US" xlink:label="lab_dei_AmendmentFlag" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Amendment Flag</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_AmendmentFlag" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_AmendmentFlag"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_AmendmentFlag" xlink:to="lab_dei_AmendmentFlag" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StatementEquityComponentsAxis_d3f6bf99-3d6d-4797-b01f-82c844f7c50e_terseLabel_en-US" xlink:label="lab_us-gaap_StatementEquityComponentsAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Equity Components [Axis]</link:label>
    <link:label id="lab_us-gaap_StatementEquityComponentsAxis_label_en-US" xlink:label="lab_us-gaap_StatementEquityComponentsAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Equity Components [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StatementEquityComponentsAxis" xlink:to="lab_us-gaap_StatementEquityComponentsAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_MovementInValuationAllowancesAndReservesRollForward_bb0f0cbb-0a2b-4f88-8045-876c358e3124_terseLabel_en-US" xlink:label="lab_us-gaap_MovementInValuationAllowancesAndReservesRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Movement in Valuation Allowances and Reserves [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_MovementInValuationAllowancesAndReservesRollForward_label_en-US" xlink:label="lab_us-gaap_MovementInValuationAllowancesAndReservesRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Movement in Valuation Allowances and Reserves [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MovementInValuationAllowancesAndReservesRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_MovementInValuationAllowancesAndReservesRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_MovementInValuationAllowancesAndReservesRollForward" xlink:to="lab_us-gaap_MovementInValuationAllowancesAndReservesRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueDisclosuresAbstract_85f0785c-c4bb-4983-b927-ca96e7709b8a_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueDisclosuresAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Disclosures [Abstract]</link:label>
    <link:label id="lab_us-gaap_FairValueDisclosuresAbstract_label_en-US" xlink:label="lab_us-gaap_FairValueDisclosuresAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Disclosures [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueDisclosuresAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueDisclosuresAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueDisclosuresAbstract" xlink:to="lab_us-gaap_FairValueDisclosuresAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_caae6946-c64e-4d4e-a896-59ecc49845d0_terseLabel_en-US" xlink:label="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Antidilutive Securities [Axis]</link:label>
    <link:label id="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_label_en-US" xlink:label="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Antidilutive Securities [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:to="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ConcentrationRiskTypeDomain_3483f1c7-9c7a-4647-b4bb-d0a2578dfe0d_terseLabel_en-US" xlink:label="lab_us-gaap_ConcentrationRiskTypeDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk Type [Domain]</link:label>
    <link:label id="lab_us-gaap_ConcentrationRiskTypeDomain_label_en-US" xlink:label="lab_us-gaap_ConcentrationRiskTypeDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk Type [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskTypeDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ConcentrationRiskTypeDomain" xlink:to="lab_us-gaap_ConcentrationRiskTypeDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset_072c7248-697d-4c65-bc93-b1dbdf630d12_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Asset gross amount offset</link:label>
    <link:label id="lab_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset_label_en-US" xlink:label="lab_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Asset, Collateral, Obligation to Return Cash, Offset</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset" xlink:to="lab_us-gaap_DerivativeAssetCollateralObligationToReturnCashOffset" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DisaggregationOfRevenueTable_5e6bfcbf-48e7-419f-b015-9327f096e889_terseLabel_en-US" xlink:label="lab_us-gaap_DisaggregationOfRevenueTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Disaggregation of Revenue [Table]</link:label>
    <link:label id="lab_us-gaap_DisaggregationOfRevenueTable_label_en-US" xlink:label="lab_us-gaap_DisaggregationOfRevenueTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Disaggregation of Revenue [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DisaggregationOfRevenueTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DisaggregationOfRevenueTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DisaggregationOfRevenueTable" xlink:to="lab_us-gaap_DisaggregationOfRevenueTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InventoryNet_de6bddb2-d23c-4723-9f67-4dddb0e1f0a9_terseLabel_en-US" xlink:label="lab_us-gaap_InventoryNet" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventories</link:label>
    <link:label id="lab_us-gaap_InventoryNet_be77f710-d290-46c2-a6ae-d37ccd61df9c_totalLabel_en-US" xlink:label="lab_us-gaap_InventoryNet" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventories</link:label>
    <link:label id="lab_us-gaap_InventoryNet_label_en-US" xlink:label="lab_us-gaap_InventoryNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InventoryNet" xlink:to="lab_us-gaap_InventoryNet" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves_64b80b4b-4e61-4b95-86d7-c8a2ffc5ff34_terseLabel_en-US" xlink:label="lab_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum decrease in income tax expense due to release in reserves</link:label>
    <link:label id="lab_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves_label_en-US" xlink:label="lab_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum Decrease In Income Tax Expense Due To Release In Reserves</link:label>
    <link:label id="lab_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves_documentation_en-US" xlink:label="lab_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Maximum decrease in income tax expense due to release in reserves.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:href="cgnx-20211231.xsd#cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:to="lab_cgnx_MaximumDecreaseInIncomeTaxExpenseDueToReleaseInReserves" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriod_49382a3d-f63d-48cd-bf19-a7199b03f624_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriod" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Granted</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriod_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriod" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Grants in Period, Net of Forfeitures</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriod" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriod"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriod" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsGrantsInPeriod" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredFederalIncomeTaxExpenseBenefit_36c8264f-9f72-4176-87a1-3a0495d53e57_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Federal</link:label>
    <link:label id="lab_us-gaap_DeferredFederalIncomeTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Federal Income Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredFederalIncomeTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:to="lab_us-gaap_DeferredFederalIncomeTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_b7fcfb6d-202d-4367-a775-42a06628648f_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]</link:label>
    <link:label id="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_label_en-US" xlink:label="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems" xlink:to="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StateAdministrationOfTaxationChinaMember_b6e23851-07bf-41ac-bd13-125a255b767e_terseLabel_en-US" xlink:label="lab_us-gaap_StateAdministrationOfTaxationChinaMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">State Administration of Taxation, China [Member]</link:label>
    <link:label id="lab_us-gaap_StateAdministrationOfTaxationChinaMember_label_en-US" xlink:label="lab_us-gaap_StateAdministrationOfTaxationChinaMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">State Administration of Taxation, China [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StateAdministrationOfTaxationChinaMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StateAdministrationOfTaxationChinaMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StateAdministrationOfTaxationChinaMember" xlink:to="lab_us-gaap_StateAdministrationOfTaxationChinaMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_a9c081a6-171c-4794-ba63-4f7b13dced47_terseLabel_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Thereafter</link:label>
    <link:label id="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_label_en-US" xlink:label="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Lessee, Operating Lease, Liability, to be Paid, after Year Five</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:to="lab_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_MXN_7309110c-85bd-4ab6-8bab-c389629a9552_terseLabel_en-US" xlink:label="lab_currency_MXN" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Mexican Peso [Member]</link:label>
    <link:label id="lab_currency_MXN_label_en-US" xlink:label="lab_currency_MXN" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Mexico, Pesos</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_MXN" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_MXN"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_MXN" xlink:to="lab_currency_MXN" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossCurrent_3c7708de-5250-44c7-80c2-435dfa934839_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss, Current</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossCurrent_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossCurrent" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_ProductOrServiceAxis_db94c11b-6e6c-42ef-b650-4b82f7b70a64_terseLabel_en-US" xlink:label="lab_srt_ProductOrServiceAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product and Service [Axis]</link:label>
    <link:label id="lab_srt_ProductOrServiceAxis_label_en-US" xlink:label="lab_srt_ProductOrServiceAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product and Service [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ProductOrServiceAxis" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_ProductOrServiceAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_ProductOrServiceAxis" xlink:to="lab_srt_ProductOrServiceAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableRollforward_53fcc945-9fe2-4a3e-baf1-103099f84fa3_terseLabel_en-US" xlink:label="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableRollforward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable, Allowance for Credit Loss [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableRollforward_label_en-US" xlink:label="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableRollforward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable, Allowance for Credit Loss [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllowanceForDoubtfulAccountsReceivableRollforward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AllowanceForDoubtfulAccountsReceivableRollforward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AllowanceForDoubtfulAccountsReceivableRollforward" xlink:to="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableRollforward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PreferredStockParOrStatedValuePerShare_18a58dff-34e5-479f-b7bd-b3b7559628e8_verboseLabel_en-US" xlink:label="lab_us-gaap_PreferredStockParOrStatedValuePerShare" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred stock par value, in dollars per share</link:label>
    <link:label id="lab_us-gaap_PreferredStockParOrStatedValuePerShare_d4a0bda3-e63b-47f4-8d8a-0c2773f2ea43_terseLabel_en-US" xlink:label="lab_us-gaap_PreferredStockParOrStatedValuePerShare" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred stock par value (in dollars per share)</link:label>
    <link:label id="lab_us-gaap_PreferredStockParOrStatedValuePerShare_label_en-US" xlink:label="lab_us-gaap_PreferredStockParOrStatedValuePerShare" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Preferred Stock, Par or Stated Value Per Share</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PreferredStockParOrStatedValuePerShare" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PreferredStockParOrStatedValuePerShare"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PreferredStockParOrStatedValuePerShare" xlink:to="lab_us-gaap_PreferredStockParOrStatedValuePerShare" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityPublicFloat_a42d689d-ae9b-4dd6-8aae-3d035e373446_terseLabel_en-US" xlink:label="lab_dei_EntityPublicFloat" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Public Float</link:label>
    <link:label id="lab_dei_EntityPublicFloat_label_en-US" xlink:label="lab_dei_EntityPublicFloat" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Public Float</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityPublicFloat" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityPublicFloat"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityPublicFloat" xlink:to="lab_dei_EntityPublicFloat" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsNetNoncurrentClassificationAbstract_5243b3d3-8ee9-4e9a-bd70-7e1b35512720_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsNetNoncurrentClassificationAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross deferred tax assets:</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsNetNoncurrentClassificationAbstract_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsNetNoncurrentClassificationAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Net of Valuation Allowance, Noncurrent Classification [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsNetNoncurrentClassificationAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsNetNoncurrentClassificationAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsNetNoncurrentClassificationAbstract" xlink:to="lab_us-gaap_DeferredTaxAssetsNetNoncurrentClassificationAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets_ae84d322-80fc-4582-8e19-b3e6c085f72a_terseLabel_en-US" xlink:label="lab_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized tax benefit shown as a reduction to noncurrent deferred tax assets</link:label>
    <link:label id="lab_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets_label_en-US" xlink:label="lab_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized tax benefit shown as a reduction to noncurrent deferred tax assets</link:label>
    <link:label id="lab_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets_documentation_en-US" xlink:label="lab_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized tax benefit shown as a reduction to noncurrent deferred tax assets as a result of net operating loss carryforward, a similar tax loss, or a tax credit carryforward.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets" xlink:href="cgnx-20211231.xsd#cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets" xlink:to="lab_cgnx_Unrecognizedtaxbenefitshownasareductiontononcurrentdeferredtaxassets" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockRepurchasedDuringPeriodShares_04afbccc-c660-4d25-9ae4-32c99311aa69_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_StockRepurchasedDuringPeriodShares" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase of common stock, shares</link:label>
    <link:label id="lab_us-gaap_StockRepurchasedDuringPeriodShares_a8cece4f-7afd-4614-9efd-ca6e96335f59_verboseLabel_en-US" xlink:label="lab_us-gaap_StockRepurchasedDuringPeriodShares" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase of common stock, shares</link:label>
    <link:label id="lab_us-gaap_StockRepurchasedDuringPeriodShares_label_en-US" xlink:label="lab_us-gaap_StockRepurchasedDuringPeriodShares" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock Repurchased During Period, Shares</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodShares" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockRepurchasedDuringPeriodShares"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockRepurchasedDuringPeriodShares" xlink:to="lab_us-gaap_StockRepurchasedDuringPeriodShares" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_5a5b3b78-859f-4e7e-983c-2ba039bdfc1c_terseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign currency translation adjustments</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_ac5e9cc3-ff4e-486d-b3ef-538af01f4c35_verboseLabel_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign currency translation adjustments, net of tax</link:label>
    <link:label id="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax_label_en-US" xlink:label="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Comprehensive Income (Loss), Foreign Currency Transaction and Translation Adjustment, Net of Tax</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax" xlink:to="lab_us-gaap_OtherComprehensiveIncomeLossForeignCurrencyTransactionAndTranslationAdjustmentNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StatementLineItems_5856c94b-3bc5-4e1d-91d1-246f5df82079_terseLabel_en-US" xlink:label="lab_us-gaap_StatementLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement [Line Items]</link:label>
    <link:label id="lab_us-gaap_StatementLineItems_label_en-US" xlink:label="lab_us-gaap_StatementLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StatementLineItems" xlink:to="lab_us-gaap_StatementLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesDomain_7e2ff686-a3c3-4679-9fd2-4cf99556fb58_terseLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves [Domain]</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesDomain_label_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ValuationAllowancesAndReservesDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesDomain" xlink:to="lab_us-gaap_ValuationAllowancesAndReservesDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInContractWithCustomerLiability_017afaeb-b15b-4e4b-a5f2-4d3ab9d47485_terseLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInContractWithCustomerLiability" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred revenue and customer deposits</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInContractWithCustomerLiability_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInContractWithCustomerLiability" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Contract with Customer, Liability</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInContractWithCustomerLiability" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInContractWithCustomerLiability"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInContractWithCustomerLiability" xlink:to="lab_us-gaap_IncreaseDecreaseInContractWithCustomerLiability" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign_4b0492c6-9c4c-4f5d-bb4a-e794d7786cb2_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Settlement, Foreign, Percent</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Tax Settlement, Foreign, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationTaxSettlementsForeign" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePriceRollforward_4f246093-7f63-4628-b43d-4551e56c8f1c_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePriceRollforward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding, Weighted Average Exercise Price [Abstract]</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePriceRollforward_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePriceRollforward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding, Weighted Average Exercise Price [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePriceRollforward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePriceRollforward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePriceRollforward" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePriceRollforward" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DomesticCountryMember_382eee92-55d8-4ef3-ba9f-7b44b245137d_terseLabel_en-US" xlink:label="lab_us-gaap_DomesticCountryMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Domestic Tax Authority [Member]</link:label>
    <link:label id="lab_us-gaap_DomesticCountryMember_label_en-US" xlink:label="lab_us-gaap_DomesticCountryMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Domestic Tax Authority [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DomesticCountryMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DomesticCountryMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DomesticCountryMember" xlink:to="lab_us-gaap_DomesticCountryMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProductLiabilityContingencyTable_4d70de03-13bb-478e-96fd-e470021d28b5_terseLabel_en-US" xlink:label="lab_us-gaap_ProductLiabilityContingencyTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product Liability Contingency [Table]</link:label>
    <link:label id="lab_us-gaap_ProductLiabilityContingencyTable_label_en-US" xlink:label="lab_us-gaap_ProductLiabilityContingencyTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product Liability Contingency [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProductLiabilityContingencyTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProductLiabilityContingencyTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProductLiabilityContingencyTable" xlink:to="lab_us-gaap_ProductLiabilityContingencyTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InternalUseSoftwarePolicy_f3b6ad81-81cd-448d-bb68-7a6558c3545c_terseLabel_en-US" xlink:label="lab_us-gaap_InternalUseSoftwarePolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Internal Use Software, Policy</link:label>
    <link:label id="lab_us-gaap_InternalUseSoftwarePolicy_label_en-US" xlink:label="lab_us-gaap_InternalUseSoftwarePolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Internal Use Software, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InternalUseSoftwarePolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InternalUseSoftwarePolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InternalUseSoftwarePolicy" xlink:to="lab_us-gaap_InternalUseSoftwarePolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f88133cb-f655-4b74-867f-9f2d0b7e0a01_terseLabel_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Total</link:label>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f242a3e7-6505-4ee1-b6a8-effddd0661cd_totalLabel_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Total</link:label>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtSecurities_label_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:to="lab_us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh_ca986faf-b294-42ba-93f1-695885304405_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Contingent consideration, high range</link:label>
    <link:label id="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh_label_en-US" xlink:label="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Combination, Contingent Consideration Arrangements, Range of Outcomes, Value, High</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh" xlink:to="lab_us-gaap_BusinessCombinationContingentConsiderationArrangementsRangeOfOutcomesValueHigh" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CostsAssociatedWithExitOrDisposalActivitiesOrRestructuringsPolicy_3c5b7b95-638a-4165-b592-aa5d67945174_terseLabel_en-US" xlink:label="lab_us-gaap_CostsAssociatedWithExitOrDisposalActivitiesOrRestructuringsPolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Costs Associated with Exit or Disposal Activity or Restructuring</link:label>
    <link:label id="lab_us-gaap_CostsAssociatedWithExitOrDisposalActivitiesOrRestructuringsPolicy_label_en-US" xlink:label="lab_us-gaap_CostsAssociatedWithExitOrDisposalActivitiesOrRestructuringsPolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Costs Associated with Exit or Disposal Activity or Restructuring [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAssociatedWithExitOrDisposalActivitiesOrRestructuringsPolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostsAssociatedWithExitOrDisposalActivitiesOrRestructuringsPolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CostsAssociatedWithExitOrDisposalActivitiesOrRestructuringsPolicy" xlink:to="lab_us-gaap_CostsAssociatedWithExitOrDisposalActivitiesOrRestructuringsPolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccruedLiabilitiesCurrentAbstract_69b6c1b6-9c3c-4810-8fee-0e91f1c49aba_terseLabel_en-US" xlink:label="lab_us-gaap_AccruedLiabilitiesCurrentAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Constituents of accrued expenses</link:label>
    <link:label id="lab_us-gaap_AccruedLiabilitiesCurrentAbstract_label_en-US" xlink:label="lab_us-gaap_AccruedLiabilitiesCurrentAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Liabilities, Current [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrentAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedLiabilitiesCurrentAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccruedLiabilitiesCurrentAbstract" xlink:to="lab_us-gaap_AccruedLiabilitiesCurrentAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentByTypeAxis_e11cd391-153d-4af3-aad2-a51854812fb4_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment, Type [Axis]</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentByTypeAxis_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long-Lived Tangible Asset [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredTaxAssetsValuationAllowance_aa78b6b6-1501-47fb-9f9f-600935e062f3_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsValuationAllowance" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred tax assets, valuation allowance</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsValuationAllowance_5bfc732d-f8c4-4cc1-9d0c-a00f6b9becdc_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsValuationAllowance" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Valuation allowance</link:label>
    <link:label id="lab_us-gaap_DeferredTaxAssetsValuationAllowance_label_en-US" xlink:label="lab_us-gaap_DeferredTaxAssetsValuationAllowance" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Valuation Allowance</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsValuationAllowance"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredTaxAssetsValuationAllowance" xlink:to="lab_us-gaap_DeferredTaxAssetsValuationAllowance" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_GreaterChinaMember_c0cb42c0-f8af-4ec0-a11e-b03b6d644259_terseLabel_en-US" xlink:label="lab_cgnx_GreaterChinaMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Greater China [Member]</link:label>
    <link:label id="lab_cgnx_GreaterChinaMember_8d650b10-9cb4-417f-b5a8-a49b598dc75d_verboseLabel_en-US" xlink:label="lab_cgnx_GreaterChinaMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Greater China [Member]</link:label>
    <link:label id="lab_cgnx_GreaterChinaMember_label_en-US" xlink:label="lab_cgnx_GreaterChinaMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Greater China [Member]</link:label>
    <link:label id="lab_cgnx_GreaterChinaMember_documentation_en-US" xlink:label="lab_cgnx_GreaterChinaMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Greater China [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_GreaterChinaMember" xlink:href="cgnx-20211231.xsd#cgnx_GreaterChinaMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_GreaterChinaMember" xlink:to="lab_cgnx_GreaterChinaMember" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_MajorCustomersAxis_b0983718-e848-487e-ac18-cdd9b1907c10_terseLabel_en-US" xlink:label="lab_srt_MajorCustomersAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer [Axis]</link:label>
    <link:label id="lab_srt_MajorCustomersAxis_label_en-US" xlink:label="lab_srt_MajorCustomersAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MajorCustomersAxis" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_MajorCustomersAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_MajorCustomersAxis" xlink:to="lab_srt_MajorCustomersAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfThreeYears_9453b6b6-deaf-4048-bea6-28046d4ecc12_terseLabel_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfThreeYears" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company contributions vest at end of three years</link:label>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfThreeYears_label_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfThreeYears" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company Contributions Vest At End Of Three Years</link:label>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfThreeYears_documentation_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfThreeYears" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company contributions vest at end of three years.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompanyContributionsVestAtEndOfThreeYears" xlink:href="cgnx-20211231.xsd#cgnx_CompanyContributionsVestAtEndOfThreeYears"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CompanyContributionsVestAtEndOfThreeYears" xlink:to="lab_cgnx_CompanyContributionsVestAtEndOfThreeYears" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringCostAndReserveLineItems_254b0b56-5d65-49d9-999e-43653a3c606d_terseLabel_en-US" xlink:label="lab_us-gaap_RestructuringCostAndReserveLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Cost and Reserve [Line Items]</link:label>
    <link:label id="lab_us-gaap_RestructuringCostAndReserveLineItems_label_en-US" xlink:label="lab_us-gaap_RestructuringCostAndReserveLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring Cost and Reserve [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems" xlink:to="lab_us-gaap_RestructuringCostAndReserveLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PensionAndOtherPostretirementBenefitsDisclosureTextBlock_9ffa1308-2b85-415f-9c19-d36c1f189e86_terseLabel_en-US" xlink:label="lab_us-gaap_PensionAndOtherPostretirementBenefitsDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Employee Savings Plan</link:label>
    <link:label id="lab_us-gaap_PensionAndOtherPostretirementBenefitsDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_PensionAndOtherPostretirementBenefitsDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Retirement Benefits [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PensionAndOtherPostretirementBenefitsDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PensionAndOtherPostretirementBenefitsDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PensionAndOtherPostretirementBenefitsDisclosureTextBlock" xlink:to="lab_us-gaap_PensionAndOtherPostretirementBenefitsDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_31f66ccf-81ff-45c2-8a18-77a5da7b532a_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Business Acquisitions, by Acquisition [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Business Acquisitions, by Acquisition [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:to="lab_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_DocumentAnnualReport_df573190-175b-4a36-8003-8550e2fbc415_terseLabel_en-US" xlink:label="lab_dei_DocumentAnnualReport" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Annual Report</link:label>
    <link:label id="lab_dei_DocumentAnnualReport_label_en-US" xlink:label="lab_dei_DocumentAnnualReport" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Document Annual Report</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_DocumentAnnualReport" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_DocumentAnnualReport"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_DocumentAnnualReport" xlink:to="lab_dei_DocumentAnnualReport" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTextBlock_a79dbee6-201f-4961-af48-e2553c007ca4_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock-Based Compensation Expense</link:label>
    <link:label id="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Expensed and Capitalized, Amount [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTextBlock" xlink:to="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_MoneyMarketFundsAtCarryingValue_7d2a4f39-5292-4499-bdc7-85279a6b1b50_terseLabel_en-US" xlink:label="lab_us-gaap_MoneyMarketFundsAtCarryingValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Money market instruments</link:label>
    <link:label id="lab_us-gaap_MoneyMarketFundsAtCarryingValue_label_en-US" xlink:label="lab_us-gaap_MoneyMarketFundsAtCarryingValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Money Market Funds, at Carrying Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MoneyMarketFundsAtCarryingValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_MoneyMarketFundsAtCarryingValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_MoneyMarketFundsAtCarryingValue" xlink:to="lab_us-gaap_MoneyMarketFundsAtCarryingValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent_9475f5e3-0fab-460e-85ee-fce9b708ab42_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other discrete tax events</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation,Other Reconciling Items, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationOtherReconcilingItemsPercent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_Assets_53929f9c-bdd7-419a-87ca-03f843e34b8e_totalLabel_en-US" xlink:label="lab_us-gaap_Assets" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total assets</link:label>
    <link:label id="lab_us-gaap_Assets_label_en-US" xlink:label="lab_us-gaap_Assets" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Assets</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Assets"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_Assets" xlink:to="lab_us-gaap_Assets" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRollForward_eb207ddf-e255-45a4-b731-ed12a686d288_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRollForward" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss [Roll Forward]</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRollForward_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRollForward" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss [Roll Forward]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRollForward" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRollForward"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRollForward" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossRollForward" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan_6943d3ca-ae7e-4983-9cdf-082efca78b74_terseLabel_en-US" xlink:label="lab_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Minimum age to be eligible to defined contribution plan</link:label>
    <link:label id="lab_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan_label_en-US" xlink:label="lab_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Minimum Age To Be Eligible To Defined Contribution Plan</link:label>
    <link:label id="lab_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan_documentation_en-US" xlink:label="lab_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Minimum age to be eligible to defined contribution plan.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan" xlink:href="cgnx-20211231.xsd#cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan" xlink:to="lab_cgnx_MinimumAgeToBeEligibleToDefinedContributionPlan" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates_618ad7fe-8622-4aa0-b2e4-e7290e34de51_terseLabel_en-US" xlink:label="lab_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase in compensation expense due to revised estimated forfeiture rates</link:label>
    <link:label id="lab_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates_label_en-US" xlink:label="lab_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) In Compensation Expense Due To Revised Estimated Forfeiture Rates</link:label>
    <link:label id="lab_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates_documentation_en-US" xlink:label="lab_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (decrease) in compensation expense due to revised estimated forfeiture rates.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" xlink:href="cgnx-20211231.xsd#cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" xlink:to="lab_cgnx_IncreaseDecreaseInCompensationExpenseDueToRevisedEstimatedForfeitureRates" xlink:type="arc" order="1"/>
    <link:label id="lab_srt_SegmentGeographicalDomain_8e77fe39-1756-4e26-8471-ea47f0e64a99_terseLabel_en-US" xlink:label="lab_srt_SegmentGeographicalDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Geographical [Domain]</link:label>
    <link:label id="lab_srt_SegmentGeographicalDomain_label_en-US" xlink:label="lab_srt_SegmentGeographicalDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Geographical [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain" xlink:href="https://xbrl.fasb.org/srt/2021/elts/srt-2021-01-31.xsd#srt_SegmentGeographicalDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_srt_SegmentGeographicalDomain" xlink:to="lab_srt_SegmentGeographicalDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ResearchAndDevelopmentExpense_d1a103e9-8176-4d9e-ab88-a514702de5eb_terseLabel_en-US" xlink:label="lab_us-gaap_ResearchAndDevelopmentExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Research, development, and engineering expenses</link:label>
    <link:label id="lab_us-gaap_ResearchAndDevelopmentExpense_label_en-US" xlink:label="lab_us-gaap_ResearchAndDevelopmentExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Research and Development Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ResearchAndDevelopmentExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ResearchAndDevelopmentExpense" xlink:to="lab_us-gaap_ResearchAndDevelopmentExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfFourYears_eb86605d-61ab-4fa9-ad25-1f8a13816343_totalLabel_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfFourYears" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company contributions vest at end of four years</link:label>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfFourYears_label_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfFourYears" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company Contributions Vest At End Of Four Years</link:label>
    <link:label id="lab_cgnx_CompanyContributionsVestAtEndOfFourYears_documentation_en-US" xlink:label="lab_cgnx_CompanyContributionsVestAtEndOfFourYears" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Company contributions vest at end of four years.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CompanyContributionsVestAtEndOfFourYears" xlink:href="cgnx-20211231.xsd#cgnx_CompanyContributionsVestAtEndOfFourYears"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CompanyContributionsVestAtEndOfFourYears" xlink:to="lab_cgnx_CompanyContributionsVestAtEndOfFourYears" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SignificantAccountingPoliciesTextBlock_56b9841c-9d75-4617-80d7-7b5f09ea45b3_terseLabel_en-US" xlink:label="lab_us-gaap_SignificantAccountingPoliciesTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Summary of Significant Accounting Policies</link:label>
    <link:label id="lab_us-gaap_SignificantAccountingPoliciesTextBlock_label_en-US" xlink:label="lab_us-gaap_SignificantAccountingPoliciesTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Significant Accounting Policies [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SignificantAccountingPoliciesTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SignificantAccountingPoliciesTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SignificantAccountingPoliciesTextBlock" xlink:to="lab_us-gaap_SignificantAccountingPoliciesTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_AllCurrenciesDomain_4f337b41-75d7-4bd2-bc26-8181cb158ede_terseLabel_en-US" xlink:label="lab_currency_AllCurrenciesDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">All Currencies [Domain]</link:label>
    <link:label id="lab_currency_AllCurrenciesDomain_label_en-US" xlink:label="lab_currency_AllCurrenciesDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">All Currencies [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_AllCurrenciesDomain" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_AllCurrenciesDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_AllCurrenciesDomain" xlink:to="lab_currency_AllCurrenciesDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInOperatingActivities_b8d30d29-344f-4dcc-9a5d-120cfaaa73f4_totalLabel_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net cash provided by operating activities</link:label>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInOperatingActivities_e581c0dd-5f51-40f1-a375-07f459e34d02_terseLabel_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net cash provided by operating activities</link:label>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInOperatingActivities_label_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Cash Provided by (Used in) Operating Activities</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:to="lab_us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_Customer1Member_99d246d4-32de-4eeb-9fd2-7600aad57d48_terseLabel_en-US" xlink:label="lab_cgnx_Customer1Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer 1 [Member]</link:label>
    <link:label id="lab_cgnx_Customer1Member_label_en-US" xlink:label="lab_cgnx_Customer1Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer 1 [Member]</link:label>
    <link:label id="lab_cgnx_Customer1Member_documentation_en-US" xlink:label="lab_cgnx_Customer1Member" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Customer 1</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_Customer1Member" xlink:href="cgnx-20211231.xsd#cgnx_Customer1Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_Customer1Member" xlink:to="lab_cgnx_Customer1Member" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_84f39c65-1b66-44fe-bf5d-cd4922c85373_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Measurements, Recurring and Nonrecurring [Table]</link:label>
    <link:label id="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_label_en-US" xlink:label="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Recurring and Nonrecurring [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable" xlink:to="lab_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FurnitureAndFixturesMember_7d4eb111-d54f-4a7e-8bca-106ac9685cc4_terseLabel_en-US" xlink:label="lab_us-gaap_FurnitureAndFixturesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Furniture and Fixtures [Member]</link:label>
    <link:label id="lab_us-gaap_FurnitureAndFixturesMember_label_en-US" xlink:label="lab_us-gaap_FurnitureAndFixturesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Furniture and Fixtures [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FurnitureAndFixturesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FurnitureAndFixturesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FurnitureAndFixturesMember" xlink:to="lab_us-gaap_FurnitureAndFixturesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SubsequentEventLineItems_7a309d6b-2669-47ee-b347-7a6f16e5308f_terseLabel_en-US" xlink:label="lab_us-gaap_SubsequentEventLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event [Line Items]</link:label>
    <link:label id="lab_us-gaap_SubsequentEventLineItems_label_en-US" xlink:label="lab_us-gaap_SubsequentEventLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Subsequent Event [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SubsequentEventLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SubsequentEventLineItems" xlink:to="lab_us-gaap_SubsequentEventLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EarningsPerShareBasicAbstract_bea8c73f-59c4-4e6c-9281-0f721e1a6575_terseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerShareBasicAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Income per weighted-average common and common-equivalent share:</link:label>
    <link:label id="lab_us-gaap_EarningsPerShareBasicAbstract_label_en-US" xlink:label="lab_us-gaap_EarningsPerShareBasicAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Earnings Per Share, Basic [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareBasicAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EarningsPerShareBasicAbstract" xlink:to="lab_us-gaap_EarningsPerShareBasicAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_TaxCreditCarryforwardAxis_e0e542a2-3c40-40f5-9684-fa4ac21d635b_terseLabel_en-US" xlink:label="lab_us-gaap_TaxCreditCarryforwardAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax Credit Carryforward [Axis]</link:label>
    <link:label id="lab_us-gaap_TaxCreditCarryforwardAxis_label_en-US" xlink:label="lab_us-gaap_TaxCreditCarryforwardAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Tax Credit Carryforward [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TaxCreditCarryforwardAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TaxCreditCarryforwardAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_TaxCreditCarryforwardAxis" xlink:to="lab_us-gaap_TaxCreditCarryforwardAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_3d7b4751-4fee-4908-b495-f2889e619095_terseLabel_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Basic (in shares)</link:label>
    <link:label id="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_271bce7f-d453-4f92-8fad-6b20065e462b_verboseLabel_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Basic weighted-average common shares outstanding</link:label>
    <link:label id="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_label_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted Average Number of Shares Outstanding, Basic</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:to="lab_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EarningsPerShareDiluted_f7d5ba84-bfa9-43f1-9c55-a034b4223bba_terseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerShareDiluted" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net income (in dollars per share)</link:label>
    <link:label id="lab_us-gaap_EarningsPerShareDiluted_8a0d1bbc-c2a1-44f2-a56c-3e5751c969ca_verboseLabel_en-US" xlink:label="lab_us-gaap_EarningsPerShareDiluted" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Diluted net income (loss) per share (in dollars per share)</link:label>
    <link:label id="lab_us-gaap_EarningsPerShareDiluted_label_en-US" xlink:label="lab_us-gaap_EarningsPerShareDiluted" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Earnings Per Share, Diluted</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EarningsPerShareDiluted" xlink:to="lab_us-gaap_EarningsPerShareDiluted" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_8f648083-ba40-4e98-8996-ba859af488ca_terseLabel_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effect of dilutive stock options</link:label>
    <link:label id="lab_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_label_en-US" xlink:label="lab_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Weighted Average Number Diluted Shares Outstanding Adjustment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment" xlink:to="lab_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncomeTaxesPaidNet_5537d7aa-0c35-4ef8-aea4-018df83d3a43_terseLabel_en-US" xlink:label="lab_us-gaap_IncomeTaxesPaidNet" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income tax paid net</link:label>
    <link:label id="lab_us-gaap_IncomeTaxesPaidNet_label_en-US" xlink:label="lab_us-gaap_IncomeTaxesPaidNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Income Taxes Paid, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxesPaidNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxesPaidNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncomeTaxesPaidNet" xlink:to="lab_us-gaap_IncomeTaxesPaidNet" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IntangibleAssetsFiniteLivedPolicy_cde171e3-b239-45f4-b0a4-97d0394ee007_terseLabel_en-US" xlink:label="lab_us-gaap_IntangibleAssetsFiniteLivedPolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible Assets</link:label>
    <link:label id="lab_us-gaap_IntangibleAssetsFiniteLivedPolicy_label_en-US" xlink:label="lab_us-gaap_IntangibleAssetsFiniteLivedPolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible Assets, Finite-Lived, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsFiniteLivedPolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsFiniteLivedPolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IntangibleAssetsFiniteLivedPolicy" xlink:to="lab_us-gaap_IntangibleAssetsFiniteLivedPolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossTableTextBlock_d2a70e30-f360-41d5-b9da-db9da84f04ad_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossTableTextBlock_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossTableTextBlock" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_8a3416ec-b072-4da7-a95f-b024a90421f2_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Restructuring and Related Costs [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Restructuring and Related Costs [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable" xlink:to="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IntangibleAssetsNetExcludingGoodwill_c292f292-b0ec-44ea-82a6-0fd47fb4d03d_terseLabel_en-US" xlink:label="lab_us-gaap_IntangibleAssetsNetExcludingGoodwill" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible Assets, Net (Excluding Goodwill)</link:label>
    <link:label id="lab_us-gaap_IntangibleAssetsNetExcludingGoodwill_label_en-US" xlink:label="lab_us-gaap_IntangibleAssetsNetExcludingGoodwill" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible Assets, Net (Excluding Goodwill)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsNetExcludingGoodwill"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IntangibleAssetsNetExcludingGoodwill" xlink:to="lab_us-gaap_IntangibleAssetsNetExcludingGoodwill" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ComprehensiveIncomeNetOfTax_8a546bf3-11cd-43a6-b619-77786ebfd089_totalLabel_en-US" xlink:label="lab_us-gaap_ComprehensiveIncomeNetOfTax" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total comprehensive income</link:label>
    <link:label id="lab_us-gaap_ComprehensiveIncomeNetOfTax_label_en-US" xlink:label="lab_us-gaap_ComprehensiveIncomeNetOfTax" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Comprehensive Income (Loss), Net of Tax, Attributable to Parent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax" xlink:to="lab_us-gaap_ComprehensiveIncomeNetOfTax" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue_88b0f4d7-5bcd-48ad-89d3-3ca55cea2c04_terseLabel_en-US" xlink:label="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Total fair values of stock options vested</link:label>
    <link:label id="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue_label_en-US" xlink:label="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share Based Compensation Arrangement By Share Based Payment Award Options Vested Fair Value</link:label>
    <link:label id="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue_documentation_en-US" xlink:label="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share based compensation arrangement by share based payment award options vested fair value.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" xlink:href="cgnx-20211231.xsd#cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" xlink:to="lab_cgnx_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProductLiabilityContingencyLineItems_28d2ec02-d372-4cad-a8c5-a0bd79f32cff_terseLabel_en-US" xlink:label="lab_us-gaap_ProductLiabilityContingencyLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product Liability Contingency [Line Items]</link:label>
    <link:label id="lab_us-gaap_ProductLiabilityContingencyLineItems_label_en-US" xlink:label="lab_us-gaap_ProductLiabilityContingencyLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product Liability Contingency [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProductLiabilityContingencyLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProductLiabilityContingencyLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProductLiabilityContingencyLineItems" xlink:to="lab_us-gaap_ProductLiabilityContingencyLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DeferredIncomeTaxLiabilitiesNet_5c4d9a0a-65b7-46d6-b0d2-94dde51864bc_terseLabel_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred income taxes</link:label>
    <link:label id="lab_us-gaap_DeferredIncomeTaxLiabilitiesNet_label_en-US" xlink:label="lab_us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Income Tax Liabilities, Net</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:to="lab_us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_BusinessAcquisitionAcquireeDomain_b1af0349-9d9b-4ee1-bd24-0ae3aec25a7e_terseLabel_en-US" xlink:label="lab_us-gaap_BusinessAcquisitionAcquireeDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Acquisition, Acquiree [Domain]</link:label>
    <link:label id="lab_us-gaap_BusinessAcquisitionAcquireeDomain_label_en-US" xlink:label="lab_us-gaap_BusinessAcquisitionAcquireeDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Business Acquisition, Acquiree [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain" xlink:to="lab_us-gaap_BusinessAcquisitionAcquireeDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock_ce227f4d-6785-41d2-a009-d0402c41726f_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Reconciliation of the United States Federal Statutory Corporate Tax Rate to the Company's Effective Tax Rate or Income Tax Provision</link:label>
    <link:label id="lab_us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Effective Income Tax Rate Reconciliation [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfEffectiveIncomeTaxRateReconciliationTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccountsPayableCurrent_4a906d28-7543-4391-b9e1-1e8cc4fc5fea_terseLabel_en-US" xlink:label="lab_us-gaap_AccountsPayableCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts payable</link:label>
    <link:label id="lab_us-gaap_AccountsPayableCurrent_label_en-US" xlink:label="lab_us-gaap_AccountsPayableCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Payable, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccountsPayableCurrent" xlink:to="lab_us-gaap_AccountsPayableCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DeferredTaxAssetsForeignTaxStructureChange_949f442f-b42a-471a-9082-57bfbe2ff25e_terseLabel_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsForeignTaxStructureChange" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign tax structure deferred tax asset</link:label>
    <link:label id="lab_cgnx_DeferredTaxAssetsForeignTaxStructureChange_label_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsForeignTaxStructureChange" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Foreign Tax Structure Change</link:label>
    <link:label id="lab_cgnx_DeferredTaxAssetsForeignTaxStructureChange_documentation_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsForeignTaxStructureChange" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, Foreign Tax Structure Change</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxAssetsForeignTaxStructureChange" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxAssetsForeignTaxStructureChange"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DeferredTaxAssetsForeignTaxStructureChange" xlink:to="lab_cgnx_DeferredTaxAssetsForeignTaxStructureChange" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate_e8c88f67-e2c8-4eb4-8fb4-12a96396ee73_terseLabel_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete tax benefit related to change in tax structure</link:label>
    <link:label id="lab_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate_label_en-US" xlink:label="lab_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Change in Enacted Tax Rate, Percent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate" xlink:to="lab_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CorporateBondsFairValueDisclosure_1d089139-a947-425d-b357-698e15092e4a_terseLabel_en-US" xlink:label="lab_cgnx_CorporateBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Corporate bonds</link:label>
    <link:label id="lab_cgnx_CorporateBondsFairValueDisclosure_label_en-US" xlink:label="lab_cgnx_CorporateBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Corporate Bonds Fair Value Disclosure</link:label>
    <link:label id="lab_cgnx_CorporateBondsFairValueDisclosure_documentation_en-US" xlink:label="lab_cgnx_CorporateBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Corporate bonds fair value disclosure.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CorporateBondsFairValueDisclosure" xlink:href="cgnx-20211231.xsd#cgnx_CorporateBondsFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CorporateBondsFairValueDisclosure" xlink:to="lab_cgnx_CorporateBondsFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfFairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTableTextBlock_0b9ca8c0-d86d-4d7f-a39a-d32b28d4b58d_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfFairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Assets and Liabilities Measured at Fair Value on a Recurring Basis</link:label>
    <link:label id="lab_us-gaap_ScheduleOfFairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfFairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Fair Value, Assets and Liabilities Measured on Recurring Basis [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfFairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfFairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfFairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_CNY_31fcd683-7c79-474b-8eaa-119b5b3aaf6d_terseLabel_en-US" xlink:label="lab_currency_CNY" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">China, Yuan Renminbi</link:label>
    <link:label id="lab_currency_CNY_label_en-US" xlink:label="lab_currency_CNY" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">China, Yuan Renminbi</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_CNY" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_CNY"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_CNY" xlink:to="lab_currency_CNY" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeMember_3e3054f8-e60a-4fd6-a100-24f4dc367644_terseLabel_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accumulated Other Comprehensive Loss [Member]</link:label>
    <link:label id="lab_us-gaap_AccumulatedOtherComprehensiveIncomeMember_label_en-US" xlink:label="lab_us-gaap_AccumulatedOtherComprehensiveIncomeMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">AOCI Attributable to Parent [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember" xlink:to="lab_us-gaap_AccumulatedOtherComprehensiveIncomeMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IncreaseDecreaseInInventories_ee863e1a-73b9-4012-86ab-0fb163c8383e_negatedLabel_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInInventories" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventories</link:label>
    <link:label id="lab_us-gaap_IncreaseDecreaseInInventories_label_en-US" xlink:label="lab_us-gaap_IncreaseDecreaseInInventories" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Increase (Decrease) in Inventories</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInInventories" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInInventories"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IncreaseDecreaseInInventories" xlink:to="lab_us-gaap_IncreaseDecreaseInInventories" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_IndemnificationProvisionsTextBlock_faff0828-f19b-4aa1-88ab-d4e1e9709521_terseLabel_en-US" xlink:label="lab_cgnx_IndemnificationProvisionsTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Indemnification Provisions</link:label>
    <link:label id="lab_cgnx_IndemnificationProvisionsTextBlock_label_en-US" xlink:label="lab_cgnx_IndemnificationProvisionsTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Indemnification Provisions [Text Block]</link:label>
    <link:label id="lab_cgnx_IndemnificationProvisionsTextBlock_documentation_en-US" xlink:label="lab_cgnx_IndemnificationProvisionsTextBlock" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Indemnification provisions are a potential liability whereby the Company indemnifies certain directors, officers, and employees (current or former) against expenses incurred by them in relation to specific legal proceedings. The company also indemnifies other parties for specific situations.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_IndemnificationProvisionsTextBlock" xlink:href="cgnx-20211231.xsd#cgnx_IndemnificationProvisionsTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_IndemnificationProvisionsTextBlock" xlink:to="lab_cgnx_IndemnificationProvisionsTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_CurrencytranslationadjustmentAbstract_ef65c55d-fc57-4b82-9934-af454bb5baba_terseLabel_en-US" xlink:label="lab_cgnx_CurrencytranslationadjustmentAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign currency translation adjustments:</link:label>
    <link:label id="lab_cgnx_CurrencytranslationadjustmentAbstract_label_en-US" xlink:label="lab_cgnx_CurrencytranslationadjustmentAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Currency translation adjustment [Abstract]</link:label>
    <link:label id="lab_cgnx_CurrencytranslationadjustmentAbstract_documentation_en-US" xlink:label="lab_cgnx_CurrencytranslationadjustmentAbstract" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Currency translation adjustment [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_CurrencytranslationadjustmentAbstract" xlink:href="cgnx-20211231.xsd#cgnx_CurrencytranslationadjustmentAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_CurrencytranslationadjustmentAbstract" xlink:to="lab_cgnx_CurrencytranslationadjustmentAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTextBlock_a8602183-5e4f-4173-815e-00e1512a0283_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring and Related Costs</link:label>
    <link:label id="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring and Related Costs [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTextBlock" xlink:to="lab_us-gaap_ScheduleOfRestructuringAndRelatedCostsTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommonStockSharesOutstanding_feb4825c-7852-48f2-b5f8-8e62da3893c0_terseLabel_en-US" xlink:label="lab_us-gaap_CommonStockSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common stock, shares outstanding</link:label>
    <link:label id="lab_us-gaap_CommonStockSharesOutstanding_label_en-US" xlink:label="lab_us-gaap_CommonStockSharesOutstanding" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock, Shares, Outstanding</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesOutstanding" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockSharesOutstanding"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommonStockSharesOutstanding" xlink:to="lab_us-gaap_CommonStockSharesOutstanding" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_RepurchaseProgramOctober2018Member_88c676ee-9b88-4007-9e91-f81d2c6cd616_terseLabel_en-US" xlink:label="lab_cgnx_RepurchaseProgramOctober2018Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase Program October 2018 [Member]</link:label>
    <link:label id="lab_cgnx_RepurchaseProgramOctober2018Member_label_en-US" xlink:label="lab_cgnx_RepurchaseProgramOctober2018Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase Program October 2018 [Member]</link:label>
    <link:label id="lab_cgnx_RepurchaseProgramOctober2018Member_documentation_en-US" xlink:label="lab_cgnx_RepurchaseProgramOctober2018Member" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Repurchase Program October 2018 [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_RepurchaseProgramOctober2018Member" xlink:href="cgnx-20211231.xsd#cgnx_RepurchaseProgramOctober2018Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_RepurchaseProgramOctober2018Member" xlink:to="lab_cgnx_RepurchaseProgramOctober2018Member" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LongTermInvestments_c68cdbcf-ed50-474a-b05b-e081d873003f_terseLabel_en-US" xlink:label="lab_us-gaap_LongTermInvestments" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Non-current investments, amortized cost of $587,981 and $390,417 in 2021 and 2020, respectively, allowance for credit losses of $0 in 2021 and 2020</link:label>
    <link:label id="lab_us-gaap_LongTermInvestments_ca122336-1a32-449f-8fa4-6e583da4da07_totalLabel_en-US" xlink:label="lab_us-gaap_LongTermInvestments" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Non-current investments</link:label>
    <link:label id="lab_us-gaap_LongTermInvestments_label_en-US" xlink:label="lab_us-gaap_LongTermInvestments" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long-term Investments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermInvestments" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermInvestments"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LongTermInvestments" xlink:to="lab_us-gaap_LongTermInvestments" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_0b99dc3d-2023-4ac6-9596-9fc39bc842a1_terseLabel_en-US" xlink:label="lab_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Financial Instruments [Domain]</link:label>
    <link:label id="lab_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_label_en-US" xlink:label="lab_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Financial Instruments [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:to="lab_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProductWarrantyAccrual_1affd1fa-dc60-423e-a9fb-9bce6df58a45_periodStartLabel_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrual" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning Balance</link:label>
    <link:label id="lab_us-gaap_ProductWarrantyAccrual_2a55bbdc-1c6e-4685-99c0-e61870707d9d_periodEndLabel_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrual" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Ending Balance</link:label>
    <link:label id="lab_us-gaap_ProductWarrantyAccrual_label_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrual" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Standard and Extended Product Warranty Accrual</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProductWarrantyAccrual" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProductWarrantyAccrual"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProductWarrantyAccrual" xlink:to="lab_us-gaap_ProductWarrantyAccrual" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostCurrent_9d947373-1e89-4ac8-8589-10119a456be1_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Amortized Cost</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostCurrent_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Amortized Cost, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostCurrent" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CostOfGoodsAndServicesSold_523e1922-1213-414c-a9df-7ca87b44d5e1_terseLabel_en-US" xlink:label="lab_us-gaap_CostOfGoodsAndServicesSold" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cost of revenue</link:label>
    <link:label id="lab_us-gaap_CostOfGoodsAndServicesSold_label_en-US" xlink:label="lab_us-gaap_CostOfGoodsAndServicesSold" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cost of Goods and Services Sold</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostOfGoodsAndServicesSold" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostOfGoodsAndServicesSold"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CostOfGoodsAndServicesSold" xlink:to="lab_us-gaap_CostOfGoodsAndServicesSold" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_RestructuringAndRelatedActivitiesAbstract_label_en-US" xlink:label="lab_us-gaap_RestructuringAndRelatedActivitiesAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Restructuring and Related Activities [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringAndRelatedActivitiesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RestructuringAndRelatedActivitiesAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_RestructuringAndRelatedActivitiesAbstract" xlink:to="lab_us-gaap_RestructuringAndRelatedActivitiesAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ProductWarrantyAccrualClassifiedCurrent_9e11c8a1-8d48-483b-b5e0-50d80020a314_terseLabel_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrualClassifiedCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Warranty obligations</link:label>
    <link:label id="lab_us-gaap_ProductWarrantyAccrualClassifiedCurrent_label_en-US" xlink:label="lab_us-gaap_ProductWarrantyAccrualClassifiedCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product Warranty Accrual, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProductWarrantyAccrualClassifiedCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProductWarrantyAccrualClassifiedCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ProductWarrantyAccrualClassifiedCurrent" xlink:to="lab_us-gaap_ProductWarrantyAccrualClassifiedCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember_b09a037b-fb05-4aba-b2ec-a369f9f4209c_terseLabel_en-US" xlink:label="lab_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in accounting policy</link:label>
    <link:label id="lab_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember_label_en-US" xlink:label="lab_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in Global Intangible Low-Taxed Income [Member]</link:label>
    <link:label id="lab_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember_documentation_en-US" xlink:label="lab_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Change in Global Intangible Low-Taxed Income [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember" xlink:href="cgnx-20211231.xsd#cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember" xlink:to="lab_cgnx_ChangeinGlobalIntangibleLowTaxedIncomeMember" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_EntityCentralIndexKey_aca743ad-2686-41c4-b949-b482a9b40c6e_terseLabel_en-US" xlink:label="lab_dei_EntityCentralIndexKey" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Central Index Key</link:label>
    <link:label id="lab_dei_EntityCentralIndexKey_label_en-US" xlink:label="lab_dei_EntityCentralIndexKey" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Entity Central Index Key</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityCentralIndexKey" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_EntityCentralIndexKey"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_EntityCentralIndexKey" xlink:to="lab_dei_EntityCentralIndexKey" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_215897b0-bf78-4bf2-981e-b70e308ef446_terseLabel_en-US" xlink:label="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]</link:label>
    <link:label id="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_label_en-US" xlink:label="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:to="lab_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions_3c8ecf32-ee16-4132-b4d0-83fb57ac09cb_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Decrease Resulting from Prior Period Tax Positions</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions_label_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Decrease Resulting from Prior Period Tax Positions</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions" xlink:to="lab_us-gaap_UnrecognizedTaxBenefitsDecreasesResultingFromPriorPeriodTaxPositions" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock_7fda0130-cd50-4b55-acfd-a2f7ba66da88_terseLabel_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant, and Equipment</link:label>
    <link:label id="lab_us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Property, Plant and Equipment Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" xlink:to="lab_us-gaap_PropertyPlantAndEquipmentDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_550f66df-3947-4381-a58e-75d4adbf3dfc_totalLabel_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross deferred tax assets</link:label>
    <link:label id="lab_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_label_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, With Jurisdictional Netting, Gross</link:label>
    <link:label id="lab_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross_documentation_en-US" xlink:label="lab_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Deferred Tax Assets, With Jurisdictional Netting, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross" xlink:href="cgnx-20211231.xsd#cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross" xlink:to="lab_cgnx_DeferredTaxAssetsWithJurisdictionalNettingGross" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_OtherLiabilitiesNoncurrent_888fe8ca-ace9-4846-b40e-558d5f3a9bf8_terseLabel_en-US" xlink:label="lab_us-gaap_OtherLiabilitiesNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other liabilities</link:label>
    <link:label id="lab_us-gaap_OtherLiabilitiesNoncurrent_label_en-US" xlink:label="lab_us-gaap_OtherLiabilitiesNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Other Liabilities, Noncurrent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilitiesNoncurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherLiabilitiesNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_OtherLiabilitiesNoncurrent" xlink:to="lab_us-gaap_OtherLiabilitiesNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_ca47331d-2c78-400d-a93b-c2fa105e8d65_terseLabel_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">4-5 Years</link:label>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_label_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available For Sale Securities Debt Maturities After Four Years Before Five Years Fair Value</link:label>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue_documentation_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available-for-sale securities, debt maturities after fourth year but before fifth year, fair value.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" xlink:href="cgnx-20211231.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" xlink:to="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterFourYearsBeforeFiveYearsFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable_e46a2ad5-87d7-4f9a-85f9-fcb404fae2ec_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Employee Service Share-based Compensation, Allocation of Recognized Period Costs [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Expensed and Capitalized, Amount [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable" xlink:to="lab_us-gaap_ScheduleOfEmployeeServiceShareBasedCompensationAllocationOfRecognizedPeriodCostsTable" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_TradingSymbol_0ec4d5a3-f6c7-47d0-9e8d-6d7fc8bc9468_terseLabel_en-US" xlink:label="lab_dei_TradingSymbol" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Trading Symbol</link:label>
    <link:label id="lab_dei_TradingSymbol_label_en-US" xlink:label="lab_dei_TradingSymbol" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Trading Symbol</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_TradingSymbol" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_TradingSymbol"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_TradingSymbol" xlink:to="lab_dei_TradingSymbol" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeAssets_66478381-a499-48f2-9312-686517f7cd87_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeAssets" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net amount of assets presented</link:label>
    <link:label id="lab_us-gaap_DerivativeAssets_a1827f45-e2d1-457b-bcf9-b9eac97927f8_totalLabel_en-US" xlink:label="lab_us-gaap_DerivativeAssets" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net amount of assets presented</link:label>
    <link:label id="lab_us-gaap_DerivativeAssets_label_en-US" xlink:label="lab_us-gaap_DerivativeAssets" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Asset</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeAssets"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeAssets" xlink:to="lab_us-gaap_DerivativeAssets" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock_8c5cb6ba-6486-4550-8ef4-d40c0cba3138_terseLabel_en-US" xlink:label="lab_us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Expenses</link:label>
    <link:label id="lab_us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Payable and Accrued Liabilities Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock" xlink:to="lab_us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_fe6449b4-ccca-47d8-976c-a321b6f4e6c2_negatedTotalLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss" xlink:role="http://www.xbrl.org/2009/role/negatedTotalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrealized Losses</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Unrealized Loss Position, Accumulated Loss</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_EquipmentMember_f1629120-b516-46fd-87c0-72be477d2049_verboseLabel_en-US" xlink:label="lab_us-gaap_EquipmentMember" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Manufacturing Test Equipment [Member]</link:label>
    <link:label id="lab_us-gaap_EquipmentMember_label_en-US" xlink:label="lab_us-gaap_EquipmentMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Equipment [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquipmentMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EquipmentMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_EquipmentMember" xlink:to="lab_us-gaap_EquipmentMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember_a4bd23aa-afbe-4211-b87c-95590857fffa_terseLabel_en-US" xlink:label="lab_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Expense - Foreign Tax Filing Adjustments [Member]</link:label>
    <link:label id="lab_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember_label_en-US" xlink:label="lab_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Expense - Foreign Tax Filing Adjustments [Member]</link:label>
    <link:label id="lab_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember_documentation_en-US" xlink:label="lab_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete Tax Expense - Foreign Tax Filing Adjustments</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember" xlink:href="cgnx-20211231.xsd#cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember" xlink:to="lab_cgnx_DiscreteTaxExpenseForeignTaxFilingAdjustmentsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember_3ddab2d4-dad1-432c-b657-8f213d63fd8f_terseLabel_en-US" xlink:label="lab_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Tax Benefit - Gains Taxed Outside U.S. [Member]</link:label>
    <link:label id="lab_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember_label_en-US" xlink:label="lab_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Tax Benefit - Gains Taxed Outside U.S. [Member]</link:label>
    <link:label id="lab_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember_documentation_en-US" xlink:label="lab_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign Tax Benefit - Gains Taxed Outside U.S.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember" xlink:href="cgnx-20211231.xsd#cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember" xlink:to="lab_cgnx_ForeignTaxBenefitGainsTaxedOutsideUSMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfGoodwillTable_59e29f08-d0be-476b-ade9-ff4a1260c86b_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfGoodwillTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Goodwill [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfGoodwillTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfGoodwillTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Goodwill [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfGoodwillTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfGoodwillTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfGoodwillTable" xlink:to="lab_us-gaap_ScheduleOfGoodwillTable" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LiabilitiesFairValueDisclosureAbstract_a08463bb-3712-4f44-8b3e-a4c12bd3fe5a_terseLabel_en-US" xlink:label="lab_us-gaap_LiabilitiesFairValueDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liabilities:</link:label>
    <link:label id="lab_us-gaap_LiabilitiesFairValueDisclosureAbstract_label_en-US" xlink:label="lab_us-gaap_LiabilitiesFairValueDisclosureAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liabilities, Fair Value Disclosure [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesFairValueDisclosureAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesFairValueDisclosureAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LiabilitiesFairValueDisclosureAbstract" xlink:to="lab_us-gaap_LiabilitiesFairValueDisclosureAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AllocatedShareBasedCompensationExpense_43f0e6d6-6f92-4dc8-804a-73b3ba262172_verboseLabel_en-US" xlink:label="lab_us-gaap_AllocatedShareBasedCompensationExpense" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stock-based compensation expense</link:label>
    <link:label id="lab_us-gaap_AllocatedShareBasedCompensationExpense_label_en-US" xlink:label="lab_us-gaap_AllocatedShareBasedCompensationExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Payment Arrangement, Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllocatedShareBasedCompensationExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AllocatedShareBasedCompensationExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AllocatedShareBasedCompensationExpense" xlink:to="lab_us-gaap_AllocatedShareBasedCompensationExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1_682e28c9-7de6-45ec-8c9d-3400a2e404f2_terseLabel_en-US" xlink:label="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Exercisable, weighted-average remaining contractual term (in years)</link:label>
    <link:label id="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1_label_en-US" xlink:label="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Exercisable, Weighted Average Remaining Contractual Term</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1" xlink:to="lab_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsExercisableWeightedAverageRemainingContractualTerm1" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_IntangibleAssetsNetIncludingGoodwill_1b1b64fb-f402-494b-b113-dd54371c456c_terseLabel_en-US" xlink:label="lab_us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible Assets, Net (Including Goodwill)</link:label>
    <link:label id="lab_us-gaap_IntangibleAssetsNetIncludingGoodwill_label_en-US" xlink:label="lab_us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Intangible Assets, Net (Including Goodwill)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:to="lab_us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ResearchMember_c080ef0a-7411-4d6b-8209-a49dd37a0c6e_terseLabel_en-US" xlink:label="lab_us-gaap_ResearchMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Research Tax Credit Carryforward [Member]</link:label>
    <link:label id="lab_us-gaap_ResearchMember_label_en-US" xlink:label="lab_us-gaap_ResearchMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Research Tax Credit Carryforward [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ResearchMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ResearchMember" xlink:to="lab_us-gaap_ResearchMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_LiabilitiesFairValueAdjustment_8f7069a1-a30d-4bc3-a5eb-11d6a939a9df_terseLabel_en-US" xlink:label="lab_us-gaap_LiabilitiesFairValueAdjustment" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair value adjustment</link:label>
    <link:label id="lab_us-gaap_LiabilitiesFairValueAdjustment_label_en-US" xlink:label="lab_us-gaap_LiabilitiesFairValueAdjustment" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Liabilities, Fair Value Adjustment</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesFairValueAdjustment" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesFairValueAdjustment"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_LiabilitiesFairValueAdjustment" xlink:to="lab_us-gaap_LiabilitiesFairValueAdjustment" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossNoncurrent_daddf40d-bf95-4f5c-b95a-d446b9dad8e8_terseLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossNoncurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss, Noncurrent</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossNoncurrent_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossNoncurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss, Noncurrent</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossNoncurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossNoncurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossNoncurrent" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLossNoncurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfDerivativeInstrumentsEffectOnOtherComprehensiveIncomeLossTableTextBlock_0625fc5f-b7da-47f7-a72d-0b14dfc8e445_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfDerivativeInstrumentsEffectOnOtherComprehensiveIncomeLossTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Derivative Instruments, Effect on Other Comprehensive Income (Loss)</link:label>
    <link:label id="lab_us-gaap_ScheduleOfDerivativeInstrumentsEffectOnOtherComprehensiveIncomeLossTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfDerivativeInstrumentsEffectOnOtherComprehensiveIncomeLossTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Derivative Instruments, Effect on Other Comprehensive Income (Loss) [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDerivativeInstrumentsEffectOnOtherComprehensiveIncomeLossTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfDerivativeInstrumentsEffectOnOtherComprehensiveIncomeLossTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfDerivativeInstrumentsEffectOnOtherComprehensiveIncomeLossTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfDerivativeInstrumentsEffectOnOtherComprehensiveIncomeLossTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty_18d5edb8-f5ac-45d7-acf5-05c5c7419c65_verboseLabel_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" xlink:role="http://www.xbrl.org/2003/role/verboseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete tax expense for migration of acquired intellectual property</link:label>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty_a58cd394-3e60-4d0a-9239-e93ea04d0616_terseLabel_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Discrete tax expense related to migration of acquired IP</link:label>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty_label_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Migration of Acquired Intellectual Property</link:label>
    <link:label id="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty_documentation_en-US" xlink:label="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Effective Income Tax Rate Reconciliation, Migration of Acquired Intellectual Property</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" xlink:href="cgnx-20211231.xsd#cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" xlink:to="lab_cgnx_EffectiveIncomeTaxRateReconciliationMigrationofAcquiredIntellectualProperty" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InvestmentTypeCategorizationMember_ee08d153-5c21-42fb-aac4-faf27c20eee6_terseLabel_en-US" xlink:label="lab_us-gaap_InvestmentTypeCategorizationMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investment Type Categorization [Domain]</link:label>
    <link:label id="lab_us-gaap_InvestmentTypeCategorizationMember_label_en-US" xlink:label="lab_us-gaap_InvestmentTypeCategorizationMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Investments [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeCategorizationMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentTypeCategorizationMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember" xlink:to="lab_us-gaap_InvestmentTypeCategorizationMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PayablesAndAccrualsAbstract_f9b8237b-7195-4b8e-b117-1620d2a3e1c0_terseLabel_en-US" xlink:label="lab_us-gaap_PayablesAndAccrualsAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payables and Accruals [Abstract]</link:label>
    <link:label id="lab_us-gaap_PayablesAndAccrualsAbstract_label_en-US" xlink:label="lab_us-gaap_PayablesAndAccrualsAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payables and Accruals [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PayablesAndAccrualsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PayablesAndAccrualsAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PayablesAndAccrualsAbstract" xlink:to="lab_us-gaap_PayablesAndAccrualsAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_f0f6ad6d-5cf5-4bf3-aa2c-b50b90bbf6df_periodStartLabel_en-US" xlink:label="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash and cash equivalents at beginning of year</link:label>
    <link:label id="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_8794dcea-d194-4271-9802-0e1f5714216c_periodEndLabel_en-US" xlink:label="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash and cash equivalents at end of year</link:label>
    <link:label id="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_label_en-US" xlink:label="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash, Cash Equivalents, Restricted Cash and Restricted Cash Equivalents</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:to="lab_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommonStockParOrStatedValuePerShare_001f095a-8aca-4521-a34e-8d02ebc95683_terseLabel_en-US" xlink:label="lab_us-gaap_CommonStockParOrStatedValuePerShare" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common stock par value, in dollars per share</link:label>
    <link:label id="lab_us-gaap_CommonStockParOrStatedValuePerShare_label_en-US" xlink:label="lab_us-gaap_CommonStockParOrStatedValuePerShare" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock, Par or Stated Value Per Share</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockParOrStatedValuePerShare" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockParOrStatedValuePerShare"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommonStockParOrStatedValuePerShare" xlink:to="lab_us-gaap_CommonStockParOrStatedValuePerShare" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss_2ec1fc16-7259-45c4-901f-983399063b27_periodStartLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Beginning balance</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss_ab5177c1-2768-443e-980b-a217e1330b36_periodEndLabel_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Ending balance</link:label>
    <link:label id="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss_label_en-US" xlink:label="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-sale, Allowance for Credit Loss</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss" xlink:to="lab_us-gaap_DebtSecuritiesAvailableForSaleAllowanceForCreditLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_6c3400d5-ac60-42bc-87c6-3047569f90ba_terseLabel_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2-3 Years</link:label>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_label_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available For Sale Securities Debt Maturities After Two Years Before Three Years Fair Value</link:label>
    <link:label id="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue_documentation_en-US" xlink:label="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Available-for-sale securities, debt maturities after second year but before third year, fair value.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" xlink:href="cgnx-20211231.xsd#cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" xlink:to="lab_cgnx_AvailableForSaleSecuritiesDebtMaturitiesAfterTwoYearsBeforeThreeYearsFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AssetsCurrentAbstract_3ac22173-cc37-4f2b-ae24-3fb15f5248db_terseLabel_en-US" xlink:label="lab_us-gaap_AssetsCurrentAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current assets:</link:label>
    <link:label id="lab_us-gaap_AssetsCurrentAbstract_label_en-US" xlink:label="lab_us-gaap_AssetsCurrentAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Assets, Current [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsCurrentAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsCurrentAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AssetsCurrentAbstract" xlink:to="lab_us-gaap_AssetsCurrentAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StatementOfIncomeAndComprehensiveIncomeAbstract_c9bf5900-9d1f-449d-8449-9092e7d3437b_terseLabel_en-US" xlink:label="lab_us-gaap_StatementOfIncomeAndComprehensiveIncomeAbstract" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement of Comprehensive Income [Abstract]</link:label>
    <link:label id="lab_us-gaap_StatementOfIncomeAndComprehensiveIncomeAbstract_label_en-US" xlink:label="lab_us-gaap_StatementOfIncomeAndComprehensiveIncomeAbstract" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Statement of Comprehensive Income [Abstract]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementOfIncomeAndComprehensiveIncomeAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatementOfIncomeAndComprehensiveIncomeAbstract"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StatementOfIncomeAndComprehensiveIncomeAbstract" xlink:to="lab_us-gaap_StatementOfIncomeAndComprehensiveIncomeAbstract" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsGross_5f7a257b-0c6f-4c3c-a903-6aa105a18d4e_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsGross" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross Carrying Value</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsGross_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsGross" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Assets, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsGross" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsGross"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsGross" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsGross" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_GViVenturesInc.Member_30fe60b8-e81a-4e85-b311-d0fccfdfda24_terseLabel_en-US" xlink:label="lab_cgnx_GViVenturesInc.Member" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">GVi Ventures, Inc.</link:label>
    <link:label id="lab_cgnx_GViVenturesInc.Member_label_en-US" xlink:label="lab_cgnx_GViVenturesInc.Member" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">GVi Ventures, Inc. [Member]</link:label>
    <link:label id="lab_cgnx_GViVenturesInc.Member_documentation_en-US" xlink:label="lab_cgnx_GViVenturesInc.Member" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">GVi Ventures, Inc. [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_GViVenturesInc.Member" xlink:href="cgnx-20211231.xsd#cgnx_GViVenturesInc.Member"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_GViVenturesInc.Member" xlink:to="lab_cgnx_GViVenturesInc.Member" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTableTextBlock_a52de723-aa79-477f-bb2f-347be288a2b3_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Amortized Intangible Assets</link:label>
    <link:label id="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTableTextBlock_label_en-US" xlink:label="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTableTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Finite-Lived Intangible Assets [Table Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTableTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTableTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTableTextBlock" xlink:to="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTableTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised_5127c3c9-1931-458a-8821-826df828ac9e_terseLabel_en-US" xlink:label="lab_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Issuance of common stock under stock option plans, shares</link:label>
    <link:label id="lab_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised_6d1e93f7-df68-47c3-a3ad-bc72735f9358_negatedLabel_en-US" xlink:label="lab_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Exercised</link:label>
    <link:label id="lab_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised_label_en-US" xlink:label="lab_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Options, Exercises in Period</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised" xlink:to="lab_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueMeasurementsRecurringMember_44caeee8-c914-48a1-b601-8aa0baf01f8f_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueMeasurementsRecurringMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Measurements, Recurring</link:label>
    <link:label id="lab_us-gaap_FairValueMeasurementsRecurringMember_label_en-US" xlink:label="lab_us-gaap_FairValueMeasurementsRecurringMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value, Recurring [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsRecurringMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueMeasurementsRecurringMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueMeasurementsRecurringMember" xlink:to="lab_us-gaap_FairValueMeasurementsRecurringMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_StockholdersEquityNoteDisclosureTextBlock_fec5ed9f-7d3e-4bb8-8564-5966a7a76f8a_terseLabel_en-US" xlink:label="lab_us-gaap_StockholdersEquityNoteDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Shareholders&#8217; Equity</link:label>
    <link:label id="lab_us-gaap_StockholdersEquityNoteDisclosureTextBlock_label_en-US" xlink:label="lab_us-gaap_StockholdersEquityNoteDisclosureTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Stockholders' Equity Note Disclosure [Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquityNoteDisclosureTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquityNoteDisclosureTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_StockholdersEquityNoteDisclosureTextBlock" xlink:to="lab_us-gaap_StockholdersEquityNoteDisclosureTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableWriteOffs_d45f97f1-8dcf-49b8-9c54-5bc091539fb1_negatedTerseLabel_en-US" xlink:label="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableWriteOffs" xlink:role="http://www.xbrl.org/2009/role/negatedTerseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Write-offs, net of recoveries</link:label>
    <link:label id="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableWriteOffs_label_en-US" xlink:label="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableWriteOffs" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accounts Receivable, Allowance for Credit Loss, Writeoff</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllowanceForDoubtfulAccountsReceivableWriteOffs" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AllowanceForDoubtfulAccountsReceivableWriteOffs"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AllowanceForDoubtfulAccountsReceivableWriteOffs" xlink:to="lab_us-gaap_AllowanceForDoubtfulAccountsReceivableWriteOffs" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsReductionsResultingFromLapseOfApplicableStatuteOfLimitations_98155313-90a3-49a3-b752-9ba17404e78d_negatedLabel_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsReductionsResultingFromLapseOfApplicableStatuteOfLimitations" xlink:role="http://www.xbrl.org/2009/role/negatedLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Gross amounts of decreases in unrecognized tax benefits as a result of the expiration of the applicable statutes of limitations</link:label>
    <link:label id="lab_us-gaap_UnrecognizedTaxBenefitsReductionsResultingFromLapseOfApplicableStatuteOfLimitations_label_en-US" xlink:label="lab_us-gaap_UnrecognizedTaxBenefitsReductionsResultingFromLapseOfApplicableStatuteOfLimitations" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Unrecognized Tax Benefits, Reduction Resulting from Lapse of Applicable Statute of Limitations</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnrecognizedTaxBenefitsReductionsResultingFromLapseOfApplicableStatuteOfLimitations" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnrecognizedTaxBenefitsReductionsResultingFromLapseOfApplicableStatuteOfLimitations"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_UnrecognizedTaxBenefitsReductionsResultingFromLapseOfApplicableStatuteOfLimitations" xlink:to="lab_us-gaap_UnrecognizedTaxBenefitsReductionsResultingFromLapseOfApplicableStatuteOfLimitations" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_d9c1b416-5075-4e04-a198-9b34b1fdbd96_terseLabel_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">2026</link:label>
    <link:label id="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_label_en-US" xlink:label="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Finite-Lived Intangible Asset, Expected Amortization, Year Five</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive" xlink:to="lab_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_FairValueOfFinancialInstrumentsPolicy_1870e993-5c47-4f1c-9c0d-5590e13f2547_terseLabel_en-US" xlink:label="lab_us-gaap_FairValueOfFinancialInstrumentsPolicy" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value Measurements</link:label>
    <link:label id="lab_us-gaap_FairValueOfFinancialInstrumentsPolicy_label_en-US" xlink:label="lab_us-gaap_FairValueOfFinancialInstrumentsPolicy" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Fair Value of Financial Instruments, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueOfFinancialInstrumentsPolicy" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueOfFinancialInstrumentsPolicy"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_FairValueOfFinancialInstrumentsPolicy" xlink:to="lab_us-gaap_FairValueOfFinancialInstrumentsPolicy" xlink:type="arc" order="1"/>
    <link:label id="lab_dei_AuditorFirmId_240572a5-a251-4ed9-b13c-f2883bbfd238_terseLabel_en-US" xlink:label="lab_dei_AuditorFirmId" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Auditor Firm ID</link:label>
    <link:label id="lab_dei_AuditorFirmId_label_en-US" xlink:label="lab_dei_AuditorFirmId" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Auditor Firm ID</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_dei_AuditorFirmId" xlink:href="https://xbrl.sec.gov/dei/2021q4/dei-2021q4.xsd#dei_AuditorFirmId"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_dei_AuditorFirmId" xlink:to="lab_dei_AuditorFirmId" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInInvestingActivities_c6951816-9cc9-4094-9795-dcfa864ae662_totalLabel_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:role="http://www.xbrl.org/2003/role/totalLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net cash provided by (used in) investing activities</link:label>
    <link:label id="lab_us-gaap_NetCashProvidedByUsedInInvestingActivities_label_en-US" xlink:label="lab_us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Net Cash Provided by (Used in) Investing Activities</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:to="lab_us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_AgencyBondsFairValueDisclosure_b26dfee9-ca80-4879-b426-49c10a266496_terseLabel_en-US" xlink:label="lab_cgnx_AgencyBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Agency bonds</link:label>
    <link:label id="lab_cgnx_AgencyBondsFairValueDisclosure_label_en-US" xlink:label="lab_cgnx_AgencyBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Agency Bonds Fair Value Disclosure</link:label>
    <link:label id="lab_cgnx_AgencyBondsFairValueDisclosure_documentation_en-US" xlink:label="lab_cgnx_AgencyBondsFairValueDisclosure" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Agency bonds fair value disclosure.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_AgencyBondsFairValueDisclosure" xlink:href="cgnx-20211231.xsd#cgnx_AgencyBondsFairValueDisclosure"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_AgencyBondsFairValueDisclosure" xlink:to="lab_cgnx_AgencyBondsFairValueDisclosure" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeAssetNotionalAmount_b51fea06-4d46-49b6-a9ff-626d142f18e3_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeAssetNotionalAmount" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Asset, Notional Amount</link:label>
    <link:label id="lab_us-gaap_DerivativeAssetNotionalAmount_label_en-US" xlink:label="lab_us-gaap_DerivativeAssetNotionalAmount" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Asset, Notional Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssetNotionalAmount" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeAssetNotionalAmount"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeAssetNotionalAmount" xlink:to="lab_us-gaap_DerivativeAssetNotionalAmount" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_f2b61f96-3c57-4a27-8c04-cf7ed7f0ce28_terseLabel_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Vested, weighted-average exercise price</link:label>
    <link:label id="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_label_en-US" xlink:label="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Share-based Compensation Arrangement by Share-based Payment Award, Equity Instruments Other than Options, Vested in Period, Weighted Average Grant Date Fair Value</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:to="lab_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ClassOfStockDomain_4f74b0b8-073a-4004-80e8-8654ef01452b_terseLabel_en-US" xlink:label="lab_us-gaap_ClassOfStockDomain" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Class of Stock [Domain]</link:label>
    <link:label id="lab_us-gaap_ClassOfStockDomain_label_en-US" xlink:label="lab_us-gaap_ClassOfStockDomain" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Class of Stock [Domain]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ClassOfStockDomain"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ClassOfStockDomain" xlink:to="lab_us-gaap_ClassOfStockDomain" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PaymentsToAcquireBusinessesGross_e1f195b1-69f3-458d-b331-d9ff075077eb_terseLabel_en-US" xlink:label="lab_us-gaap_PaymentsToAcquireBusinessesGross" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Cash paid in purchase price</link:label>
    <link:label id="lab_us-gaap_PaymentsToAcquireBusinessesGross_label_en-US" xlink:label="lab_us-gaap_PaymentsToAcquireBusinessesGross" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Payments to Acquire Businesses, Gross</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesGross" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireBusinessesGross"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PaymentsToAcquireBusinessesGross" xlink:to="lab_us-gaap_PaymentsToAcquireBusinessesGross" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ProductCostOfRevenueMember_b56e4f2a-2d52-4394-ae72-b70c9a41f5fe_terseLabel_en-US" xlink:label="lab_cgnx_ProductCostOfRevenueMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product cost of revenue [Member]</link:label>
    <link:label id="lab_cgnx_ProductCostOfRevenueMember_label_en-US" xlink:label="lab_cgnx_ProductCostOfRevenueMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product Cost Of Revenue [Member]</link:label>
    <link:label id="lab_cgnx_ProductCostOfRevenueMember_documentation_en-US" xlink:label="lab_cgnx_ProductCostOfRevenueMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product cost of revenue.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ProductCostOfRevenueMember" xlink:href="cgnx-20211231.xsd#cgnx_ProductCostOfRevenueMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ProductCostOfRevenueMember" xlink:to="lab_cgnx_ProductCostOfRevenueMember" xlink:type="arc" order="1"/>
    <link:label id="lab_currency_EUR_e81dc2e5-dab8-4ec7-97f4-856a1bd5c54a_terseLabel_en-US" xlink:label="lab_currency_EUR" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Euro [Member]</link:label>
    <link:label id="lab_currency_EUR_label_en-US" xlink:label="lab_currency_EUR" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Euro Member Countries, Euro</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_currency_EUR" xlink:href="https://xbrl.sec.gov/currency/2021/currency-2021.xsd#currency_EUR"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_currency_EUR" xlink:to="lab_currency_EUR" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_GoodwillForeignCurrencyTranslationGainLoss_e751ce2f-bbff-4493-89ec-7e9c42784b3c_terseLabel_en-US" xlink:label="lab_us-gaap_GoodwillForeignCurrencyTranslationGainLoss" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign exchange rate changes</link:label>
    <link:label id="lab_us-gaap_GoodwillForeignCurrencyTranslationGainLoss_label_en-US" xlink:label="lab_us-gaap_GoodwillForeignCurrencyTranslationGainLoss" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Goodwill, Foreign Currency Translation Gain (Loss)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillForeignCurrencyTranslationGainLoss" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GoodwillForeignCurrencyTranslationGainLoss"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_GoodwillForeignCurrencyTranslationGainLoss" xlink:to="lab_us-gaap_GoodwillForeignCurrencyTranslationGainLoss" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_NoncurrentAssets_9b2b9565-d9ac-4b0e-941e-a23d882a748f_terseLabel_en-US" xlink:label="lab_us-gaap_NoncurrentAssets" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long-lived assets</link:label>
    <link:label id="lab_us-gaap_NoncurrentAssets_label_en-US" xlink:label="lab_us-gaap_NoncurrentAssets" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Long-Lived Assets</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoncurrentAssets" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NoncurrentAssets"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_NoncurrentAssets" xlink:to="lab_us-gaap_NoncurrentAssets" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ComputerHardwareAndSoftwareMember_1251c4ea-4f60-4eb7-b370-47a3edd6fc8a_terseLabel_en-US" xlink:label="lab_cgnx_ComputerHardwareAndSoftwareMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Computer Hardware and Software [Member]</link:label>
    <link:label id="lab_cgnx_ComputerHardwareAndSoftwareMember_label_en-US" xlink:label="lab_cgnx_ComputerHardwareAndSoftwareMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Computer Hardware And Software [Member]</link:label>
    <link:label id="lab_cgnx_ComputerHardwareAndSoftwareMember_documentation_en-US" xlink:label="lab_cgnx_ComputerHardwareAndSoftwareMember" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Computer Hardware and Software Member.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ComputerHardwareAndSoftwareMember" xlink:href="cgnx-20211231.xsd#cgnx_ComputerHardwareAndSoftwareMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ComputerHardwareAndSoftwareMember" xlink:to="lab_cgnx_ComputerHardwareAndSoftwareMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AssetBackedSecuritiesMember_3a719c98-84f1-4f66-b7e3-eaacd9755514_terseLabel_en-US" xlink:label="lab_us-gaap_AssetBackedSecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Asset-Backed Securities [Member]</link:label>
    <link:label id="lab_us-gaap_AssetBackedSecuritiesMember_label_en-US" xlink:label="lab_us-gaap_AssetBackedSecuritiesMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Asset-backed Securities [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AssetBackedSecuritiesMember" xlink:to="lab_us-gaap_AssetBackedSecuritiesMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AdvertisingExpense_d817965b-4046-435a-9d91-e0059322c34e_terseLabel_en-US" xlink:label="lab_us-gaap_AdvertisingExpense" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Advertising costs</link:label>
    <link:label id="lab_us-gaap_AdvertisingExpense_label_en-US" xlink:label="lab_us-gaap_AdvertisingExpense" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Advertising Expense</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdvertisingExpense" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdvertisingExpense"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AdvertisingExpense" xlink:to="lab_us-gaap_AdvertisingExpense" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_PrepaidExpensesAndOtherCurrentAssetsMember_e51966e2-33d1-4a6f-9cdb-bf9de0949eec_terseLabel_en-US" xlink:label="lab_us-gaap_PrepaidExpensesAndOtherCurrentAssetsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Prepaid Expenses and Other Current Assets [Member]</link:label>
    <link:label id="lab_us-gaap_PrepaidExpensesAndOtherCurrentAssetsMember_label_en-US" xlink:label="lab_us-gaap_PrepaidExpensesAndOtherCurrentAssetsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Prepaid Expenses and Other Current Assets [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpensesAndOtherCurrentAssetsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PrepaidExpensesAndOtherCurrentAssetsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_PrepaidExpensesAndOtherCurrentAssetsMember" xlink:to="lab_us-gaap_PrepaidExpensesAndOtherCurrentAssetsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_cgnx_ProductWarrantyPeriod_0d9dc127-05d4-4361-b35e-dd0f02cccce7_terseLabel_en-US" xlink:label="lab_cgnx_ProductWarrantyPeriod" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product Warranty Period</link:label>
    <link:label id="lab_cgnx_ProductWarrantyPeriod_label_en-US" xlink:label="lab_cgnx_ProductWarrantyPeriod" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product Warranty Period</link:label>
    <link:label id="lab_cgnx_ProductWarrantyPeriod_documentation_en-US" xlink:label="lab_cgnx_ProductWarrantyPeriod" xlink:role="http://www.xbrl.org/2003/role/documentation" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Product warranty period.</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_cgnx_ProductWarrantyPeriod" xlink:href="cgnx-20211231.xsd#cgnx_ProductWarrantyPeriod"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_cgnx_ProductWarrantyPeriod" xlink:to="lab_cgnx_ProductWarrantyPeriod" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DerivativeFairValueOfDerivativeLiability_a4b5a81d-cf55-456f-af96-f9916c84a6c1_terseLabel_en-US" xlink:label="lab_us-gaap_DerivativeFairValueOfDerivativeLiability" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Liability, Fair Value, Gross Liability</link:label>
    <link:label id="lab_us-gaap_DerivativeFairValueOfDerivativeLiability_label_en-US" xlink:label="lab_us-gaap_DerivativeFairValueOfDerivativeLiability" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Derivative Liability, Fair Value, Gross Liability</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeLiability" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DerivativeFairValueOfDerivativeLiability"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DerivativeFairValueOfDerivativeLiability" xlink:to="lab_us-gaap_DerivativeFairValueOfDerivativeLiability" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesBalance_894de51f-0bf2-4343-8642-5dffc2087224_terseLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesBalance" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves, Amount</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesBalance_f39abc57-3e27-4765-8611-31a86b27bf00_periodStartLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesBalance" xlink:role="http://www.xbrl.org/2003/role/periodStartLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance&#160;at Beginning of Period</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesBalance_75e6135f-a62d-4d17-b9dd-61da2beb89ec_periodEndLabel_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesBalance" xlink:role="http://www.xbrl.org/2003/role/periodEndLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Balance&#160;at End of Period</link:label>
    <link:label id="lab_us-gaap_ValuationAllowancesAndReservesBalance_label_en-US" xlink:label="lab_us-gaap_ValuationAllowancesAndReservesBalance" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">SEC Schedule, 12-09, Valuation Allowances and Reserves, Amount</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ValuationAllowancesAndReservesBalance" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ValuationAllowancesAndReservesBalance"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ValuationAllowancesAndReservesBalance" xlink:to="lab_us-gaap_ValuationAllowancesAndReservesBalance" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AccruedIncomeTaxesCurrent_dba6119a-f474-493b-b31b-1a3d05a95b59_terseLabel_en-US" xlink:label="lab_us-gaap_AccruedIncomeTaxesCurrent" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued income taxes</link:label>
    <link:label id="lab_us-gaap_AccruedIncomeTaxesCurrent_label_en-US" xlink:label="lab_us-gaap_AccruedIncomeTaxesCurrent" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Accrued Income Taxes, Current</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedIncomeTaxesCurrent" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedIncomeTaxesCurrent"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AccruedIncomeTaxesCurrent" xlink:to="lab_us-gaap_AccruedIncomeTaxesCurrent" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_InventoryPolicyTextBlock_5f11f9fc-5d7d-4d1c-969d-61262659715b_terseLabel_en-US" xlink:label="lab_us-gaap_InventoryPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventories</link:label>
    <link:label id="lab_us-gaap_InventoryPolicyTextBlock_label_en-US" xlink:label="lab_us-gaap_InventoryPolicyTextBlock" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Inventory, Policy [Policy Text Block]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InventoryPolicyTextBlock" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InventoryPolicyTextBlock"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_InventoryPolicyTextBlock" xlink:to="lab_us-gaap_InventoryPolicyTextBlock" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CurrentForeignTaxExpenseBenefit_e3cb409b-b074-418d-81fb-43d121119994_terseLabel_en-US" xlink:label="lab_us-gaap_CurrentForeignTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Foreign</link:label>
    <link:label id="lab_us-gaap_CurrentForeignTaxExpenseBenefit_label_en-US" xlink:label="lab_us-gaap_CurrentForeignTaxExpenseBenefit" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Current Foreign Tax Expense (Benefit)</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentForeignTaxExpenseBenefit" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentForeignTaxExpenseBenefit"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CurrentForeignTaxExpenseBenefit" xlink:to="lab_us-gaap_CurrentForeignTaxExpenseBenefit" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_CommonStockValueOutstanding_276300dd-10b4-495a-92d6-00906d747f12_terseLabel_en-US" xlink:label="lab_us-gaap_CommonStockValueOutstanding" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common stock, $.002 par value &#8211; Authorized: 300,000 shares in 2021 and 2020, respectively, issued and outstanding: 175,481 and 175,790 shares in 2021 and 2020, respectively</link:label>
    <link:label id="lab_us-gaap_CommonStockValueOutstanding_label_en-US" xlink:label="lab_us-gaap_CommonStockValueOutstanding" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Common Stock, Value, Outstanding</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValueOutstanding" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockValueOutstanding"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_CommonStockValueOutstanding" xlink:to="lab_us-gaap_CommonStockValueOutstanding" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_DevelopedTechnologyRightsMember_74fbac7a-4f6b-43a5-854f-3894b2cbfe23_terseLabel_en-US" xlink:label="lab_us-gaap_DevelopedTechnologyRightsMember" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Completed Technologies [Member]</link:label>
    <link:label id="lab_us-gaap_DevelopedTechnologyRightsMember_label_en-US" xlink:label="lab_us-gaap_DevelopedTechnologyRightsMember" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Developed Technology Rights [Member]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DevelopedTechnologyRightsMember" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DevelopedTechnologyRightsMember"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_DevelopedTechnologyRightsMember" xlink:to="lab_us-gaap_DevelopedTechnologyRightsMember" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_295d3235-624b-4704-afd7-f536c84418c7_terseLabel_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Less than 1 Year</link:label>
    <link:label id="lab_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_label_en-US" xlink:label="lab_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Debt Securities, Available-for-Sale, Fair Value, Maturity, Allocated and Single Maturity Date, Year One</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue" xlink:to="lab_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ConcentrationRiskByBenchmarkAxis_6b066880-fe71-418e-b607-0ddc247872a6_terseLabel_en-US" xlink:label="lab_us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk Benchmark [Axis]</link:label>
    <link:label id="lab_us-gaap_ConcentrationRiskByBenchmarkAxis_label_en-US" xlink:label="lab_us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Concentration Risk Benchmark [Axis]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:to="lab_us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:type="arc" order="1"/>
    <link:label id="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_1455e978-3713-43a9-b0f3-b6b1f1f462a8_terseLabel_en-US" xlink:label="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable" xlink:role="http://www.xbrl.org/2003/role/terseLabel" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Finite-Lived Intangible Assets [Table]</link:label>
    <link:label id="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_label_en-US" xlink:label="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable" xlink:role="http://www.xbrl.org/2003/role/label" xlink:type="resource" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-US">Schedule of Finite-Lived Intangible Assets [Table]</link:label>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable"/>
    <link:labelArc xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable" xlink:to="lab_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable" xlink:type="arc" order="1"/>
  </link:labelLink>
</link:linkbase>
