In this study, the atomic force microscope( AFM) scanning moiré method is developed. The scanning lines in the AFM monitor are used as the reference grating. The reference grating interferes with the specimen grating, and forms a moiré pattern on the monitor. The formation mechanism of AFM moiré, the deformation measurement principle using this method are described in detail. The AFM scanning moiré method is used to measure the residual deformation of mica substrate after being damaged by the YAG laser, and the thermal deformation in a QFP type electronic package. The experiment results verify the feasibility of AFM scanning moire method and show its ability to measure the in-plane deformation in both micro-and nano-scales.