HCl doped polyaniline (PAni) was synthesized electrochemically and heat treated at 150 degrees C, 200 degrees C and 250 degrees C for 30 min in vacuum. Different intrinsic and extrinsic structural changes due to heat treatment were determined from XRD, TGA, FT-IR, conductivity and solubility measurement. When HCl doped PAni is subjected to heat treatment, different changes are taking place in the system like doping, dedoping (extrinsic), oxidation, chain scission, cross-linking and changes in crystal structure (intrinsic). Mechanism for doping, dedoping, oxidation, chain scission and cross-linking is proposed. (c) 2008 Elsevier Ltd. All rights reserved.