A novel method, where moire patterns, produced by the images of reference gratings, and a CCD pixel array are used to measure the focal lenght of a lens is presented. The tested lens could rnagnify the images of straight-line gratings onto the CCD camera.