A long-standing goal of electron microscopy has been the high-resolution characterization of specimens in their native environment. However, electron optics require high vacuum to maintain an unscattered and focused probe, a challenge for specimens requiring atmospheric or liquid environments. Here, we use an electron-transparent window at the base of a scanning electron microscope’s objective lens to separate column vacuum from the specimen, enabling imaging under ambient conditions, without a specimen vacuum chamber. We demonstrate in-air imaging of specimens at nanoscale resolution using backscattered scanning electron microscopy (airSEM) and scanning transmission electron microscopy. We explore resolution and contrast using Monte Carlo simulations and analytical models. We find that nanometer-scale resolution can be obtained at gas path lengths up to 400 μm, although contrast drops with increasing gas path length. As the electron-transparent window scatters considerably more than gas at our operating conditions, we observe that the densities and thicknesses of the electron-transparent window are the dominant limiting factors for image contrast at lower operating voltages. By enabling a variety of detector configurations, the airSEM is applicable to a wide range of environmental experiments including the imaging of hydrated biological specimens and in situ chemical and electrochemical processes.