Uniform-sized silica nanospheres (SNSs) assembled into close-packed structures were used as a primary template for ordered porous graphitic carbon nitride (g-C3N4), which was subsequently used as a hard template to generate regularly arranged Ta3N5 nanoparticles of well-controlled size. Inverse opal g-C3N4 structures with the uniform pore size of 20–80 nm were synthesized by polymerization of cyanamide and subsequent dissolution of the SNSs with an aqueous HF solution. Back-filling of the C3N4 pores with tantalum precursors, followed by nitridation in an NH3 flow gave regularly arranged, crystalline Ta3N5 nanoparticles that are connected with each other. The surface areas of the Ta3N5 samples were as high as 60 m2 g−1, and their particle size was tunable from 20 to 80 nm, which reflects the pore size of g-C3N4. Polycrystalline hollow nanoparticles of Ta3N5 were also obtained by infiltration of a reduced amount of the tantalum source into the g-C3N4 template. An improved photocatalytic activity for H2 evolution on the assembly of the Ta3N5 nanoparticles under visible-light irradiation was attained as compared with that on a conventional Ta3N5 bulk material with low surface area.