A composite using polyaniline (PAni) as the conducting polymer and silica sol–gel as the host matrix was prepared by the template method. To evaluate the electrochemical performance of the PAni/silica composite, PAni films were synthesized under the same conditions, directly on ITO substrates and the results were compared. Cyclic voltammetry, impedance spectroscopy, charge–discharge cycles and lifetime tests were done in organic medium. The PAni/silica composite showed excellent performance in all of the tests. This composite may therefore be useful for cathodes in lithium microbatteries.