<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.21.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>154</ContextCount>
  <ElementCount>297</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>65</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>13</UnitCount>
  <MyReports>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0001001 - Document - Cover</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/Cover</Role>
      <ShortName>Cover</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001002 - Statement - CONSOLIDATED INCOME STATEMENTS (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CONSOLIDATEDINCOMESTATEMENTSUnaudited</Role>
      <ShortName>CONSOLIDATED INCOME STATEMENTS (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1002003 - Statement - CONDENSED CONSOLIDATED COMPREHENSIVE INCOME STATEMENTS (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CONDENSEDCONSOLIDATEDCOMPREHENSIVEINCOMESTATEMENTSUnaudited</Role>
      <ShortName>CONDENSED CONSOLIDATED COMPREHENSIVE INCOME STATEMENTS (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1003004 - Statement - CONSOLIDATED BALANCE SHEETS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CONSOLIDATEDBALANCESHEETS</Role>
      <ShortName>CONSOLIDATED BALANCE SHEETS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1004005 - Statement - CONSOLIDATED BALANCE SHEETS (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CONSOLIDATEDBALANCESHEETSParenthetical</Role>
      <ShortName>CONSOLIDATED BALANCE SHEETS (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1005006 - Statement - CONSOLIDATED CASH FLOW STATEMENTS (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CONSOLIDATEDCASHFLOWSTATEMENTSUnaudited</Role>
      <ShortName>CONSOLIDATED CASH FLOW STATEMENTS (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1006007 - Statement - CONSOLIDATED STATEMENTS OF CHANGES IN SHAREHOLDERS' EQUITY (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CONSOLIDATEDSTATEMENTSOFCHANGESINSHAREHOLDERSEQUITYUnaudited</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF CHANGES IN SHAREHOLDERS' EQUITY (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>1007008 - Statement - CONSOLIDATED STATEMENTS OF CHANGES IN SHAREHOLDERS' EQUITY (Unaudited) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CONSOLIDATEDSTATEMENTSOFCHANGESINSHAREHOLDERSEQUITYUnauditedParenthetical</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF CHANGES IN SHAREHOLDERS' EQUITY (Unaudited) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>2101101 - Disclosure - Nature of Operations and Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/NatureofOperationsandSignificantAccountingPolicies</Role>
      <ShortName>Nature of Operations and Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>2104102 - Disclosure - Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EarningsPerShare</Role>
      <ShortName>Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2110103 - Disclosure - Stock Plans and Share-Based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/StockPlansandShareBasedCompensation</Role>
      <ShortName>Stock Plans and Share-Based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2117104 - Disclosure - Casualty, Environmental and Other Reserves</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CasualtyEnvironmentalandOtherReserves</Role>
      <ShortName>Casualty, Environmental and Other Reserves</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2121105 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CommitmentsandContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2123106 - Disclosure - Employee Benefit Plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EmployeeBenefitPlans</Role>
      <ShortName>Employee Benefit Plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2127107 - Disclosure - Debt and Credit Agreements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/DebtandCreditAgreements</Role>
      <ShortName>Debt and Credit Agreements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2131108 - Disclosure - Revenues</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/Revenues</Role>
      <ShortName>Revenues</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2136109 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/IncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>2137110 - Disclosure - Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/FairValueMeasurements</Role>
      <ShortName>Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2143111 - Disclosure - Other Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/OtherComprehensiveIncomeLoss</Role>
      <ShortName>Other Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2147112 - Disclosure - Subsequent Event</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/SubsequentEvent</Role>
      <ShortName>Subsequent Event</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2202201 - Disclosure - Nature of Operations and Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/NatureofOperationsandSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Nature of Operations and Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.csx.com/role/NatureofOperationsandSignificantAccountingPolicies</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2305301 - Disclosure - Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EarningsPerShareTables</Role>
      <ShortName>Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.csx.com/role/EarningsPerShare</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2311302 - Disclosure - Stock Plans and Share-Based Compensation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/StockPlansandShareBasedCompensationTables</Role>
      <ShortName>Stock Plans and Share-Based Compensation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.csx.com/role/StockPlansandShareBasedCompensation</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2318303 - Disclosure - Casualty, Environmental and Other Reserves (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CasualtyEnvironmentalandOtherReservesTables</Role>
      <ShortName>Casualty, Environmental and Other Reserves (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.csx.com/role/CasualtyEnvironmentalandOtherReserves</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2324304 - Disclosure - Employee Benefit Plans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EmployeeBenefitPlansTables</Role>
      <ShortName>Employee Benefit Plans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.csx.com/role/EmployeeBenefitPlans</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2328305 - Disclosure - Debt and Credit Agreements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/DebtandCreditAgreementsTables</Role>
      <ShortName>Debt and Credit Agreements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.csx.com/role/DebtandCreditAgreements</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2332306 - Disclosure - Revenues (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/RevenuesTables</Role>
      <ShortName>Revenues (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.csx.com/role/Revenues</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2338307 - Disclosure - Fair Value Measurements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/FairValueMeasurementsTables</Role>
      <ShortName>Fair Value Measurements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.csx.com/role/FairValueMeasurements</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2344308 - Disclosure - Other Comprehensive Income (Loss) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/OtherComprehensiveIncomeLossTables</Role>
      <ShortName>Other Comprehensive Income (Loss) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.csx.com/role/OtherComprehensiveIncomeLoss</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2403401 - Disclosure - Nature of Operations and Significant Accounting Policies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/NatureofOperationsandSignificantAccountingPoliciesDetails</Role>
      <ShortName>Nature of Operations and Significant Accounting Policies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.csx.com/role/NatureofOperationsandSignificantAccountingPoliciesPolicies</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2406402 - Disclosure - Earnings Per Share - Computation of Basic Earnings Per Share, Assuming Dilution (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EarningsPerShareComputationofBasicEarningsPerShareAssumingDilutionDetails</Role>
      <ShortName>Earnings Per Share - Computation of Basic Earnings Per Share, Assuming Dilution (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2407403 - Disclosure - Earnings Per Share - Antidilutive Stock Options Excluded from Diluted Earnings Per Share Calculation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EarningsPerShareAntidilutiveStockOptionsExcludedfromDilutedEarningsPerShareCalculationDetails</Role>
      <ShortName>Earnings Per Share - Antidilutive Stock Options Excluded from Diluted Earnings Per Share Calculation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2408404 - Disclosure - Earnings Per Share - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EarningsPerShareNarrativeDetails</Role>
      <ShortName>Earnings Per Share - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2409405 - Disclosure - Earnings Per Share - Share Repurchases (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EarningsPerShareShareRepurchasesDetails</Role>
      <ShortName>Earnings Per Share - Share Repurchases (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2412406 - Disclosure - Stock Plans and Share-Based Compensation - Pre-tax Expense and Income Tax Benefits (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/StockPlansandShareBasedCompensationPretaxExpenseandIncomeTaxBenefitsDetails</Role>
      <ShortName>Stock Plans and Share-Based Compensation - Pre-tax Expense and Income Tax Benefits (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2413407 - Disclosure - Stock Plans and Share-Based Compensation - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/StockPlansandShareBasedCompensationNarrativeDetails</Role>
      <ShortName>Stock Plans and Share-Based Compensation - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2414408 - Disclosure - Stock Plans and Share-Based Compensation - Weighted Average Assumptions Used for Performance Units (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/StockPlansandShareBasedCompensationWeightedAverageAssumptionsUsedforPerformanceUnitsDetails</Role>
      <ShortName>Stock Plans and Share-Based Compensation - Weighted Average Assumptions Used for Performance Units (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2415409 - Disclosure - Stock Plans and Share-Based Compensation - Fair Value Assumptions Used for Stock Options (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/StockPlansandShareBasedCompensationFairValueAssumptionsUsedforStockOptionsDetails</Role>
      <ShortName>Stock Plans and Share-Based Compensation - Fair Value Assumptions Used for Stock Options (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2416410 - Disclosure - Stock Plans and Share-Based Compensation - Shares Issued Under Employee Stock Purchase Plan (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/StockPlansandShareBasedCompensationSharesIssuedUnderEmployeeStockPurchasePlanDetails</Role>
      <ShortName>Stock Plans and Share-Based Compensation - Shares Issued Under Employee Stock Purchase Plan (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2419411 - Disclosure - Casualty, Environmental and Other Reserves - Schedule of Casualty, Environmental and Other Reserves (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CasualtyEnvironmentalandOtherReservesScheduleofCasualtyEnvironmentalandOtherReservesDetails</Role>
      <ShortName>Casualty, Environmental and Other Reserves - Schedule of Casualty, Environmental and Other Reserves (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2420412 - Disclosure - Casualty, Environmental and Other Reserves - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CasualtyEnvironmentalandOtherReservesNarrativeDetails</Role>
      <ShortName>Casualty, Environmental and Other Reserves - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>2422413 - Disclosure - Commitments and Contingencies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/CommitmentsandContingenciesDetails</Role>
      <ShortName>Commitments and Contingencies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.csx.com/role/CommitmentsandContingencies</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>2425414 - Disclosure - Employee Benefit Plans - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EmployeeBenefitPlansNarrativeDetails</Role>
      <ShortName>Employee Benefit Plans - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>2426415 - Disclosure - Employee Benefit Plans - Components of Net Periodic Benefit Costs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/EmployeeBenefitPlansComponentsofNetPeriodicBenefitCostsDetails</Role>
      <ShortName>Employee Benefit Plans - Components of Net Periodic Benefit Costs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>2429416 - Disclosure - Debt and Credit Agreements - Activity Related to Long-Term Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/DebtandCreditAgreementsActivityRelatedtoLongTermDebtDetails</Role>
      <ShortName>Debt and Credit Agreements - Activity Related to Long-Term Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>2430417 - Disclosure - Debt and Credit Agreements - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/DebtandCreditAgreementsNarrativeDetails</Role>
      <ShortName>Debt and Credit Agreements - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>2433418 - Disclosure - Revenues - Revenues Disaggregated by Lines of Business (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/RevenuesRevenuesDisaggregatedbyLinesofBusinessDetails</Role>
      <ShortName>Revenues - Revenues Disaggregated by Lines of Business (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>2434419 - Disclosure - Revenues - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/RevenuesNarrativeDetails</Role>
      <ShortName>Revenues - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>2435420 - Disclosure - Revenues - Accounts Receivable (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/RevenuesAccountsReceivableDetails</Role>
      <ShortName>Revenues - Accounts Receivable (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>2439421 - Disclosure - Fair Value Measurements - Fair Value of Investment Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/FairValueMeasurementsFairValueofInvestmentAssetsDetails</Role>
      <ShortName>Fair Value Measurements - Fair Value of Investment Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>2440422 - Disclosure - Fair Value Measurements - Investment Maturities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/FairValueMeasurementsInvestmentMaturitiesDetails</Role>
      <ShortName>Fair Value Measurements - Investment Maturities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>2441423 - Disclosure - Fair Value Measurements - Fair Value and Carrying Value of Long-Term Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/FairValueMeasurementsFairValueandCarryingValueofLongTermDebtDetails</Role>
      <ShortName>Fair Value Measurements - Fair Value and Carrying Value of Long-Term Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>2442424 - Disclosure - Fair Value Measurements - Interest Rate Derivatives (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/FairValueMeasurementsInterestRateDerivativesDetails</Role>
      <ShortName>Fair Value Measurements - Interest Rate Derivatives (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>2445425 - Disclosure - Other Comprehensive Income (Loss) - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/OtherComprehensiveIncomeLossNarrativeDetails</Role>
      <ShortName>Other Comprehensive Income (Loss) - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.csx.com/role/OtherComprehensiveIncomeLossTables</ParentRole>
      <Position>54</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>2446426 - Disclosure - Other Comprehensive Income (Loss) - Changes in AOCI Balance by Component (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/OtherComprehensiveIncomeLossChangesinAOCIBalancebyComponentDetails</Role>
      <ShortName>Other Comprehensive Income (Loss) - Changes in AOCI Balance by Component (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.csx.com/role/OtherComprehensiveIncomeLossTables</ParentRole>
      <Position>55</Position>
    </Report>
    <Report instance="csx-20210331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>2448427 - Disclosure - Subsequent Event (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/SubsequentEventDetails</Role>
      <ShortName>Subsequent Event (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.csx.com/role/SubsequentEvent</ParentRole>
      <Position>56</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" original="csx-20210331.htm">csx-20210331.htm</File>
    <File>csx-20210331.xsd</File>
    <File>csx-20210331_cal.xml</File>
    <File>csx-20210331_def.xml</File>
    <File>csx-20210331_lab.xml</File>
    <File>csx-20210331_pre.xml</File>
    <File>csx033121ex31.htm</File>
    <File>csx033121ex32.htm</File>
  </InputFiles>
  <SupplementalFiles>
    <File>csx-20210331_g1.jpg</File>
    <File>csx-20210331_g2.jpg</File>
    <File>csx-20210331_g3.jpg</File>
    <File>csx-20210331_g4.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy>http://fasb.org/us-gaap/2020-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/srt/2020-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2020-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
