In this paper, we report the design, synthesis, and characterization of a series of hyper-cross-linked polymers of intrinsic microporosity (PIMs), with high CO 2 uptake and good CO 2 /N 2 and CO 2 /CH 4 selectivity, which makes them competitive for carbon capture and biogas upgrading. The starting hydrocarbon polymers' backbones were functionalized with groups such as −NO 2 , −NH 2 , and −HSO 3 , with the aim of tuning their adsorption selectivity toward CO 2 over nitrogen and methane. This led to a significant improvement in the performance in the potential separation of these gases. All polymers were characterized via Fourier transform infrared (FTIR) spectroscopy and 13 C solid-state NMR to confirm their molecular structures and isothermal gas adsorption to assess their porosity, pore size distribution, and selectivity. The insertion of the functional groups resulted in an overall decrease in the porosity of the starting polymers, which was compensated with an improvement in the final CO 2 uptake and selectivity over the chosen gases. The best uptakes were achieved with the sulfonated polymers, which reached up to 298 mg g −1 (6.77 mmol g −1 ), whereas the best CO 2 /N 2 selectivities were recorded by the aminated polymers, which reached 26.5. Regarding CH 4 , the most interesting selectivities over CO 2 were also obtained with the aminated PIMs, with values up to 8.6. The reason for the improvements was ascribed to a synergetic contribution of porosity, choice of the functional group, and optimal isosteric heat of adsorption of the materials.