The thermal stability of polypyrrole (PPy) samples has been studied by thermogravimetry/mass spectrometry and pyrolysis-gas chromatography/mass spectrometry in inert atmospheres. PPy has been prepared by chemical oxidative polymerization using ferric sulfate as an oxidant and anionic surfactants, such as dodecylbenzenesulfonic acid and sodium dodecylbenzenesulfonate as co-dopants. For comparison we have studied polypyrrole (PPy-SO4) prepared without any additive. It was found that the presence of anionic surfactants improved the thermal stability of PPy. The decomposition of PPy doped with ferric sulfate and anionic surfactants occurs at relatively high temperature indicating that chemical interactions exist between the polymer and the surfactants.