Three experiments investigated listeners' ability to detect a narrow band of noise, centered on one partial of a random-phase complex tone, as a function of inharmonicity. Inharmonicity was generated by randomly mistuning the partial frequencies from a 100-Hz fundamental frequency (F0). In experiment 1, masked detection thresholds were lower when the masker was harmonic than when it was inharmonic for target bands in the range 0.5–2.5 kHz. The presence of this masking level difference due to harmonicity (HMLD) in regions of resolved partials and the reduction of the HMLD with increasing center frequency did not support the idea that HMLD was primarily caused by the envelope modulations produced by the beating of unresolved partials within an auditory filter. In experiment 2, masker mistunings ranging beyond 12% of the F0 disrupted the HMLD while smaller mistunings gave thresholds similar to a harmonic masker. In experiment 3, all partials contributed to some extent to the HMLD, but the harmonicity of partials neighboring the target had a greater influence than distant partials. The observed HMLDs can best be accounted for by a mechanism of harmonic cancellation.