<?xml version='1.0' encoding='UTF-8'?>
<FilingSummary>
  <Version>3.7.0.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>107</ContextCount>
  <ElementCount>197</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>38</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>6</UnitCount>
  <MyReports>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>00000001 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/DocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>00000002 - Statement - Consolidated Balance Sheets (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/BalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>00000003 - Statement - Consolidated Balance Sheets (Unaudited) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/BalanceSheetsParenthetical</Role>
      <ShortName>Consolidated Balance Sheets (Unaudited) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>00000004 - Statement - Consolidated Statements of Operations (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/StatementsOfOperations</Role>
      <ShortName>Consolidated Statements of Operations (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>00000005 - Statement - Consolidated Statements of Cash Flows (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/StatementsOfCashFlows</Role>
      <ShortName>Consolidated Statements of Cash Flows (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>00000006 - Disclosure - 1. Organization and Basis of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/OrganizationAndBasisOfPresentation</Role>
      <ShortName>1. Organization and Basis of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>00000007 - Disclosure - 2. Segments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Segments</Role>
      <ShortName>2. Segments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>00000008 - Disclosure - 3. Inventories</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Inventories</Role>
      <ShortName>3. Inventories</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>00000009 - Disclosure - 4. Derivatives</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Derivatives</Role>
      <ShortName>4. Derivatives</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>00000010 - Disclosure - 5. Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Debt</Role>
      <ShortName>5. Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>00000011 - Disclosure - 6. Warrants and stock options</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/WarrantsAndStockOptions</Role>
      <ShortName>6. Warrants and stock options</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>00000012 - Disclosure - 7. Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/CommitmentsAndContingencies</Role>
      <ShortName>7. Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>00000013 - Disclosure - 8. Pension Plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/PensionPlans</Role>
      <ShortName>8. Pension Plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>00000014 - Disclosure - 9. Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/FairValueMeasurements</Role>
      <ShortName>9. Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>00000015 - Disclosure - 10. Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/EarningsPerShare</Role>
      <ShortName>10. Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>00000016 - Disclosure - 11. Subsequent Events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/SubsequentEvents</Role>
      <ShortName>11. Subsequent Events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>00000017 - Disclosure - 1. Organization and Basis of Presentation (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/OrganizationAndBasisOfPresentationPolicies</Role>
      <ShortName>1. Organization and Basis of Presentation (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>00000018 - Disclosure - 2. Segments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/SegmentsTables</Role>
      <ShortName>2. Segments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/Segments</ParentRole>
      <Position>18</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>00000019 - Disclosure - 3. Inventories (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/InventoriesTables</Role>
      <ShortName>3. Inventories (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/Inventories</ParentRole>
      <Position>19</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>00000020 - Disclosure - 4. Derivatives (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/DerivativesTables</Role>
      <ShortName>4. Derivatives (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/Derivatives</ParentRole>
      <Position>20</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>00000021 - Disclosure - 5. Debt (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/DebtTables</Role>
      <ShortName>5. Debt (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/Debt</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>00000022 - Disclosure - 8. Pension and Retirement Benefit Plans(Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/PensionAndRetirementBenefitPlanstables</Role>
      <ShortName>8. Pension and Retirement Benefit Plans(Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>00000023 - Disclosure - 9. Fair Value Measurements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/FairValueMeasurementsTables</Role>
      <ShortName>9. Fair Value Measurements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/FairValueMeasurements</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>00000024 - Disclosure - 10. Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/EarningsPerShareTables</Role>
      <ShortName>10. Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/EarningsPerShare</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>00000025 - Disclosure - 1. Organization and Basis of Presentation (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/OrganizationAndBasisOfPresentationDetailsNarrative</Role>
      <ShortName>1. Organization and Basis of Presentation (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/OrganizationAndBasisOfPresentationPolicies</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>00000026 - Disclosure - 1. Organization and Basis of Presentation (Details Narrative 2)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/OrganizationAndBasisOfPresentationDetailsNarrative2</Role>
      <ShortName>1. Organization and Basis of Presentation (Details Narrative 2)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/OrganizationAndBasisOfPresentationPolicies</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>00000027 - Disclosure - 2. Segments - Schedule of Financial Date for Operating Segments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Segments-ScheduleOfFinancialDateForOperatingSegmentsDetails</Role>
      <ShortName>2. Segments - Schedule of Financial Date for Operating Segments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>27</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>00000028 - Disclosure - 2. Segments - Schedule of Assets by Operating Segments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Segments-ScheduleOfAssetsByOperatingSegmentsDetails</Role>
      <ShortName>2. Segments - Schedule of Assets by Operating Segments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>00000029 - Disclosure - 2. Segments (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/SegmentsDetailsNarrative</Role>
      <ShortName>2. Segments (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/SegmentsTables</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>00000030 - Disclosure - 3. Inventories - Schedule of Inventories (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Inventories-ScheduleOfInventoriesDetails</Role>
      <ShortName>3. Inventories - Schedule of Inventories (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>00000031 - Disclosure - 3. Inventories - Schedule of Inventories (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Inventories-ScheduleOfInventoriesDetailsNarrative</Role>
      <ShortName>3. Inventories - Schedule of Inventories (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>00000032 - Disclosure - 4. Derivatives - Schedule of Derivatives Not Designated as Hedging Instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Derivatives-ScheduleOfDerivativesNotDesignatedAsHedgingInstrumentsDetails</Role>
      <ShortName>4. Derivatives - Schedule of Derivatives Not Designated as Hedging Instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>00000033 - Disclosure - 4. Derivatives - Schedule of Recognized Gains (Losses) for Derivatives (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Derivatives-ScheduleOfRecognizedGainsLossesForDerivativesDetails</Role>
      <ShortName>4. Derivatives - Schedule of Recognized Gains (Losses) for Derivatives (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>00000034 - Disclosure - 4. Derivatives (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/DerivativesDetailsNarrative</Role>
      <ShortName>4. Derivatives (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/DerivativesTables</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>00000035 - Disclosure - 5. Debt - Schedule of Long Term Debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/Debt-ScheduleOfLongTermDebtDetails</Role>
      <ShortName>5. Debt - Schedule of Long Term Debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>00000036 - Disclosure - 5. Debt (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/DebtDetailsNarrative</Role>
      <ShortName>5. Debt (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/DebtTables</ParentRole>
      <Position>36</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>00000037 - Disclosure - 6. Warrants and stock options (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/WarrantsAndStockOptionsDetailsNarrative</Role>
      <ShortName>6. Warrants and stock options (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/WarrantsAndStockOptions</ParentRole>
      <Position>37</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>00000038 - Disclosure - 7. Commitments and Contingencies (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/CommitmentsAndContingenciesDetailsNarrative</Role>
      <ShortName>7. Commitments and Contingencies (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/CommitmentsAndContingencies</ParentRole>
      <Position>38</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>00000039 - Disclosure - 8. Pension and Retirement Benefit Plans (Details - Retirement Plans)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/PensionAndRetirementBenefitPlansDetails-RetirementPlans</Role>
      <ShortName>8. Pension and Retirement Benefit Plans (Details - Retirement Plans)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/PensionAndRetirementBenefitPlanstables</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>00000040 - Disclosure - 8. Pension Plans (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/PensionPlansDetailsNarrative</Role>
      <ShortName>8. Pension Plans (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/PensionPlans</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>00000041 - Disclosure - 9. Fair Value Measurements - Schedule of Significant Assumptions Used and Related Fair Values for Warrants (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/FairValueMeasurements-ScheduleOfSignificantAssumptionsUsedAndRelatedFairValuesForWarrantsDetails</Role>
      <ShortName>9. Fair Value Measurements - Schedule of Significant Assumptions Used and Related Fair Values for Warrants (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>00000042 - Disclosure - 9. Fair Value Measurements (Details - Other derivatives)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/FairValueMeasurementsDetails-OtherDerivatives</Role>
      <ShortName>9. Fair Value Measurements (Details - Other derivatives)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/FairValueMeasurementsTables</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>00000043 - Disclosure - 9. Fair Value Measurements - Schedule of Fair Value of Level 3 Inputs to Warrants (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/FairValueMeasurements-ScheduleOfFairValueOfLevel3InputsToWarrantsDetails</Role>
      <ShortName>9. Fair Value Measurements - Schedule of Fair Value of Level 3 Inputs to Warrants (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>00000044 - Disclosure - 10. Earnings Per Share - Schedule of Computation of Basic and Diluted Earnings Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/EarningsPerShare-ScheduleOfComputationOfBasicAndDilutedEarningsPerShareDetails</Role>
      <ShortName>10. Earnings Per Share - Schedule of Computation of Basic and Diluted Earnings Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="peix-20170630.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>00000045 - Disclosure - 10. Earnings Per Share (Details Narrative)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://pacificethanol.net/role/EarningsPerShareDetailsNarrative</Role>
      <ShortName>10. Earnings Per Share (Details Narrative)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://pacificethanol.net/role/EarningsPerShareTables</ParentRole>
      <Position>45</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File>peix-20170630.xml</File>
    <File>peix-20170630.xsd</File>
    <File>peix-20170630_cal.xml</File>
    <File>peix-20170630_def.xml</File>
    <File>peix-20170630_lab.xml</File>
    <File>peix-20170630_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies/>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
