Photoelectrochemical device is a versatile platform for achieving various chemical transformations with solar energy. However, a grand challenge, originating from mass and electron transfer of triphase—reagents/products in gas phase, water/electrolyte/products in liquid phase and catalyst/photoelectrode in solid phase, largely limits its practical application. Here, we report the simulation-guided development of hierarchical triphase diffusion photoelectrodes, to improve mass transfer and ensure electron transfer for photoelectrochemical gas/liquid flow conversion. Semiconductor nanocrystals are controllably integrated within electrospun nanofiber-derived mat, overcoming inherent brittleness of semiconductors. The mechanically strong skeleton of free-standing mat, together with satisfactory photon absorption, electrical conductivity and hierarchical pores, enables the design of triphase diffusion photoelectrodes. Such a design allows photoelectrochemical gas/liquid conversion to be performed continuously in a flow cell. As a proof of concept, 16.6- and 4.0-fold enhancements are achieved for the production rate and product selectivity of methane conversion, respectively, with remarkable durability.