In dip-moveout (DMO) processing, the seismic velocity is often assumed to be constant. While several approximate techniques for handling vertical velocity variation have recently become available, here we propose a method for computing the kinematically exact DMO correction when velocity is an arbitrary function of the depth.While not known in advance, the raypath from source to receiver and the corresponding zero-offset raypath satisfy several relationships, which are used to form a system of nonlinear equations. By simultaneously solving the equations via Newton-Raphson iteration, we determine the mapping that transforms nonzero-offset data to zero-offset. Unlike previous schemes that approximately handle vertical velocity variation, this method makes no assumptions about the offset, dip, velocity function, or hyperbolic moveout.Tests using both synthetic and recorded seismic data demonstrate the effectiveness of this variable-velocity DMO. These tests show this method accurately handles vertical velocity variation, while use of constant-velocity DMO can lead to significant errors. Comparing this technique to a formulation that approximately handles velocity variation, however, suggests that the improved accuracy of the exact technique may not be justified because of uncertainty in the velocity model and increased cost.While improved accuracy alone may not justify the use of this method in 2-D, its flexibility may in other cases. Changes could be made to handle 3-D DMO, DMO for mode-converted waves, DMO in anisotropic media, or prestack divergence correction.