<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.19.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>197</ContextCount>
  <ElementCount>198</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>47</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>4</UnitCount>
  <MyReports>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0001000 - Document - DEI Document</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/DeiDocument</Role>
      <ShortName>DEI Document</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001000 - Statement - Condensed Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/CondensedConsolidatedBalanceSheets</Role>
      <ShortName>Condensed Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1001501 - Statement - Condensed Consolidated Balance Sheets (Parentheticals)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/CondensedConsolidatedBalanceSheetsParentheticals</Role>
      <ShortName>Condensed Consolidated Balance Sheets (Parentheticals)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1002000 - Statement - Condensed Consolidated Statements of Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/CondensedConsolidatedStatementsOfOperations</Role>
      <ShortName>Condensed Consolidated Statements of Operations</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1003000 - Statement - Condensed Consolidated Statement of Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/CondensedConsolidatedStatementOfComprehensiveIncomeLoss</Role>
      <ShortName>Condensed Consolidated Statement of Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1004000 - Statement - Condensed Consolidated Statements of Stockholder's Equity Statement</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/CondensedConsolidatedStatementsOfStockholdersEquityStatement</Role>
      <ShortName>Condensed Consolidated Statements of Stockholder's Equity Statement</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1005000 - Statement - Condensed Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/CondensedConsolidatedStatementsOfCashFlows</Role>
      <ShortName>Condensed Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>2101100 - Disclosure - Note 1 Basis of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note1BasisOfPresentation</Role>
      <ShortName>Note 1 Basis of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>2102100 - Disclosure - Note 2 Inventories</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note2Inventories</Role>
      <ShortName>Note 2 Inventories</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>2104100 - Disclosure - Note 3 Revenue Recognition</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note3RevenueRecognition</Role>
      <ShortName>Note 3 Revenue Recognition</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2105100 - Disclosure - Note 4 Financial Instruments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note4FinancialInstruments</Role>
      <ShortName>Note 4 Financial Instruments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2106100 - Disclosure - Note 5 Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note5Debt</Role>
      <ShortName>Note 5 Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2109100 - Disclosure - Note 6 Accounts Receivable Sale Program</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note6AccountsReceivableSaleProgram</Role>
      <ShortName>Note 6 Accounts Receivable Sale Program</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2110100 - Disclosure - Note 7 Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note7CommitmentsAndContingencies</Role>
      <ShortName>Note 7 Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2112100 - Disclosure - Note 8 Restructuring</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note8Restructuring</Role>
      <ShortName>Note 8 Restructuring</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2113100 - Disclosure - Note 9 Income Tax</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note9IncomeTax</Role>
      <ShortName>Note 9 Income Tax</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2114100 - Disclosure - Note 10 Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note10StockholdersEquity</Role>
      <ShortName>Note 10 Stockholders' Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>2115100 - Disclosure - Note 11 Business Segment, Geographic and Customer Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note11BusinessSegmentGeographicAndCustomerInformation</Role>
      <ShortName>Note 11 Business Segment, Geographic and Customer Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2116100 - Disclosure - Note 12 Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note12EarningsPerShare</Role>
      <ShortName>Note 12 Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2117100 - Disclosure - Note 13 Stock-Based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note13StockBasedCompensation</Role>
      <ShortName>Note 13 Stock-Based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2201201 - Disclosure - Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/AccountingPoliciesPolicies</Role>
      <ShortName>Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2302301 - Disclosure - Note 2 Inventories (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note2InventoriesTables</Role>
      <ShortName>Note 2 Inventories (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note2Inventories</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2304301 - Disclosure - Note 3 Revenue Recognition (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note3RevenueRecognitionTables</Role>
      <ShortName>Note 3 Revenue Recognition (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note3RevenueRecognition</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2305301 - Disclosure - Note 4 Derivative Financial Instruments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note4DerivativeFinancialInstrumentsTables</Role>
      <ShortName>Note 4 Derivative Financial Instruments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>24</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2306301 - Disclosure - Note 5 Debt (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note5DebtTables</Role>
      <ShortName>Note 5 Debt (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note5Debt</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2312301 - Disclosure - Note 8 Restructuring and Related Activities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note8RestructuringAndRelatedActivitiesTables</Role>
      <ShortName>Note 8 Restructuring and Related Activities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>26</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2314301 - Disclosure - Note 10 Stockholders' Equity (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note10StockholdersEquityTables</Role>
      <ShortName>Note 10 Stockholders' Equity (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note10StockholdersEquity</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2315301 - Disclosure - Note 11 Business Segment, Geographic and Customer Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note11BusinessSegmentGeographicAndCustomerInformationTables</Role>
      <ShortName>Note 11 Business Segment, Geographic and Customer Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note11BusinessSegmentGeographicAndCustomerInformation</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2316301 - Disclosure - Note 12 Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note12EarningsPerShareTables</Role>
      <ShortName>Note 12 Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note12EarningsPerShare</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2317301 - Disclosure - Note 13 Stock-Based Compensation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note13StockBasedCompensationTables</Role>
      <ShortName>Note 13 Stock-Based Compensation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note13StockBasedCompensation</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2401402 - Disclosure - Note 1 Revenue Beginning Balance Adjustments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note1RevenueBeginningBalanceAdjustmentsDetails</Role>
      <ShortName>Note 1 Revenue Beginning Balance Adjustments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2402402 - Disclosure - Note 2 Inventories (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note2InventoriesDetails</Role>
      <ShortName>Note 2 Inventories (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note2InventoriesTables</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2404402 - Disclosure - Note 3 Disagregation of Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note3DisagregationOfRevenueDetails</Role>
      <ShortName>Note 3 Disagregation of Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2405402 - Disclosure - Note 4 Fair Value (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note4FairValueDetails</Role>
      <ShortName>Note 4 Fair Value (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2405403 - Disclosure - Note 4 Derivatives (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note4DerivativesDetails</Role>
      <ShortName>Note 4 Derivatives (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note4DerivativeFinancialInstrumentsTables</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2406402 - Disclosure - Note 5 Debt Schedule (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note5DebtScheduleDetails</Role>
      <ShortName>Note 5 Debt Schedule (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2406403 - Disclosure - Note 5 Line of Credit Facility (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note5LineOfCreditFacilityDetails</Role>
      <ShortName>Note 5 Line of Credit Facility (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2409401 - Disclosure - Note 6 Accounts Receivable Sale Program (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note6AccountsReceivableSaleProgramDetails</Role>
      <ShortName>Note 6 Accounts Receivable Sale Program (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note6AccountsReceivableSaleProgram</ParentRole>
      <Position>38</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2410401 - Disclosure - Note 7 Contingencies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note7ContingenciesDetails</Role>
      <ShortName>Note 7 Contingencies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2412402 - Disclosure - Note 8 Restructuring (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note8RestructuringDetails</Role>
      <ShortName>Note 8 Restructuring (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note8RestructuringAndRelatedActivitiesTables</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2413401 - Disclosure - Note 9 Income Tax (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note9IncomeTaxDetails</Role>
      <ShortName>Note 9 Income Tax (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note9IncomeTax</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>2414402 - Disclosure - Note 10 Stockholders' Equity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note10StockholdersEquityDetails</Role>
      <ShortName>Note 10 Stockholders' Equity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note10StockholdersEquityTables</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>2414403 - Disclosure - Note 10 Stock Repurchase (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note10StockRepurchaseDetails</Role>
      <ShortName>Note 10 Stock Repurchase (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>2415402 - Disclosure - Note 11 Revenue and Gross Profit by Segment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note11RevenueAndGrossProfitBySegmentDetails</Role>
      <ShortName>Note 11 Revenue and Gross Profit by Segment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>2415403 - Disclosure - Note 11 Segment Reporting by Geographic Segment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note11SegmentReportingByGeographicSegmentDetails</Role>
      <ShortName>Note 11 Segment Reporting by Geographic Segment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>2416402 - Disclosure - Note 12 Earnings Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note12EarningsPerShareDetails</Role>
      <ShortName>Note 12 Earnings Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.sanmina.com/role/Note12EarningsPerShareTables</ParentRole>
      <Position>46</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>2417402 - Disclosure - Note 13 Share-Based Compensation Arrangements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note13ShareBasedCompensationArrangementsDetails</Role>
      <ShortName>Note 13 Share-Based Compensation Arrangements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>2417403 - Disclosure - Note 13 Shares Authorized for Future Issuance and Available for Grant (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note13SharesAuthorizedForFutureIssuanceAndAvailableForGrantDetails</Role>
      <ShortName>Note 13 Shares Authorized for Future Issuance and Available for Grant (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>2417404 - Disclosure - Note 13 Restricted Stock Rollforward (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note13RestrictedStockRollforwardDetails</Role>
      <ShortName>Note 13 Restricted Stock Rollforward (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="sanm-20190330.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>2417405 - Disclosure - Note 13 Unrecognized Stock Based Compensation Expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.sanmina.com/role/Note13UnrecognizedStockBasedCompensationExpenseDetails</Role>
      <ShortName>Note 13 Unrecognized Stock Based Compensation Expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File>sanm-20190330.xml</File>
    <File>sanm-20190330.xsd</File>
    <File>sanm-20190330_cal.xml</File>
    <File>sanm-20190330_def.xml</File>
    <File>sanm-20190330_lab.xml</File>
    <File>sanm-20190330_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy>http://fasb.org/srt/2018-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/country/2017-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2018-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/invest/2013-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/us-gaap/2018-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
