Carbon molecular sieve membranes based on polymeric precursors for gas separation applications. By tuning the pore structure of these materials, different gas separation applications can be tackled including CO2/CH4,N2/CH4 and others.