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

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2024-05-10</periodOfReport>

    <issuer>
        <issuerCik>0000009326</issuerCik>
        <issuerName>BALCHEM CORP</issuerName>
        <issuerTradingSymbol>BCPC</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001906436</rptOwnerCik>
            <rptOwnerName>Sestrick Michael Robert</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O BALCHEM CORPORATION</rptOwnerStreet1>
            <rptOwnerStreet2>5 PARAGON DRIVE</rptOwnerStreet2>
            <rptOwnerCity>MONTVALE</rptOwnerCity>
            <rptOwnerState>NJ</rptOwnerState>
            <rptOwnerZipCode>07645</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isOfficer>true</isOfficer>
            <officerTitle>SVP &amp; Chief Technology Officer</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>false</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2024-05-10</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>1929</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>154.4503</value>
                    <footnoteId id="F1"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>4878</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">This transaction was executed in multiple sales ranging from $154.3700 to $154.8800 per share, inclusive.  The price reported above reflects the weighted average sale price.  The reporting person hereby undertakes to provide upon request to the SEC staff, the issuer, or any security holder of the issuer full information regarding the number of shares and prices at which the transactions were affected regarding this footnote.</footnote>
        <footnote id="F2">Includes acquisition of shares under the Balchem Corporation 401(k) plan.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Travis Larsen, Attorney in Fact for Michael Robert Sestrick</signatureName>
        <signatureDate>2024-05-13</signatureDate>
    </ownerSignature>
</ownershipDocument>
