AbstractThis study investigated the preparation of polyimide solvent‐resistant nanofiltration membranes by a two‐step method (casting the membrane first and then crosslinking by the thermal imidization method). The influences of polymer concentration, thickness of membranes, temperature of the imidization, phase inversion time and thermal imidization procedure were studied. The membranes with the highest rejection rate of Fast Green FCF (molecular weight 808.86 g mol−1) were prepared in the following conditions: polymer concentration 13 wt%, phase inversion time 1 h, membrane thickness 150 µm and thermal imidization procedure 200 °C for 2.5 h, 250 °C for 2 h and 300 °C for 2 h in a vacuum environment; the heating rate was 5 °C min−1. The membrane was stable in most of the solvents tested and the fluxes of some common solvents were equal to or higher than a number of commercial solvent‐resistant nanofiltration membranes. A much higher rejection of dyes in water than in methanol was observed in the filtration experiments and a new way to explain it was developed. Copyright © 2011 Society of Chemical Industry