The effect of stray capacitance on potential measurements was investigated using Kelvin probe force microscopy (KPFM) at room temperature under ultra-high vacuum (UHV). The stray capacitance effect was explored in three modes, including frequency modulation (FM), amplitude modulation (AM) and heterodyne amplitude modulation (heterodyne AM). We showed theoretically that the distance-dependence of the modulated electrostatic force in AM-KPFM is significantly weaker than in FM- and heterodyne AM-KPFMs and that the stray capacitance of the cantilever, which seriously influences the potential measurements in AM-KPFM, was almost completely eliminated in FM- and heterodyne AM-KPFMs. We experimentally confirmed that the contact potential difference (CPD) in AM-KPFM, which compensates the electrostatic force between the tip and the surface, was significantly larger than in FM- and heterodyne AM-KPFMs due to the stray capacitance effect. We also compared the atomic scale corrugations in the local contact potential difference (LCPD) among the three modes on the surface of Si(111)-7 × 7 finding that the LCPD corrugation in AM-KPFM was significantly weaker than in FM- and heterodyne AM-KPFMs under low AC bias voltage conditions. The very weak LCPD corrugation in AM-KPFM was attributed to the artefact induced by topographic feedback.