In this paper, a new STM nanomoire method for measuring nanometerdeformation was proposed. In the measurement, the moire pattern is generated by the scanning lines of scanning tunneling microscope and the atomic lattice of substance as a specimen grating. At the same time, Phase shifting was realized in four steps from 0 to 2π by controlling the PZT in the STM system to shift the specimen in the direction perpendicular to the gratings. The principles of forming STM nano moire, experimental techniques and phase shifting were described in detail in this paper. Nanodeformation virtual strain of high orientated pyrolytic graphite(HOPG) was measured by using of this method.