In this study, the first-principles calculations were performed to investigate the adsorption behaviors of gas molecules H2S, CO2 and H2O on Cr, Mo and W modified g-C3N4 (0 0 1) surface. The results show that H2S, CO2 and H2O are physically adsorbed on the pristine g-C3N4, while the adsorption becomes chemisorbed due to the introduction of transition metals which significantly improve the interfacial electron transfer and narrow the band gap of g-C3N4 (0 0 1). Furthermore, it is found that the adsorption behaviors can be greatly influenced by the applied electric field. The adsorption energy is generally arranged in the order of Eads(H2S) > Eads(H2O) > Eads(CO2), and W/g-C3N4 (0 0 1) exhibits the best separation capability. The study could provide a versatile approach to selectively capture and separate the mixed gases in the catalytic reactions by controlling the applied intensity of electric field.