<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.24.1.u1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>227</ContextCount>
  <ElementCount>400</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>66</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>12</UnitCount>
  <MyReports>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>100000 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DocumentDocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>100010 - Statement - CONSOLIDATED BALANCE SHEETS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_StatementCONSOLIDATEDBALANCESHEETS</Role>
      <ShortName>CONSOLIDATED BALANCE SHEETS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>100030 - Statement - CONSOLIDATED BALANCE SHEETS (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_StatementCONSOLIDATEDBALANCESHEETSParenthetical</Role>
      <ShortName>CONSOLIDATED BALANCE SHEETS (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>100050 - Statement - CONSOLIDATED STATEMENTS OF OPERATIONS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_StatementCONSOLIDATEDSTATEMENTSOFOPERATIONS</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF OPERATIONS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>100060 - Statement - CONSOLIDATED STATEMENTS OF OPERATIONS (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_StatementCONSOLIDATEDSTATEMENTSOFOPERATIONSParenthetical</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF OPERATIONS (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>100070 - Statement - CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/StatementConsolidatedStatementsOfComprehensiveIncome</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>100080 - Statement - CONSOLIDATED STATEMENTS OF CHANGES IN SHAREHOLDERS' (DEFICIT)/EQUITY</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/StatementConsolidatedStatementsOfChangesInShareholdersDeficitequity</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF CHANGES IN SHAREHOLDERS' (DEFICIT)/EQUITY</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>100090 - Statement - CONSOLIDATED STATEMENTS OF CHANGES IN SHAREHOLDERS' (DEFICIT)/EQUITY (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/StatementConsolidatedStatementsOfChangesInShareholdersDeficitequityParenthetical</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF CHANGES IN SHAREHOLDERS' (DEFICIT)/EQUITY (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>100100 - Statement - CONSOLIDATED STATEMENTS OF CASHFLOWS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_StatementCONSOLIDATEDSTATEMENTSOFCASHFLOWS</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF CASHFLOWS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>100110 - Disclosure - Organization and Basis of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOrganizationAndBasisOfPresentation</Role>
      <ShortName>Organization and Basis of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>100120 - Disclosure - Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPolicies</Role>
      <ShortName>Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>100130 - Disclosure - Short-Term Investments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShortTermInvestments</Role>
      <ShortName>Short-Term Investments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>100140 - Disclosure - Prepaid Expenses and Other Current Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePrepaidExpensesAndOtherCurrentAssets</Role>
      <ShortName>Prepaid Expenses and Other Current Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>100150 - Disclosure - Deferred Costs</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureDeferredCosts</Role>
      <ShortName>Deferred Costs</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>100160 - Disclosure - Property and Equipment, Net</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePropertyAndEquipmentNet</Role>
      <ShortName>Property and Equipment, Net</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>100170 - Disclosure - Intangible Assets, Net</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIntangibleAssetsNet</Role>
      <ShortName>Intangible Assets, Net</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>100190 - Disclosure - Long-Term Investments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLongTermInvestments</Role>
      <ShortName>Long-Term Investments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>100200 - Disclosure - Other Non-Current Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOtherNonCurrentAssets</Role>
      <ShortName>Other Non-Current Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>100210 - Disclosure - Accrued Expenses and Other Current Liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureAccruedExpensesAndOtherCurrentLiabilities</Role>
      <ShortName>Accrued Expenses and Other Current Liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>100220 - Disclosure - Revenues and Deferred Revenue</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRevenuesAndDeferredRevenue</Role>
      <ShortName>Revenues and Deferred Revenue</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>100230 - Disclosure - Long-Term Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLongTermDebt</Role>
      <ShortName>Long-Term Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>100240 - Disclosure - Ordinary Shares</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOrdinaryShares</Role>
      <ShortName>Ordinary Shares</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>100250 - Disclosure - Fair Value Measurement</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFairValueMeasurement</Role>
      <ShortName>Fair Value Measurement</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>100260 - Disclosure - Disposal of Subsidiaries</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureDisposalOfSubsidiaries</Role>
      <ShortName>Disposal of Subsidiaries</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>24</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>100270 - Disclosure - Share Incentive Plan</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShareIncentivePlan</Role>
      <ShortName>Share Incentive Plan</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>25</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>100280 - Disclosure - Leases</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLeases</Role>
      <ShortName>Leases</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>26</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>100290 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>27</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>100300 - Disclosure - Net Income Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureNetIncomePerShare</Role>
      <ShortName>Net Income Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>100310 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureCommitmentsAndContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>100320 - Disclosure - Segment Reporting</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSegmentReporting</Role>
      <ShortName>Segment Reporting</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>100330 - Disclosure - Employee Defined Contribution Plan</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureEmployeeDefinedContributionPlan</Role>
      <ShortName>Employee Defined Contribution Plan</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>100340 - Disclosure - Restricted Net Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRestrictedNetAssets</Role>
      <ShortName>Restricted Net Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>100350 - Disclosure - Condensed Financial Information Of Parent Company</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureCondensedFinancialInformationOfParentCompany</Role>
      <ShortName>Condensed Financial Information Of Parent Company</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>100360 - Disclosure - Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPolicies</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>100370 - Disclosure - Organization and Basis of Presentation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOrganizationAndBasisOfPresentationTables</Role>
      <ShortName>Organization and Basis of Presentation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOrganizationAndBasisOfPresentation</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>100380 - Disclosure - Significant Accounting Policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPoliciesTables</Role>
      <ShortName>Significant Accounting Policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPolicies</ParentRole>
      <Position>36</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>100390 - Disclosure - Short-Term Investments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShortTermInvestmentsTables</Role>
      <ShortName>Short-Term Investments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShortTermInvestments</ParentRole>
      <Position>37</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>100400 - Disclosure - Prepaid Expenses and Other Current Assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePrepaidExpensesAndOtherCurrentAssetsTables</Role>
      <ShortName>Prepaid Expenses and Other Current Assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePrepaidExpensesAndOtherCurrentAssets</ParentRole>
      <Position>38</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>100410 - Disclosure - Deferred Costs (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureDeferredCostsTables</Role>
      <ShortName>Deferred Costs (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureDeferredCosts</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>100420 - Disclosure - Property and Equipment, Net (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePropertyAndEquipmentNetTables</Role>
      <ShortName>Property and Equipment, Net (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePropertyAndEquipmentNet</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>100430 - Disclosure - Intangible Assets, Net (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIntangibleAssetsNetTables</Role>
      <ShortName>Intangible Assets, Net (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIntangibleAssetsNet</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>100450 - Disclosure - Long-Term Investments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureLongtermInvestmentsTables</Role>
      <ShortName>Long-Term Investments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLongTermInvestments</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>100460 - Disclosure - Other Non-Current Assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOtherNonCurrentAssetsTables</Role>
      <ShortName>Other Non-Current Assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOtherNonCurrentAssets</ParentRole>
      <Position>43</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>100470 - Disclosure - Accrued Expenses and Other Current Liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureAccruedExpensesAndOtherCurrentLiabilitiesTables</Role>
      <ShortName>Accrued Expenses and Other Current Liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureAccruedExpensesAndOtherCurrentLiabilities</ParentRole>
      <Position>44</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>100480 - Disclosure - Revenues and Deferred Revenue (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRevenuesAndDeferredRevenueTables</Role>
      <ShortName>Revenues and Deferred Revenue (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRevenuesAndDeferredRevenue</ParentRole>
      <Position>45</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>100490 - Disclosure - Fair Value Measurement (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFairValueMeasurementTables</Role>
      <ShortName>Fair Value Measurement (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFairValueMeasurement</ParentRole>
      <Position>46</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>100500 - Disclosure - Share Incentive Plan (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShareIncentivePlanTables</Role>
      <ShortName>Share Incentive Plan (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShareIncentivePlan</ParentRole>
      <Position>47</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>100510 - Disclosure - Leases (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLeasesTables</Role>
      <ShortName>Leases (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLeases</ParentRole>
      <Position>48</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>100520 - Disclosure - Income Taxes (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIncomeTaxesTables</Role>
      <ShortName>Income Taxes (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIncomeTaxes</ParentRole>
      <Position>49</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>100530 - Disclosure - Net Income Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureNetIncomePerShareTables</Role>
      <ShortName>Net Income Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sunlands.com/20231231/taxonomy/role/DisclosureNetIncomePerShare</ParentRole>
      <Position>50</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>100540 - Disclosure - Organization and Basis of Presentation - Summary of Significant Subsidiaries VIEs and VIEs' Subsidiaries (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureOrganizationAndBasisOfPresentationSummaryOfSignificantSubsidiariesViesAndViesSubsidiariesDetails</Role>
      <ShortName>Organization and Basis of Presentation - Summary of Significant Subsidiaries VIEs and VIEs' Subsidiaries (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>100550 - Disclosure - Significant Accounting Policies - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPoliciesAdditionalInformationDetails</Role>
      <ShortName>Significant Accounting Policies - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>100560 - Disclosure - Significant Accounting Policies - Summary Financial Information of VIEs and their Subsidiaries (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPoliciesSummaryFinancialInformationOfViesAndTheirSubsidiariesDetails</Role>
      <ShortName>Significant Accounting Policies - Summary Financial Information of VIEs and their Subsidiaries (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>100570 - Disclosure - Significant Accounting Policies - Summary of Estimated Useful Lives of Property and Equipment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPoliciesSummaryOfEstimatedUsefulLivesOfPropertyAndEquipmentDetails</Role>
      <ShortName>Significant Accounting Policies - Summary of Estimated Useful Lives of Property and Equipment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>100580 - Disclosure - Significant Accounting Policies - Summary of Estimated Useful Lives of Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSignificantAccountingPoliciesSummaryOfEstimatedUsefulLivesOfIntangibleAssetsDetails</Role>
      <ShortName>Significant Accounting Policies - Summary of Estimated Useful Lives of Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>100590 - Disclosure - Short-Term Investments - Schedule of Short-Term Investment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShortTermInvestmentsScheduleOfShortTermInvestmentDetails</Role>
      <ShortName>Short-Term Investments - Schedule of Short-Term Investment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>100610 - Disclosure - Prepaid Expenses and Other Current Assets - Summary of Prepaid Expenses and Other Current Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePrepaidExpensesAndOtherCurrentAssetsSummaryOfPrepaidExpensesAndOtherCurrentAssetsDetails</Role>
      <ShortName>Prepaid Expenses and Other Current Assets - Summary of Prepaid Expenses and Other Current Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>100620 - Disclosure - Deferred Costs - Schedule of Movements of Deferred Costs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureDeferredCostsScheduleOfMovementsOfDeferredCostsDetails</Role>
      <ShortName>Deferred Costs - Schedule of Movements of Deferred Costs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>100630 - Disclosure - Property and Equipment, Net - Summary of Property and Equipment Consisted (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePropertyAndEquipmentNetSummaryOfPropertyAndEquipmentConsistedDetails</Role>
      <ShortName>Property and Equipment, Net - Summary of Property and Equipment Consisted (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>100640 - Disclosure - Property and Equipment, Net - Summary of Property and Equipment Consisted (Parenthetical) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePropertyAndEquipmentNetSummaryOfPropertyAndEquipmentConsistedParentheticalDetails</Role>
      <ShortName>Property and Equipment, Net - Summary of Property and Equipment Consisted (Parenthetical) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>100650 - Disclosure - Property and Equipment, Net - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosurePropertyAndEquipmentNetAdditionalInformationDetails</Role>
      <ShortName>Property and Equipment, Net - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>100660 - Disclosure - Intangible Assets, Net - Summary of Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIntangibleAssetsNetSummaryOfIntangibleAssetsDetails</Role>
      <ShortName>Intangible Assets, Net - Summary of Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>100670 - Disclosure - Intangible Assets, Net - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIntangibleAssetsNetAdditionalInformationDetails</Role>
      <ShortName>Intangible Assets, Net - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>100680 - Disclosure - Intangible Assets, Net - Summary of Amortization Expenses of Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIntangibleAssetsNetSummaryOfAmortizationExpensesOfIntangibleAssetsDetails</Role>
      <ShortName>Intangible Assets, Net - Summary of Amortization Expenses of Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>100710 - Disclosure - Long-Term Investments - Schedule of Long-Term Investments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureLongtermInvestmentsScheduleOfLongtermInvestmentsDetails</Role>
      <ShortName>Long-Term Investments - Schedule of Long-Term Investments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>100720 - Disclosure - Long-Term Investments - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureLongtermInvestmentsAdditionalInformationDetails</Role>
      <ShortName>Long-Term Investments - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>100730 - Disclosure - Other Non-Current Assets - Summary of Other Non-Current Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOtherNonCurrentAssetsSummaryOfOtherNonCurrentAssetsDetails</Role>
      <ShortName>Other Non-Current Assets - Summary of Other Non-Current Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>100740 - Disclosure - Accrued Expenses and Other Current Liabilities - Summary of Accrued Expenses and Other Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureAccruedExpensesAndOtherCurrentLiabilitiesSummaryOfAccruedExpensesAndOtherLiabilitiesDetails</Role>
      <ShortName>Accrued Expenses and Other Current Liabilities - Summary of Accrued Expenses and Other Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>68</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>100750 - Disclosure - Revenues and Deferred Revenue - Schedule of Disaggregated Revenues (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRevenuesAndDeferredRevenueScheduleOfDisaggregatedRevenuesDetails</Role>
      <ShortName>Revenues and Deferred Revenue - Schedule of Disaggregated Revenues (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>69</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>100760 - Disclosure - Revenues and Deferred Revenue - Schedule of Movement of the Deferred Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRevenuesAndDeferredRevenueScheduleOfMovementOfDeferredRevenueDetails</Role>
      <ShortName>Revenues and Deferred Revenue - Schedule of Movement of the Deferred Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>70</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>100770 - Disclosure - Revenues and Deferred Revenue - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRevenuesAndDeferredRevenueAdditionalInformationDetails</Role>
      <ShortName>Revenues and Deferred Revenue - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>71</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>100780 - Disclosure - Revenues and Deferred Revenue - Additional Information (Details1)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRevenuesAndDeferredRevenueAdditionalInformationDetails1</Role>
      <ShortName>Revenues and Deferred Revenue - Additional Information (Details1)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>72</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>100790 - Disclosure - Long-Term Debt - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLongTermDebtAdditionalInformationDetails</Role>
      <ShortName>Long-Term Debt - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>73</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R74.htm</HtmlFileName>
      <LongName>100800 - Disclosure - Ordinary Shares - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureOrdinarySharesAdditionalInformationDetails</Role>
      <ShortName>Ordinary Shares - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>74</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R75.htm</HtmlFileName>
      <LongName>100810 - Disclosure - Fair Value Measurement - Schedule of Assets Measured at Fair Value on Recurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFairValueMeasurementScheduleOfAssetsMeasuredAtFairValueOnRecurringBasisDetails</Role>
      <ShortName>Fair Value Measurement - Schedule of Assets Measured at Fair Value on Recurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>75</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R76.htm</HtmlFileName>
      <LongName>100820 - Disclosure - Disposal of Subsidiaries - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureDisposalOfSubsidiariesAdditionalInformationDetails</Role>
      <ShortName>Disposal of Subsidiaries - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>76</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R77.htm</HtmlFileName>
      <LongName>100830 - Disclosure - Share Incentive Plan - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShareIncentivePlanAdditionalInformationDetails</Role>
      <ShortName>Share Incentive Plan - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>77</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R78.htm</HtmlFileName>
      <LongName>100840 - Disclosure - Share Incentive Plan - Summary of Option Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureShareIncentivePlanSummaryOfOptionActivityDetails</Role>
      <ShortName>Share Incentive Plan - Summary of Option Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>78</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R79.htm</HtmlFileName>
      <LongName>100870 - Disclosure - Share Incentive Plan - Schedule of Share-based Compensation Expense Recognized (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureShareIncentivePlanScheduleOfShareBasedCompensationExpenseRecognizedDetails</Role>
      <ShortName>Share Incentive Plan - Schedule of Share-based Compensation Expense Recognized (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>79</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R80.htm</HtmlFileName>
      <LongName>100880 - Disclosure - Leases - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLeasesAdditionalInformationDetails</Role>
      <ShortName>Leases - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>80</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R81.htm</HtmlFileName>
      <LongName>100900 - Disclosure - Leases - Summary of Operating Leases (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLeasesSummaryOfOperatingLeasesDetails</Role>
      <ShortName>Leases - Summary of Operating Leases (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>81</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R82.htm</HtmlFileName>
      <LongName>100910 - Disclosure - Leases - Summary of Maturity Analysis of Annual Undiscounted Cash Flows for Lease Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureLeasesSummaryOfMaturityAnalysisOfAnnualUndiscountedCashFlowsForLeaseLiabilitiesDetails</Role>
      <ShortName>Leases - Summary of Maturity Analysis of Annual Undiscounted Cash Flows for Lease Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>82</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R83.htm</HtmlFileName>
      <LongName>100920 - Disclosure - Income Taxes - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIncomeTaxesAdditionalInformationDetails</Role>
      <ShortName>Income Taxes - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>83</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R84.htm</HtmlFileName>
      <LongName>100930 - Disclosure - Income Taxes - Schedule of Reconciliation of Effective Tax Rate and Statutory Income Tax Rate Applicable to PRC Operations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIncomeTaxesScheduleOfReconciliationOfEffectiveTaxRateAndStatutoryIncomeTaxRateApplicableToPRCOperationsDetails</Role>
      <ShortName>Income Taxes - Schedule of Reconciliation of Effective Tax Rate and Statutory Income Tax Rate Applicable to PRC Operations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>84</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R85.htm</HtmlFileName>
      <LongName>100940 - Disclosure - Income Taxes - Schedule of Reconciliation of Effective Tax Rate and Statutory Income Tax Rate Applicable to PRC Operations (Parenthetical) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIncomeTaxesScheduleOfReconciliationOfEffectiveTaxRateAndStatutoryIncomeTaxRateApplicableToPRCOperationsParentheticalDetails</Role>
      <ShortName>Income Taxes - Schedule of Reconciliation of Effective Tax Rate and Statutory Income Tax Rate Applicable to PRC Operations (Parenthetical) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>85</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R86.htm</HtmlFileName>
      <LongName>100950 - Disclosure - Income Taxes - Schedule of Components of Deferred Income Tax (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureIncomeTaxesScheduleOfComponentsOfDeferredIncomeTaxDetails</Role>
      <ShortName>Income Taxes - Schedule of Components of Deferred Income Tax (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>86</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R87.htm</HtmlFileName>
      <LongName>100960 - Disclosure - Net Income Per Share - Schedule of Calculation of Net Loss Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureNetIncomePerShareScheduleOfCalculationOfNetLossPerShareDetails</Role>
      <ShortName>Net Income Per Share - Schedule of Calculation of Net Loss Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>87</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R88.htm</HtmlFileName>
      <LongName>100970 - Disclosure - Net Income Per Share - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/DisclosureNetIncomePerShareAdditionalInformationDetails</Role>
      <ShortName>Net Income Per Share - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>88</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R89.htm</HtmlFileName>
      <LongName>100980 - Disclosure - Segment Reporting - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureSegmentReportingAdditionalInformationDetails</Role>
      <ShortName>Segment Reporting - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>89</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R90.htm</HtmlFileName>
      <LongName>100990 - Disclosure - Employee Defined Contribution Plan - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureEmployeeDefinedContributionPlanAdditionalInformationDetails</Role>
      <ShortName>Employee Defined Contribution Plan - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>90</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R91.htm</HtmlFileName>
      <LongName>101000 - Disclosure - Restricted Net Assets - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureRestrictedNetAssetsAdditionalInformationDetails</Role>
      <ShortName>Restricted Net Assets - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>91</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R92.htm</HtmlFileName>
      <LongName>101010 - Disclosure - Financial Statement Schedule I - Condensed Financial Information of Parent Company Balance Sheets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFinancialStatementScheduleICondensedFinancialInformationOfParentCompanyBalanceSheetsDetails</Role>
      <ShortName>Financial Statement Schedule I - Condensed Financial Information of Parent Company Balance Sheets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>92</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R93.htm</HtmlFileName>
      <LongName>101020 - Disclosure - Financial Statement Schedule I - Condensed Financial Information of Parent Company Balance Sheets (Parenthetical) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFinancialStatementScheduleICondensedFinancialInformationOfParentCompanyBalanceSheetsParentheticalDetails</Role>
      <ShortName>Financial Statement Schedule I - Condensed Financial Information of Parent Company Balance Sheets (Parenthetical) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>93</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R94.htm</HtmlFileName>
      <LongName>101030 - Disclosure - Financial Statement Schedule I - Condensed Financial Information of Parent Company Statements of Operations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFinancialStatementScheduleICondensedFinancialInformationOfParentCompanyStatementsOfOperationsDetails</Role>
      <ShortName>Financial Statement Schedule I - Condensed Financial Information of Parent Company Statements of Operations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>94</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R95.htm</HtmlFileName>
      <LongName>101040 - Disclosure - Financial Statement Schedule I - Condensed Financial Information of Parent Company Consolidated Statements of Comprehensive (Loss) / Income (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFinancialStatementScheduleICondensedFinancialInformationOfParentCompanyConsolidatedStatementsOfComprehensiveLossIncomeDetails</Role>
      <ShortName>Financial Statement Schedule I - Condensed Financial Information of Parent Company Consolidated Statements of Comprehensive (Loss) / Income (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>95</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R96.htm</HtmlFileName>
      <LongName>101050 - Disclosure - Financial Statement Schedule I - Condensed Financial Information of Parent Company Statements of Cash Flows (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFinancialStatementScheduleICondensedFinancialInformationOfParentCompanyStatementsOfCashFlowsDetails</Role>
      <ShortName>Financial Statement Schedule I - Condensed Financial Information of Parent Company Statements of Cash Flows (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>96</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R97.htm</HtmlFileName>
      <LongName>101060 - Disclosure - Financial Statement Schedule I - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sunlands.com/20231231/taxonomy/role/Role_DisclosureFinancialStatementScheduleIAdditionalInformationDetails</Role>
      <ShortName>Financial Statement Schedule I - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>97</Position>
    </Report>
    <Report instance="stg-20231231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9999.htm</HtmlFileName>
      <LongName>Uncategorized Items - stg-20231231.htm</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/role/uncategorizedFacts</Role>
      <ShortName>Uncategorized Items - stg-20231231.htm</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>98</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <Logs>
    <Log type="Warning">[ix-0514-Hidden-Fact-Eligible-For-Transform] WARN: 6 fact(s) appearing in ix:hidden were eligible for transformation: dei:EntityIncorporationStateCountryCode, stg:TimeForFullRefundOfTransactionPrice -  stg-20231231.htm 8</Log>
    <Log type="Warning">[DQC.US.0076.7653] The filer has reported a value for us-gaap:RevenueRemainingPerformanceObligation with a value of 494244000.000000 using the dimension member 2026-01-01 The filer has not reported a duration value for the corresponding elements of RevenueRemainingPerformanceObligationExpectedTimingOfSatisfactionPeriod1.

The properties of this us-gaap:RevenueRemainingPerformanceObligation fact are:
Context: C_a30ce81b-eee2-4192-9fbf-c13351c884ee
Unit: U_CNY. - stg-20231231.htm 14601 - stg-20231231.htm 14601</Log>
  </Logs>
  <InputFiles>
    <File doctype="20-F" isDefinitelyFs="true" isUsgaap="true" original="stg-20231231.htm">stg-20231231.htm</File>
    <File>stg-20231231.xsd</File>
  </InputFiles>
  <SupplementalFiles>
    <File>img56636805_0.jpg</File>
    <File>img56636805_1.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="1125">http://fasb.org/us-gaap/2023</BaseTaxonomy>
    <BaseTaxonomy items="63">http://xbrl.sec.gov/dei/2023</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>false</HasPresentationLinkbase>
  <HasCalculationLinkbase>false</HasCalculationLinkbase>
</FilingSummary>
