A fibrillar polyaniline/diatomite composite was prepared by one-step in situ polymerization of aniline in the dispersed system of diatomite, and was characterized via Fourier-transform infrared spectra (FT-IR), UV–vis–NIR spectra, wide-angle X-ray diffraction (WXRD), thermogravimetric analysis (TGA) and transmission electron microscopy (TEM), as well as conductivity. Morphology of the composite is uniform nanofibers, which the diameters of nanofibers are about 50–80nm. The conductivity of polyaniline/diatomite composite contained 28% polyaniline is 0.29Scm −1 at 25°C, and temperature of thermal degradation has reached 493°C in air. The composite has potential commercial applications as fillers for electromagnetic shielding materials and conductive coatings.