Biogas is a type of biomass energy source, primarily composed of methane and carbon dioxide. It is generated through the controlled anaerobic digestion of manure or other organic residues. As a cleaner alternative to conventional fuels, fully purified biogas can produce approximately 36.68 MJ/m3 of en.ergy. As the separation of CO2/CH4 in biogas became an important part of the energy industry, we used membrane separation technique to study its separation methods. At first, 3,3′‐dihydroxy‐4,4′‐diamino‐biphenyl (HAB) and 4,4′‐(hexafluoroisopropylidene)diphthalic anhydride (6FDA) were polymerized by open‐loop as polyamide acid macromolecules. Then it was divided into two research routes. One was condensation to polyimide (PI) membranes directly and then thermal rearrangement (TR); the other one was ionic liquid (IL) added before condensation and thermal rearrangement. Through adjusting the thermal rearrangement temperature, different modified polyimide membranes were obtained and tested their separation performance of CO2/CH4. For the result of the test, the best one, membrane HAB‐6FDA‐IL‐TR400, could reach a good separation performance as PCO2 = 403.80 Barrer, αCO2/CH4 = 82.35. It was beyond the Robeson's 2019 upper limit and proved that the modification by IL and thermal rearrangement was benefit for the separation performance of polyimide membranes.