A scanning tunneling microscope (STM) with a compact, three-dimensional, inertial slider design is presented. Inertial sliding of the STM tip, in three dimensions, enables coarse motion and scanning using only one piezoelectric tube. Using the same electronics both for scanning and inertial sliding, step lengths of less than 5% of the piezo range were achieved. The compact design, less than 1 cm3 in volume, ensures a low mechanical noise level and enables us to fit the STM into the sample holder of a transmission electron microscope (TEM), while maintaining atomic scale resolution in both STM and TEM imaging.