On-site hydrogen peroxide production through electrocatalytic and photocatalytic oxygen reduction reactions has recently attracted broad research interest. However, practical applications have thus far been plagued by the low activity and the requirement of complex equipment. Here, inspired by the process of biological hydrogen peroxide synthesis catalyzed by enzymes, we report a Pt-Au alloy to mimic the catalytic function of natural formate oxidase for hydrogen peroxide synthesis through aerobic oxidation of formic acid. The mass activity of the Pt-Au alloy is three times higher than that of formate oxidase. Density functional theory calculations revealed that the efficient dehydrogenation of formic acid and the high selectivity of the subsequent reduction of oxygen to hydrogen peroxide account for the high hydrogen peroxide productivity. In addition, the formic acid aqueous solution provides an acidic environment, which is conducive to the utilization of the in situ generated hydrogen peroxide for oxidation reactions, including C-H bond oxidation and sterilization.