We propose a method for in situ measurement of the length of kilometre-sized Fabry-Pérot cavities in laser gravitational wave detectors. The method is based on the vernier, which occurs naturally when the laser beam incident on the cavity has a sideband. By changing the length of the cavity over several wavelengths we obtain a set of carrier resonances alternating with sideband resonances. From the measurement of the separation between the carrier and a sideband resonance we determine the length of the cavity. We apply the technique to the measurement of the length of a Fabry-Pérot cavity in the Caltech 40m interferometer and discuss the accuracy of the technique.