Three kinds of N-doped mesoporous TiO2 hollow spheres with different N-doping contents, surface area, and pore size distributions were prepared based on a sol–gel synthesis and combined with a calcination process. Melamine formaldehyde (MF) microspheres have been used as sacrificial template and cetyltrimethyl ammonium bromide (CTAB) or polyvinylpyrrolidone (PVP) was selected as pore-directing agent. Core–shell intermediate spheres of titania-coated MF with diameters of 1.2–1.6 μm were fabricated by varying the volume concentration of TiO2 precursor from 1 to 3 vol %. By calcining the core–shell composite spheres at 500 °C for 3 h in air, an in situ N-doping process occurred upon the decomposition of the MF template and CTAB or PVP pore-directing surfactant. N-doped mesoporous TiO2 hollow spheres with sizes in the range of 0.4–1.2 μm and shell thickness from 40 to 110 nm were obtained. The composition and N-doping content, thermal stability, morphology, surface area and pore size distribution, wall thickness, photocatalytic activities, and optical properties of the mesoporous TiO2 hollow spheres derived from different conditions were investigated and compared based on Fourier-transformation infrared (FTIR), SEM, TEM, thermogravimetric analysis (TGA), nitrogen adsorption–desorption, and UV–vis spectrophotoscopy techniques. The influences of particle size, N-doping, porous, and hollow characteristics of the TiO2 hollow spheres on their photocatalytic activities and optical properties have been studied and discussed based on the composition analysis, structure characterization, and optical property investigation of these hollow spherical TiO2 matrices.