Artificial photosynthesis of hydrocarbon fuels by utilizing solar energy and CO2 is considered as a potential route for solving ever-increasing energy crisis and greenhouse effect. Herein, hierarchical porous O-doped graphitic carbon nitride (g-C3 N4 ) nanotubes (OCN-Tube) are prepared via successive thermal oxidation exfoliation and curling-condensation of bulk g-C3 N4 . The as-prepared OCN-Tube exhibits hierarchically porous structures, which consist of interconnected multiwalled nanotubes with uniform diameters of 20-30 nm. The hierarchical OCN-Tube shows excellent photocatalytic CO2 reduction performance under visible light, with methanol evolution rate of 0.88 µmol g-1 h-1 , which is five times higher than bulk g-C3 N4 (0.17 µmol g-1 h-1 ). The enhanced photocatalytic activity of OCN-Tube is ascribed to the hierarchical nanotube structure and O-doping effect. The hierarchical nanotube structure endows OCN-Tube with higher specific surface area, greater light utilization efficiency, and improved molecular diffusion kinetics, due to the more exposed active edges and multiple light reflection/scattering channels. The O-doping optimizes the band structure of g-C3 N4 , resulting in narrower bandgap, greater CO2 affinity, and uptake capacity as well as higher separation efficiency of photogenerated charge carriers. This work provides a novel strategy to design hierarchical g-C3 N4 nanostructures, which can be used as promising photocatalyst for solar energy conversion.