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

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2024-05-08</periodOfReport>

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

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001305182</rptOwnerCik>
            <rptOwnerName>Fischer David B</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>
            <isDirector>true</isDirector>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>false</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2024-05-08</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>4363</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>152.847</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>9646</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2024-05-08</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>637</value>
                    <footnoteId id="F2"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>153.894</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>9009</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">This transaction was executed in multiples sales ranging from $152.4800 to $153.4600 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">This transaction was executed in multiples sales ranging from $153.4800 to $154.2100 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>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Travis Larsen, Attorney in Fact for David B. Fischer</signatureName>
        <signatureDate>2024-05-10</signatureDate>
    </ownerSignature>
</ownershipDocument>
