<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.22.2</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>221</ContextCount>
  <ElementCount>246</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>53</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>5</UnitCount>
  <MyReports>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>100000 - Document - Document and Entity Information Document</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DocumentDocumentAndEntityInformationDocument</Role>
      <ShortName>Document and Entity Information Document</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>100010 - Statement - Condensed Consolidated Statements of Operations (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/StatementCondensedConsolidatedStatementsOfOperationsUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Operations (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>100020 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/StatementCONDENSEDCONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOMEUnaudited</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>100030 - Statement - Condensed Consolidated Balance Sheets (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/StatementCondensedConsolidatedBalanceSheetsUnaudited</Role>
      <ShortName>Condensed Consolidated Balance Sheets (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>100040 - Statement - Condensed Consolidated Balance Sheets (Parenthetical) (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/StatementCondensedConsolidatedBalanceSheetsParentheticalUnaudited</Role>
      <ShortName>Condensed Consolidated Balance Sheets (Parenthetical) (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>100050 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/StatementCONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWSUnaudited</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>100060 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF STOCKHOLDERS' EQUITY (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/StatementCONDENSEDCONSOLIDATEDSTATEMENTSOFSTOCKHOLDERSEQUITYUnaudited</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF STOCKHOLDERS' EQUITY (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>100070 - Disclosure - Basis of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBasisOfPresentation</Role>
      <ShortName>Basis of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>100080 - Disclosure - Business Combination</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBusinessCombination</Role>
      <ShortName>Business Combination</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>100090 - Disclosure - Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureFairValueMeasurements</Role>
      <ShortName>Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>100100 - Disclosure - Marketable Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureMarketableSecurities</Role>
      <ShortName>Marketable Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>100110 - Disclosure - Derivative Instruments and Hedging Activities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureDerivativeInstrumentsAndHedgingActivities</Role>
      <ShortName>Derivative Instruments and Hedging Activities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>100120 - Disclosure - Purchased Intangible Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosurePurchasedIntangibleAssets</Role>
      <ShortName>Purchased Intangible Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>100130 - Disclosure - Balance Sheet Details</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetails</Role>
      <ShortName>Balance Sheet Details</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>100140 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureCommitmentsAndContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>100150 - Disclosure - Revenue</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureRevenue</Role>
      <ShortName>Revenue</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>100160 - Disclosure - Share-Based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureShareBasedCompensation</Role>
      <ShortName>Share-Based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>100170 - Disclosure - Other Expense, Net</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureOtherExpenseNet</Role>
      <ShortName>Other Expense, Net</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>100180 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureIncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>100190 - Disclosure - Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureEarningsPerShare</Role>
      <ShortName>Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>100200 - Disclosure - Accumulated Other Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureAccumulatedOtherComprehensiveIncomeLoss</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>100210 - Disclosure - Segment Reporting and Geographic Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureSegmentReportingAndGeographicInformation</Role>
      <ShortName>Segment Reporting and Geographic Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>100220 - Disclosure - Share Repurchase Authorization</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureShareRepurchaseAuthorization</Role>
      <ShortName>Share Repurchase Authorization</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>100230 - Disclosure - Basis of Presentation (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBasisOfPresentationPolicies</Role>
      <ShortName>Basis of Presentation (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>24</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>100240 - Disclosure - Fair Value Measurements - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureFairValueMeasurementsTables</Role>
      <ShortName>Fair Value Measurements - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureFairValueMeasurements</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>100250 - Disclosure - Marketable Securities - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureMarketableSecuritiesTables</Role>
      <ShortName>Marketable Securities - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureMarketableSecurities</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>100260 - Disclosure - Derivative Instruments and Hedging Activities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureDerivativeInstrumentsAndHedgingActivitiesTables</Role>
      <ShortName>Derivative Instruments and Hedging Activities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureDerivativeInstrumentsAndHedgingActivities</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>100270 - Disclosure - Purchased Intangible Assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosurePurchasedIntangibleAssetsTables</Role>
      <ShortName>Purchased Intangible Assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosurePurchasedIntangibleAssets</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>100280 - Disclosure - Balance Sheet Details (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetailsTables</Role>
      <ShortName>Balance Sheet Details (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetails</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>100290 - Disclosure - Commitments and Contingencies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureCommitmentsAndContingenciesTables</Role>
      <ShortName>Commitments and Contingencies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureCommitmentsAndContingencies</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>100300 - Disclosure - Revenue (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureRevenueTables</Role>
      <ShortName>Revenue (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureRevenue</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>100310 - Disclosure - Share-Based Compensation - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureShareBasedCompensationTables</Role>
      <ShortName>Share-Based Compensation - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureShareBasedCompensation</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>100320 - Disclosure - Other Expense, Net (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureOtherExpenseNetTables</Role>
      <ShortName>Other Expense, Net (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureOtherExpenseNet</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>100330 - Disclosure - Income Taxes - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureIncomeTaxesTables</Role>
      <ShortName>Income Taxes - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureIncomeTaxes</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>100340 - Disclosure - Earnings Per Share  (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureEarningsPerShareTables</Role>
      <ShortName>Earnings Per Share  (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureEarningsPerShare</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>100350 - Disclosure - Accumulated Other Comprehensive Income (Loss) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureAccumulatedOtherComprehensiveIncomeLossTables</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureAccumulatedOtherComprehensiveIncomeLoss</ParentRole>
      <Position>36</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>100360 - Disclosure - Segment Reporting and Geographic Information - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureSegmentReportingAndGeographicInformationTables</Role>
      <ShortName>Segment Reporting and Geographic Information - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureSegmentReportingAndGeographicInformation</ParentRole>
      <Position>37</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>100370 - Disclosure - Business Combination - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBusinessCombinationTextualDetails</Role>
      <ShortName>Business Combination - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>100380 - Disclosure - Fair Value Measurements - Assets and Liabilities Carried at Fair Value Measured on a Recurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureFairValueMeasurementsAssetsAndLiabilitiesCarriedAtFairValueMeasuredOnRecurringBasisDetails</Role>
      <ShortName>Fair Value Measurements - Assets and Liabilities Carried at Fair Value Measured on a Recurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>100390 - Disclosure - Marketable Securities - Schedule of Marketable Securities by Category (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureMarketableSecuritiesScheduleOfMarketableSecuritiesByCategoryDetails</Role>
      <ShortName>Marketable Securities - Schedule of Marketable Securities by Category (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>100400 - Disclosure - Marketable Securities - Schedule of Amortized Cost and Estimated Fair Value of Marketable Securities Classified by Maturity Date (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureMarketableSecuritiesScheduleOfAmortizedCostAndEstimatedFairValueOfMarketableSecuritiesClassifiedByMaturityDateDetails</Role>
      <ShortName>Marketable Securities - Schedule of Amortized Cost and Estimated Fair Value of Marketable Securities Classified by Maturity Date (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>100410 - Disclosure - Marketable Securities - Summary of Estimated Fair Value and Gross Unrealized Holding Losses of Marketable Securities in Unrealized Loss Position (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureMarketableSecuritiesSummaryOfEstimatedFairValueAndGrossUnrealizedHoldingLossesOfMarketableSecuritiesInUnrealizedLossPositionDetails</Role>
      <ShortName>Marketable Securities - Summary of Estimated Fair Value and Gross Unrealized Holding Losses of Marketable Securities in Unrealized Loss Position (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>100420 - Disclosure - Derivative Instruments and Hedging Activities - Forward Contracts and Related Fair Values (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureDerivativeInstrumentsAndHedgingActivitiesForwardContractsAndRelatedFairValuesDetails</Role>
      <ShortName>Derivative Instruments and Hedging Activities - Forward Contracts and Related Fair Values (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>100430 - Disclosure - Purchased Intangible Assets - Schedule of Purchased Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosurePurchasedIntangibleAssetsScheduleOfPurchasedIntangibleAssetsDetails</Role>
      <ShortName>Purchased Intangible Assets - Schedule of Purchased Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>100440 - Disclosure - Purchased Intangible Assets - Schedule of Estimated Future Amortization Expenses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosurePurchasedIntangibleAssetsScheduleOfEstimatedFutureAmortizationExpensesDetails</Role>
      <ShortName>Purchased Intangible Assets - Schedule of Estimated Future Amortization Expenses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>100450 - Disclosure - Balance Sheet Details - Schedule of Inventories (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetailsScheduleOfInventoriesDetails</Role>
      <ShortName>Balance Sheet Details - Schedule of Inventories (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>100460 - Disclosure - Balance Sheet Details - Schedule of Property, Plant and Equipment, Net (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetailsScheduleOfPropertyPlantAndEquipmentNetDetails</Role>
      <ShortName>Balance Sheet Details - Schedule of Property, Plant and Equipment, Net (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>100470 - Disclosure - Balance Sheet Details - Schedule of Other Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetailsScheduleOfOtherAssetsDetails</Role>
      <ShortName>Balance Sheet Details - Schedule of Other Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>100480 - Disclosure - Balance Sheet Details - Schedule of Accrued Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetailsScheduleOfAccruedLiabilitiesDetails</Role>
      <ShortName>Balance Sheet Details - Schedule of Accrued Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>100490 - Disclosure - Balance Sheet Details - Schedule of Other Current Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetailsScheduleOfOtherCurrentLiabilitiesDetails</Role>
      <ShortName>Balance Sheet Details - Schedule of Other Current Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>100500 - Disclosure - Balance Sheet Details - Schedule of Other Non-Current Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureBalanceSheetDetailsScheduleOfOtherNonCurrentLiabilitiesDetails</Role>
      <ShortName>Balance Sheet Details - Schedule of Other Non-Current Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>100510 - Disclosure - Commitments and Contingencies - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureCommitmentsAndContingenciesTextualDetails</Role>
      <ShortName>Commitments and Contingencies - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>100520 - Disclosure - Commitments and Contingencies - Schedule of Changes in Warranty Reserves (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureCommitmentsAndContingenciesScheduleOfChangesInWarrantyReservesDetails</Role>
      <ShortName>Commitments and Contingencies - Schedule of Changes in Warranty Reserves (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>100530 - Disclosure - Revenue - Schedule of Disaggregation of Revenue by Timing of Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureRevenueScheduleOfDisaggregationOfRevenueByTimingOfRevenueDetails</Role>
      <ShortName>Revenue - Schedule of Disaggregation of Revenue by Timing of Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>100540 - Disclosure - Revenue - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureRevenueAdditionalInformationDetails</Role>
      <ShortName>Revenue - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>100550 - Disclosure - Revenue - Schedule of Changes in Deferred Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureRevenueScheduleOfChangesInDeferredRevenueDetails</Role>
      <ShortName>Revenue - Schedule of Changes in Deferred Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>100560 - Disclosure - Share-Based Compensation - Summary of Restricted Stock Unit Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureShareBasedCompensationSummaryOfRestrictedStockUnitActivityDetails</Role>
      <ShortName>Share-Based Compensation - Summary of Restricted Stock Unit Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>100570 - Disclosure - Share-Based Compensation - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureShareBasedCompensationTextualDetails</Role>
      <ShortName>Share-Based Compensation - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>100580 - Disclosure - Other Expense, Net - Schedule of Other Expense, Net (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureOtherExpenseNetScheduleOfOtherExpenseNetDetails</Role>
      <ShortName>Other Expense, Net - Schedule of Other Expense, Net (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>100590 - Disclosure - Income Taxes - Details of Income Tax (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureIncomeTaxesDetailsOfIncomeTaxDetails</Role>
      <ShortName>Income Taxes - Details of Income Tax (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>100600 - Disclosure - Income Taxes - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureIncomeTaxesTextualDetails</Role>
      <ShortName>Income Taxes - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>100610 - Disclosure - Earnings Per Share - Schedule of Basic and Diluted Earnings Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureEarningsPerShareScheduleOfBasicAndDilutedEarningsPerShareDetails</Role>
      <ShortName>Earnings Per Share - Schedule of Basic and Diluted Earnings Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>100620 - Disclosure - Accumulated Other Comprehensive Income (Loss) - Components of Accumulated Other Comprehensive Loss, Net of Tax (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureAccumulatedOtherComprehensiveIncomeLossComponentsOfAccumulatedOtherComprehensiveLossNetOfTaxDetails</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss) - Components of Accumulated Other Comprehensive Loss, Net of Tax (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureAccumulatedOtherComprehensiveIncomeLossTables</ParentRole>
      <Position>63</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>100630 - Disclosure - Accumulated Other Comprehensive Income (Loss) - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureAccumulatedOtherComprehensiveIncomeLossAdditionalInformationDetails</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss) - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureAccumulatedOtherComprehensiveIncomeLossTables</ParentRole>
      <Position>64</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>100640 - Disclosure - Segment Reporting and Geographic Information - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureSegmentReportingAndGeographicInformationAdditionalInformationDetails</Role>
      <ShortName>Segment Reporting and Geographic Information - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>100650 - Disclosure - Segment Reporting and Geographic Information - Schedule of Revenue from External Customers by Products and Services (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureSegmentReportingAndGeographicInformationScheduleOfRevenueFromExternalCustomersByProductsAndServicesDetails</Role>
      <ShortName>Segment Reporting and Geographic Information - Schedule of Revenue from External Customers by Products and Services (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>100660 - Disclosure - Segment Reporting and Geographic Information - Schedule of Revenue from External Customers Attributed to Foreign Countries by Geographic Area (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureSegmentReportingAndGeographicInformationScheduleOfRevenueFromExternalCustomersAttributedToForeignCountriesByGeographicAreaDetails</Role>
      <ShortName>Segment Reporting and Geographic Information - Schedule of Revenue from External Customers Attributed to Foreign Countries by Geographic Area (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>100670 - Disclosure - Segment Reporting and Geographic Information - Schedule of Revenue by Major Customer by Reporting Segments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureSegmentReportingAndGeographicInformationScheduleOfRevenueByMajorCustomerByReportingSegmentsDetails</Role>
      <ShortName>Segment Reporting and Geographic Information - Schedule of Revenue by Major Customer by Reporting Segments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>68</Position>
    </Report>
    <Report instance="onto-10q_20220702.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>100680 - Disclosure - Share Repurchase Authorization - Textual (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ontoinnovation.com/20220702/taxonomy/role/DisclosureShareRepurchaseAuthorizationTextualDetails</Role>
      <ShortName>Share Repurchase Authorization - Textual (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>69</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="onto-10q_20220702.htm">onto-10q_20220702.htm</File>
    <File>onto-20220702.xsd</File>
    <File>onto-20220702_cal.xml</File>
    <File>onto-20220702_def.xml</File>
    <File>onto-20220702_lab.xml</File>
    <File>onto-20220702_pre.xml</File>
    <File>onto-ex311_6.htm</File>
    <File>onto-ex312_8.htm</File>
    <File>onto-ex321_7.htm</File>
    <File>onto-ex322_10.htm</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="771">http://fasb.org/us-gaap/2022</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2022</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
