Photocatalytic H2 production using semiconductors is a promising approach to store solar energy as a chemical fuel, but the oxidizing power of the excited holes is often wasted. Now, holes are harnessed in a dehydrocoupling strategy that simultaneously produces H2 and diesel fuel precursors from biomass-derived molecules.