A novel and simple method based on optical-fiber frequency domain interferometer to measure the deformation of diamond anvils under high pressure is presented. The working principle and application examples are given in this paper. The deformation of diamond anvils is obtained up to 37.7 GPa, our results verify that the deformation has an obvious difference between uploading and downloading at a given pressure, the maximum difference is up to 4.5 μm at 18.8 GPa, and the cupping effect is observed directly.