<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2023-11-10</periodOfReport>

    <issuer>
        <issuerCik>0000785956</issuerCik>
        <issuerName>J&amp;J SNACK FOODS CORP</issuerName>
        <issuerTradingSymbol>JJSF</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001952646</rptOwnerCik>
            <rptOwnerName>Cranmer Robert</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O J&amp;J SNACK FOODS CORP.</rptOwnerStreet1>
            <rptOwnerStreet2>350 FELLOWSHIP ROAD</rptOwnerStreet2>
            <rptOwnerCity>MOUNT LAUREL</rptOwnerCity>
            <rptOwnerState>NJ</rptOwnerState>
            <rptOwnerZipCode>08054</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isOfficer>1</isOfficer>
            <officerTitle>Senior VP, Operations</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common stock, no par value</value>
            </securityTitle>
            <transactionDate>
                <value>2023-11-10</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>F</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>55</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>160.03</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>1260</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                    <footnoteId id="F2"/>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common stock, no par value</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>1330</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See footnote</value>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">On November 10, 2021, 484 service share units were issued to the Reporting Person pursuant to a Service Share Unit Award with such shares vesting equally on the first, second and third anniversaries of the grant date.  These shares were sold to cover taxes associated with the vesting of the second tranche</footnote>
        <footnote id="F2">This number includes 390 shares purchased by the Reporting Person through the J &amp; J Snack Foods Corp. 1996 Employee Stock Purchase Plan.</footnote>
        <footnote id="F3">Represents shares owned by Mr. Cranmer in his J &amp; J Snack Foods Corp. 401K Profit Sharing Plan as of November 10, 2023.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Michael A. Pollner, Attorney in Fact</signatureName>
        <signatureDate>2023-11-14</signatureDate>
    </ownerSignature>
</ownershipDocument>
