Ammonia is an air pollutant and the understanding of the ammonia-sensing mechanism is valuable for developing new gas sensors. In this study, polypyrrole (PPy) nanosheets were synthesized by low-temperature oxidation polymerization in a water bath at 0 °C. An ammonia sensor based on the PPy nanosheets was prepared and tested with an ammonia concentration range of 2-500 ppm. The tested results demonstrate that the PPy sensor exhibited excellent ammonia sensitivity and selectivity at room temperature (RT). The sensitivity to ammonia was 1.029 at 2 ppm and 2.153 at 500 ppm. The adsorption behaviors of PPy to different analytes (ammonia, acetone, formaldehyde, and benzene) were simulated and investigated by density functional theory (DFT). The calculated results show that the adsorption energy of ammonia was 0.433 |eV|, which is much larger than that of the other analytes. Furthermore, the charge transfer and the changes in the bond length and angle were carefully compared between different adsorption systems. The calculation results were consistent with our experimental evidence, which demonstrated that the PPy sensor has the highest adsorption capacity for ammonia among the four analytes. The ammonia-sensing mechanism on the PPy sensor was proved from the calculation results obtained by DFT and will support the development of new advanced gas sensors.