Frequency scanning interferometry technique with a nanometer precision using a vertical-cavity surface-emitting laser diode (VCSEL) is presented. Since the frequency scanning of the VCSEL is linearized by the phase-locked-loop technique, the gradient of the interference fringe order can be precisely determined using linear least squares fitting. This enables a length measurement with a precision better than a quarter wavelength, and the absolute fringe number including the integer part at the atomic transition spectrum (rubidium-D2 line) is accurately determined. The validity of the method is demonstrated by excellent results of block gauge measurement with a root mean square error better than 5 nm.