<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.23.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>181</ContextCount>
  <ElementCount>216</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>67</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>14</UnitCount>
  <MyReports>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>0000002 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>0000003 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>0000004 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>0000005 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>0000006 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>0000007 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>0000008 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>0000009 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>0000010 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>0000011 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>0000012 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>0000013 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>0000014 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>0000015 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>0000016 - 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-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>0000017 - 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>17</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>0000018 - 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>18</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>0000019 - 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>19</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>0000020 - 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>20</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>0000021 - 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>21</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>0000022 - 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>22</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>0000023 - 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>23</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>0000024 - 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>24</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>0000025 - 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>25</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>0000026 - 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>26</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>0000027 - 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>27</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>0000028 - Disclosure - Nature of Operations and Significant Accounting Policies - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/NatureofOperationsandSignificantAccountingPoliciesNarrativeDetails</Role>
      <ShortName>Nature of Operations and Significant Accounting Policies - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.csx.com/role/NatureofOperationsandSignificantAccountingPoliciesPolicies</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>0000029 - 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>29</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>0000030 - 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>30</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>0000031 - 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>31</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>0000032 - 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>32</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>0000033 - 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>33</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>0000034 - Disclosure - Stock Plans and Share-Based Compensation - Awards Granted Under Long-Term Incentive Plan (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/StockPlansandShareBasedCompensationAwardsGrantedUnderLongTermIncentivePlanDetails</Role>
      <ShortName>Stock Plans and Share-Based Compensation - Awards Granted Under Long-Term Incentive Plan (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>0000035 - 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>35</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>0000036 - 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>36</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>0000037 - 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>37</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>0000038 - 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>38</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>0000039 - 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>39</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>0000040 - 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>40</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>0000041 - 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>41</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>0000042 - 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>42</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>0000043 - Disclosure - Debt and Credit Agreements - Schedule of Interest Rate Derivatives (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/DebtandCreditAgreementsScheduleofInterestRateDerivativesDetails</Role>
      <ShortName>Debt and Credit Agreements - Schedule of Interest Rate Derivatives (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>0000044 - 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>44</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>0000045 - Disclosure - Revenues - Accounts Receivable, Net (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.csx.com/role/RevenuesAccountsReceivableNetDetails</Role>
      <ShortName>Revenues - Accounts Receivable, Net (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>0000046 - 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>46</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>0000047 - 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>47</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>0000048 - 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>48</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>0000049 - 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>49</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>0000050 - 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>50</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>0000051 - 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>51</Position>
    </Report>
    <Report instance="csx-20230331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>0000052 - 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>52</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-20230331.htm">csx-20230331.htm</File>
    <File>csx-20230331.xsd</File>
    <File>csx-20230331_cal.xml</File>
    <File>csx-20230331_def.xml</File>
    <File>csx-20230331_lab.xml</File>
    <File>csx-20230331_pre.xml</File>
    <File>csx033123ex102formofltippe.htm</File>
    <File>csx033123ex103jrhformoflti.htm</File>
    <File>csx033123ex104formofltipst.htm</File>
    <File>csx033123ex105jrhformoflti.htm</File>
    <File>csx033123ex106formofltipre.htm</File>
    <File>csx033123ex107jrhformoflti.htm</File>
    <File>csx033123ex31.htm</File>
    <File>csx033123ex32.htm</File>
  </InputFiles>
  <SupplementalFiles>
    <File>csx-20230331_g1.jpg</File>
    <File>csx-20230331_g2.jpg</File>
    <File>csx-20230331_g3.jpg</File>
    <File>csx-20230331_g4.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="494">http://fasb.org/us-gaap/2022</BaseTaxonomy>
    <BaseTaxonomy items="30">http://xbrl.sec.gov/dei/2022</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
