Nanoporous carbon membranes (NCMs) were fabricated by the blends of resorcinol–formaldehyde (RF) resin and Pluronic F-127 through the processes of assembly, membrane-casting, solidification, and pyrolysis. The effect of the catalyst type (i.e., NaOH and Na2CO3) on the structure and property of precursors and their derived NCMs was investigated. The as-obtained precursors and NCMs were characterized by thermogravimetry, differential scanning calorimetry, x-ray diffraction, Fourier transform infrared spectroscopy, transmission electron microscopy, elemental analysis, nitrogen adsorption, and gas permeation techniques. The results have shown that defect-free NCMs can be easily procured by the NaOH and Na2CO3 catalysts. In contrast, the precursor made from the Na2CO3 catalyst exhibits higher char yield than that from NaOH after pyrolysis. NaOH-based NCMs are beneficial for the separation of H2/N2 and CO2/N2 gas pairs. Na2CO3-based NCMs are more favorable for the separation of O2/N2 with an ideal selectivity of 6.29 and an O2 permeability of 3.27 Barrer.