The formaldehyde gas sensing properties of transition metal-doped graphene have been systematically investigated by first-principles calculations. The optimized geometries of transition metal-doped graphene with and without HCHO adsorption, adsorption energies, charge transfers and magnetic moments are obtained for various doped graphene systems. The calculated results show that Co-, Ni-, Cu-, Zn-, Pd- and Ag-doped systems have moderate adsorption energies, implying their potential applications as HCHO sensors. The two-probe sensor devices consisting of the central scattering region and pristine graphene electrodes with the armchair or zigzag transport directions are built, and the spin-polarized current–voltage curves are calculated by the non-equilibrium Green’s function method within the framework of density functional theory. For the Cu-, Zn- and Ag-doped systems, the average sensor response is over 80%, 40% and 290%, respectively. In particular, the Cu- and Ag-doped graphene devices have the highest value of response over 200% and 900% at low voltages, indicating a short response time and high sensitivity of these devices. The present study provides a theoretical basis for exploring practical applications of the transition metal-functionalized graphene as superior HCHO gas sensors.