We have studied the adsorption of gas molecules (CO, NO, NO 2 , O 2 , N 2 , CO 2 , and NH 3 ) on graphene nanoribbons (GNRs) using first principles methods. The adsorption geometries, adsorption energies, charge transfer, and electronic band structures are obtained. We find that the electronic and transport properties of the GNR with armchair-shaped edges are sensitive to the adsorption of NH 3 and the system exhibits n-type semiconducting behavior after NH 3 adsorption.Other gas molecules have little effect on modifying the conductance of GNRs. Quantum transport calculations further indicate that NH 3 molecules can be detected out of these gas molecules by GNR based sensor.