Atomically thin transition-metal dichalcogenides (MoS 2 , WSe 2 , etc.) have long been touted as promising materials for gas detection because of their tunable band gaps; however, the sensing mechanism, based on a chargetransfer process, has not been fully explored. Here, we directly observe the effect of this charge transfer on the doping levels in MoS 2 upon exposure to NO x by performing scanning photoelectron microscopy (SPEM) on a monolayer MoS 2 transistor under bias conditions in a gas environment. By a comparison of the operando SPEM maps of the transistor with and without exposure to NO x gas, a downward shift in the Fermi level position could be detected, consistent with NO x gas making the MoS 2 channel less n-type. KEYWORDS: molybdenum disulfide (MoS 2 ), in situ, field-effect transistor (FET), gas sensor, scanning photoelectron microscopy (SPEM), X-ray photoelectron microscopy (XPS), NO x