Polymers of intrinsic microporosity (PIM-1) have been known for their super high permeability but average selectivity for medium-size gas pairs. They have unimpressive selectivity for H2 and CO2 separation (i.e., α (H2/CO2) = 0.6). For the first time, we have discovered that ultraviolet (UV)-rearranged polymers of PIM-1 membranes can be used for H2/CO2 separation with far superior separation performance to others in literatures. The PIM-1 membrane after UV radiation for 4 hours shows H2 permeability of 452 barrer with H2/CO2 selectivity of 7.3. Experimental data and molecular simulation reveal that the polymer chains of PIM-1 undergo 1,2-migration reaction and transform to close-to-planar like rearranged structure after UV radiation. As a result, the UV-irradiated PIM-1 membrane shows considerable drops in both fractional free volume (FFV) and size of micro-pores. Positron annihilation lifetime (PAL) results have confirmed the chemical and structural changes, suggesting the FFV and pore size drops are mainly ascribed to the destructed spiro-carbon centre during UV radiation. Sorption and x-ray diffractor (XRD) analyses indicate that the impressive H2/CO2 selectivity arises from the significantly enhanced diffusivity selectivity induced by UV radiation, followed by molecular rearrangement, conformation change and chain packing.