A simple method to precisely measure fiber length has been experimentally demonstrated by using a mode-locked fiber laser configuration. Since the transit time in a cavity is exactly proportional to the cavity length, it is easy to obtain the fiber length from the generation of mode-locked pulses in the fiber laser with a long-range nonlinear optical loop mirror that includes the measured fiber. Our new method has a large measurement range, over hundreds of kilometers, and a high resolution, of the order of centimeters, as well as no measurement dead zone.