Over a range of high temporal and low spatial frequencies, counterphase flickering gratings evoke the so-called frequency-doubling illusion, in which the apparent brightness of the grating varies at twice its real spatial frequency. The form of the nonlinearity that causes this second-harmonic distortion of the visual response was determined by a cancellation technique. The harmonic distortion can be measured as a function of amplitude (or contrast) by adding to the flickering grating a real, nonflickering, double-frequency component with the amplitude and phase required to cancel the illusory second harmonic. Harmonic distortion curves obtained in this way imply that the nonlinearity is of the form /s/p, where s is the stimulus pattern (without its dc component) and p is close to 0.6. If p = 1, or if the absolute value is not taken, this expression predicts distortion curves that differ significantly from the experimental results. Hence neither rectification nor compression alone is sufficient to account for the second-harmonic distortion; both are required.