<?xml version="1.0" encoding="UTF-8"?><edgarSubmission xmlns="http://www.sec.gov/edgar/ownership" xmlns:ns2="http://www.sec.gov/edgar/common">
    <headerData>
        <submissionType>144</submissionType>
        <filerInfo>
            <filer>
                <filerCredentials>
                    <cik>0001938568</cik>
                    <ccc>XXXXXXXX</ccc>
                </filerCredentials>
            </filer>
            <liveTestFlag>LIVE</liveTestFlag>



        </filerInfo>
    </headerData>
    <formData>
        <issuerInfo>
            <issuerCik>0000851205</issuerCik>
            <issuerName>COGNEX CORPORATION</issuerName>
            <secFileNumber>001-34218</secFileNumber>
            <issuerAddress>
                <ns2:street1>One Vision Drive</ns2:street1>
                <ns2:city>Natick</ns2:city>
                <ns2:stateOrCountry>MA</ns2:stateOrCountry>
                <ns2:zipCode>01760-2059</ns2:zipCode>
            </issuerAddress>
            <issuerContactPhone>(508) 650-3000</issuerContactPhone>
            <nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>JOERG KUECHEN</nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>
            <relationshipsToIssuer>
                <relationshipToIssuer>Officer</relationshipToIssuer>
            </relationshipsToIssuer>
        </issuerInfo>
        <securitiesInformation>
            <securitiesClassTitle>Common</securitiesClassTitle>
            <brokerOrMarketmakerDetails>
                <name>Morgan Stanley Smith Barney LLC Executive Financial Services</name>
                <address>
                    <ns2:street1>1 New York Plaza</ns2:street1>
                    <ns2:street2>8th Floor</ns2:street2>
                    <ns2:city>New York</ns2:city>
                    <ns2:stateOrCountry>NY</ns2:stateOrCountry>
                    <ns2:zipCode>10004</ns2:zipCode>
                </address>
            </brokerOrMarketmakerDetails>
            <noOfUnitsSold>7991</noOfUnitsSold>
            <aggregateMarketValue>263468.86</aggregateMarketValue>
            <noOfUnitsOutstanding>169865714</noOfUnitsOutstanding>
            <approxSaleDate>03/11/2025</approxSaleDate>
            <securitiesExchangeName>NASDAQ</securitiesExchangeName>
        </securitiesInformation>
        <securitiesToBeSold>
            <securitiesClassTitle>Common</securitiesClassTitle>
            <acquiredDate>02/21/2025</acquiredDate>
            <natureOfAcquisitionTransaction>Restricted Stock</natureOfAcquisitionTransaction>
            <nameOfPersonfromWhomAcquired>ISSUER</nameOfPersonfromWhomAcquired>
            <isGiftTransaction>N</isGiftTransaction>
            <amountOfSecuritiesAcquired>2685</amountOfSecuritiesAcquired>
            <paymentDate>02/21/2025</paymentDate>
            <natureOfPayment>Not Applicable</natureOfPayment>
        </securitiesToBeSold>
        <securitiesToBeSold>
            <securitiesClassTitle>Common</securitiesClassTitle>
            <acquiredDate>02/22/2025</acquiredDate>
            <natureOfAcquisitionTransaction>Restricted Stock</natureOfAcquisitionTransaction>
            <nameOfPersonfromWhomAcquired>ISSUER</nameOfPersonfromWhomAcquired>
            <isGiftTransaction>N</isGiftTransaction>
            <amountOfSecuritiesAcquired>2987</amountOfSecuritiesAcquired>
            <paymentDate>02/22/2025</paymentDate>
            <natureOfPayment>Not Applicable</natureOfPayment>
        </securitiesToBeSold>
        <securitiesToBeSold>
            <securitiesClassTitle>Common</securitiesClassTitle>
            <acquiredDate>02/20/2025</acquiredDate>
            <natureOfAcquisitionTransaction>Restricted Stock</natureOfAcquisitionTransaction>
            <nameOfPersonfromWhomAcquired>ISSUER</nameOfPersonfromWhomAcquired>
            <isGiftTransaction>N</isGiftTransaction>
            <amountOfSecuritiesAcquired>2319</amountOfSecuritiesAcquired>
            <paymentDate>02/20/2025</paymentDate>
            <natureOfPayment>Not Applicable</natureOfPayment>
        </securitiesToBeSold>
        <nothingToReportFlagOnSecuritiesSoldInPast3Months>N</nothingToReportFlagOnSecuritiesSoldInPast3Months>
        <securitiesSoldInPast3Months>
            <sellerDetails>
                <name>JOERG KUECHEN</name>
                <address>
                    <ns2:street1>One Vision Drive</ns2:street1>
                    <ns2:city>Natick</ns2:city>
                    <ns2:stateOrCountry>MA</ns2:stateOrCountry>
                    <ns2:zipCode>01760-2059</ns2:zipCode>
                </address>
            </sellerDetails>
            <securitiesClassTitle>Common</securitiesClassTitle>
            <saleDate>12/12/2024</saleDate>
            <amountOfSecuritiesSold>2934</amountOfSecuritiesSold>
            <grossProceeds>110772.88</grossProceeds>
        </securitiesSoldInPast3Months>
        <noticeSignature>
            <noticeDate>03/11/2025</noticeDate>
            <planAdoptionDates>
                <planAdoptionDate>12/10/2024</planAdoptionDate>
            </planAdoptionDates>
            <signature>/s/ Joerg Kuechen</signature>
        </noticeSignature>
    </formData>
</edgarSubmission>
[{"type": "144", "sequence": "1", "filename": "primary_doc.xml", "secsgml_size_bytes": 5170}]
144
0001938568
XXXXXXXX
LIVE
0000851205
COGNEX CORPORATION
001-34218
One Vision Drive
Natick
MA
01760-2059
(508) 650-3000
JOERG KUECHEN
Officer
Common
Morgan Stanley Smith Barney LLC Executive Financial Services
1 New York Plaza
8th Floor
New York
NY
10004
7991
263468.86
169865714
03/11/2025
NASDAQ
Common
02/21/2025
Restricted Stock
ISSUER
N
2685
02/21/2025
Not Applicable
Common
02/22/2025
Restricted Stock
ISSUER
N
2987
02/22/2025
Not Applicable
Common
02/20/2025
Restricted Stock
ISSUER
N
2319
02/20/2025
Not Applicable
N
JOERG KUECHEN
One Vision Drive
Natick
MA
01760-2059
Common
12/12/2024
2934
110772.88
03/11/2025
12/10/2024
/s/ Joerg Kuechen