Mesoporous Pt–Ru alloy films with various compositions were synthesized by electrochemical plating in an aqueous surfactant solution. After the removal of surfactants, continuous mesoporous Pt–Ru alloy films possessing uniform mesopores with diameter about 7 nm were obtained. The Ru content in the films could be controlled from 0 to 13 at % by changing the precursor compositions. For all the films, the mesostructural periodicities and the mesopore sizes in the films were not changed. Due to the mesoporous structure and the doped Ru content, our mesoporous Pt–Ru films showed superior electrocatalytic activity for methanol oxidation reaction in comparison with the commercially available Pt catalyst.