Hierarchical structures are abundant in nature, such as in the superhydrophobic surfaces of lotus leaves and the structural coloration of butterfly wings. They consist of ordered features across multiple size scales, and their advantageous properties have attracted enormous interest in wide-ranging fields including energy storage, nanofluidics, and nanophotonics. Femtosecond lasers, which are capable of inducing various material modifications, have shown promise for manufacturing tailored hierarchical structures. However, existing methods, such as multiphoton lithography and three-dimensional (3D) printing using nanoparticle-filled inks, typically involve polymers and suffer from high process complexity. Here, we demonstrate the 3D printing of hierarchical structures in inorganic silicon-rich glass featuring self-forming nanogratings. This approach takes advantage of our finding that femtosecond laser pulses can induce simultaneous multiphoton cross-linking and self-formation of nanogratings in hydrogen silsesquioxane. The 3D printing process combines the 3D patterning capability of multiphoton lithography and the efficient generation of periodic structures by the self-formation of nanogratings. We 3D-printed micro-supercapacitors with large surface areas and a high areal capacitance of 1 mF/cm2 at an ultrahigh scan rate of 50 V/s, thereby demonstrating the utility of our 3D printing approach for device applications in emerging fields such as energy storage.