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

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2022-02-16</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0000277948</issuerCik>
        <issuerName>CSX CORP</issuerName>
        <issuerTradingSymbol>CSX</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001413084</rptOwnerCik>
            <rptOwnerName>Hilal Paul C</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>712 FIFTH AVENUE, SUITE 17F</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>NEW YORK</rptOwnerCity>
            <rptOwnerState>NY</rptOwnerState>
            <rptOwnerZipCode>10019</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle></officerTitle>
            <otherText></otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2022-02-16</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>4803</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>35.17</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>42000</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2022-02-16</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>J</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F3"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>197000</value>
                </transactionShares>
                <transactionPricePerShare>
                    <footnoteId id="F3"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>1595893</value>
                    <footnoteId id="F4"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See footnotes</value>
                    <footnoteId id="F5"/>
                    <footnoteId id="F6"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2022-02-16</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>G</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F7"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>43000</value>
                </transactionShares>
                <transactionPricePerShare>
                    <footnoteId id="F7"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>1552893</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See footnote</value>
                    <footnoteId id="F7"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <derivativeTable></derivativeTable>

    <footnotes>
        <footnote id="F1">Exempt payment of director's fees and/or annual retainer in the form of CSX Common Stock pursuant to the 2019 CSX Stock and Incentive Award Plan.</footnote>
        <footnote id="F2">On June 28, 2021, the common stock of CSX Corporation split 3-for-1, resulting in Paul C. Hilal's (&quot;Reporting Person&quot;) ownership of 24,798 additional shares.</footnote>
        <footnote id="F3">Reflects distributions by MR Employee Incentive Pool LLC, an entity controlled by Reporting Person and which holds shares of CSX Corporation on behalf of certain employees of Mantle Ridge LP, a Delaware limited partnership, to those employees. No consideration was paid in connection with these distributions.</footnote>
        <footnote id="F4">On June 28, 2021, the common stock of CSX Corporation split 3-for-1, resulting in Reporting Person's ownership of 1,195,262 additional shares</footnote>
        <footnote id="F5">By virtue of Reporting Person's position as ultimately controlling various entities that hold shares in CSX Corporation, Reporting Person may be deemed to be the beneficial owner of these shares for purposes of Rule 16a-1(a) under the Securities Exchange Act of 1934 (the &quot;Exchange Act&quot;). Reporting Person disclaims beneficial ownership of any of these shares, except to the extent of any pecuniary interest therein.</footnote>
        <footnote id="F6">Reporting Person continues to serve as a director and as Vice Chairman of the Board of CSX Corporation and as a result, the entities listed in these notes are directors by deputization for purposes of Section 16 of the Exchange Act.</footnote>
        <footnote id="F7">Reflects shares contributed by Reporting Person to certain charitable organizations.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Paul C. Hilal</signatureName>
        <signatureDate>2022-02-18</signatureDate>
    </ownerSignature>
</ownershipDocument>
