Abstract Here we demonstrated a simple and reliable method to prepare single or multiple core/shell structured capsules and then demonstrate how to produce single or multiple-layer hollow spheres. Those capsules or hollow spheres could be made of organic and/or inorganic functional materials depending on the experimental design. Core–shell composite capsules consisting of TiO 2–polyaniline (PANI) shell and polystyrene (PS) core were prepared by using core–shell structured sulfonated-PS spheres as templates. Aniline was polymerized in the shell of sulfonated-PS spheres. Since the PANI was in situ doped by sulfonic acid, the as-synthesized composite capsules had good conductivity. After PS cores were dissolved in solvent, hollow TiO 2–PANI spheres formed, which could be further calcined to produce mesoporous hollow TiO 2 spheres. The cavity size of the hollow spheres was uniform, at approximately 170 nm in diameter and with a shell thickness of 30 nm. The cavity size and the shell thickness can be synchronously controlled by adjusting the sulfonation reaction time of PS spheres. Scanning electron microscopy, transmission electron microscopy, Fourier transform infrared spectroscopy and X-ray powder scattering were employed to characterize these as-prepared spheres.