The conjugated polymer polyaniline is a promising material for sensors, since its conductivity is highly sensitive to chemical vapors. Nanofibers of polyaniline are found to have superior performance relative to conventional materials due to their much greater exposed surface area. A template-free chemical synthesis is described that produces uniform polyaniline nanofibers with diameters below 100 nm. The interfacial polymerization can be readily scaled to make gram quantities. Resistive-type sensors made from undoped or doped polyaniline nanofibers outperform conventional polyaniline on exposure to acid or base vapors, respectively. The nanofibers show essentially no thickness dependence to their sensitivity.