Permeabilities for a series of gases through free-standing films of the conjugated polymer polyaniline are reported. A remarkable selectivity has been achieved for important gas pairs including hydrogen-nitrogen, oxygen-nitrogen, and carbon dioxide-methane. The selectivity values of 3590 for H-2/N2, 30 for O2/N2, and 336 for CO2/CH4 surpass the highest previously reported values of 313, 16, and 60 for the nonconjugated polymers poly(trifluorochloroethylene), cellulose nitrate, and a fluorinated polyimide, respectively. The process for tailoring gas selectivity of a polyaniline membrane involves first enhancing the permeabilities of gases with small diameters [< 3.5 angstroms (angstrom)] by doping and undoping the polymer film with counterions of an appropriate size. High selectivities are then achieved by decreasing the permeabilities of larger gases (> 3.5 angstrom diameter) through controlled redoping of the polymer. The permanent morphological changes induced in this conjugated polymer system and others indicate the potential for development of universal membranes for gas separations.