PtCu alloy octahedral nanocrystals (NCs) have been synthesized successfully by using N,N-dimethylformamide as both the solvent and the reducing agent in the presence of cetyltrimethylammonium chloride. Cu underpotential deposition (UPD) is found to play a key role in the formation of the PtCu alloy NCs. The composition in the PtCu alloy can be tuned by adjusting the ratio of metal precursors in solution. However, the Cu content in the PtCu alloy NCs cannot exceed 50 %. Due to the fact that Cu precursor cannot be reduced to metallic copper and the Cu content cannot exceed 50 %, we achieved the formation of the PtCu alloy by using Cu UPD on the Pt surface. In addition, the catalytic activities of PtCu alloy NCs with different composition were investigated in electrocatalytic oxidation of formic acid. The results reveal that the catalytic performance is strongly dependent on PtCu alloy composition. The sample of Pt50Cu50 exhibits excellent activity in electrocatalytic oxidation of formic acid.