Abstract Graphitic carbon nitride microsphere photocatalysts were prepared through a template-free solvothermal approach with post-heating treatment. Structural characterization results reveal that the as-prepared sample has the same composition as bulk g-C3N4, but appears as hierarchical microspheres with nanoporous surfaces. Comparing to the bulk g-C3N4, these porous microspheres exhibit narrowed bandgap and lower resistance, which allows more effective visible-light harvesting and more efficient transport and separation of photogenerated charge carriers. Consequently, we observed high rate of photocatalytic H2 production and stronger photocurrent responses under visible light irradiation. Further, the long-term photocatalytic test proved high stability of the prepared nanoporous microsphere for H2 generation.