Abstract. Wilson & Bappu (1957) have shown the existence of a remarkable correlation between the width of the emission in the core of the K line of CaII and the absolute visual magnitude of late-type stars. Here we present a new calibration of the Wilson-Bappu effect based on a sample of 119 nearby stars. We use, for the first time, width measurements based on high resolution and high signal to noise ratio CCD spectra and absolute visual magnitudes from the Hipparcos database. Our primary goal is to investigate the possibility of using the Wilson-Bappu effect to determine accurate distances to single stars and groups. The result of our calibration fitting of the Wilson-Bappu relationship is M V = 33.2−18.0 log W 0 , and the determination seems free of systematic effects. The root mean square error of the fitting is 0.6 mag. This error is mostly accounted for by measurement errors and intrinsic variability of W 0 , but in addition a possible dependence on the metallicity is found, which becomes clearly noticeable for metallicities below [Fe/H] ∼ −0.4. This detection is possible because in our sample [Fe/H] ranges from −1.5 to 0.4. The Wilson-Bappu effect can be used confidently for all metallicities not lower than ∼−0.4, including the LMC. While it does not provide accurate distances to single stars, it is a useful tool to determine accurate distances to clusters and aggregates, where a sufficient number of stars can be observed. We apply the Wilson-Bappu effect to published data of the open cluster M 67; the retrieved distance modulus is of 9.65 mag, in very good agreement with the best distance estimations for this cluster, based on main sequence fitting.