| Schedule of quarterly results of operations | 
    |  |  | First Quarter
 |  |  | Second Quarter
 |  |  | Third Quarter
 |  |  | Fourth Quarter
 |  |  
    | December 31, 2019: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
    | Net sales |  | $ | 355,803 |  |  | $ | 346,301 |  |  | $ | 365,160 |  |  | $ | 357,617 |  |  
    | Gross profit (loss) |  | $ | (2,289 | ) |  | $ | 3,971 |  |  | $ | (14,816 | ) |  | $ | 3,196 |  |  
    | Loss from operations |  | $ | (10,524 | ) |  | $ | (2,737 | ) |  | $ | (23,503 | ) |  | $ | (37,919 | ) |  
    | Net loss attributed to Pacific Ethanol, Inc. |  | $ | (12,890 | ) |  | $ | (7,646 | ) |  | $ | (27,326 | ) |  | $ | (41,087 | ) |  
    | Preferred stock dividends |  | $ | (312 | ) |  | $ | (315 | ) |  | $ | (319 | ) |  | $ | (319 | ) |  
    | Net loss available to common stockholders |  | $ | (13,202 | ) |  | $ | (7,961 | ) |  | $ | (27,645 | ) |  | $ | (41,406 | ) |  
    |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
    | Basic and diluted loss per common share |  | $ | (0.29 | ) |  | $ | (0.17 | ) |  | $ | (0.58 | ) |  | $ | (0.85 | ) |  
    |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
    | December 31, 2018: |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
    | Net sales |  | $ | 400,027 |  |  | $ | 410,522 |  |  | $ | 370,407 |  |  | $ | 334,415 |  |  
    | Gross profit (loss) |  | $ | 3,362 |  |  | $ | (1,273 | ) |  | $ | 3,768 |  |  | $ | (21,021 | ) |  
    | Loss from operations |  | $ | (5,953 | ) |  | $ | (10,171 | ) |  | $ | (5,202 | ) |  | $ | (30,211 | ) |  
    | Net loss attributed to Pacific Ethanol, Inc. |  | $ | (7,841 | ) |  | $ | (12,908 | ) |  | $ | (7,514 | ) |  | $ | (32,010 | ) |  
    | Preferred stock dividends |  | $ | (312 | ) |  | $ | (315 | ) |  | $ | (319 | ) |  | $ | (319 | ) |  
    | Net loss available to common stockholders |  | $ | (8,153 | ) |  | $ | (13,223 | ) |  | $ | (7,833 | ) |  | $ | (32,329 | ) |  
    |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
    | Basic and diluted loss per common share |  | $ | (0.19 | ) |  | $ | (0.31 | ) |  | $ | (0.18 | ) |  | $ | (0.74 | ) |  |