In this work, a systematic molecular simulation study was performed to compare the separation of CO 2 /N 2 and CH 4 / N 2 mixtures in two different classes of nanoporous materials, zeolites, and metal-organic frameworks (MOFs). For this purpose, three zeolites (MFI, LTA, and DDR) and seven MOFs (Cu-BTC, MIL-47 (V), IRMOF-1, IRMOF-12, IRMOF-14, IRMOF-11, and IRMOF-13) were chosen as the representatives to compare. On the basis of the validated force fields, both adsorption selectivity and pure CO 2 and CH 4 adsorption isotherms were simulated. The results show that although MOFs perform much better for gas storage, their separation performance is comparable to zeolites; for the systems with the preferable component having a larger quadrupolar moment, both zeolites and MOFs can enhance the separation selectivity, and in contrast they both reduce the selectivity. In addition, we show that ideal adsorbed solution theory (IAST) gives a very reasonable prediction of the mixture adsorption isotherms both in zeolites and in MOFs if the pure component isotherms are known. We demonstrate that the difference in quadrupolar moment of the components is an important property that has to be considered in the selection of a membrane material.