Fish-like undulating body was proposed as an efficient propulsion system, and various mechanisms of thrust generation in this type of propulsion are found in the literature—separately for undulating and pitching fishes/foil. The present work proposes a unified study for undulating and pitching foil, by varying wavelength l (from 0.8 to 8.0) of a wave traveling backwards over the NACA0012 hydrofoil in a free-stream flow; the larger wavelength is shown to lead to the transition from the undulating motion to pitching motion. The effect ofwavelength of undulation is studied numerically at a Reynolds number Re=4000, maximum amplitude of undulation Amax 0:1 and non-dimensional frequency of undulation St=0:4, using level-set immersedboundary-method based in-house 2D code. The Navier–Stokes equation governing the fluid flow is solved using a fully implicit finite-volume method, while level-set equation governing the movement of the hydrofoil is solved using an explicit finite-difference method. It is presented here that the thrust generation mechanism for the low wavelength case undulating (l=0.8) foil is different from the mechanism for the high wavelength pitching foil. With increasing wavelength, mean thrust coefficient of the undulating foil increases and asymptotes to value for the pure pitching foil. Furthermore, the ratio of maximum thrust coefficient to maximum lateral force coefficient is found to be larger for the smaller wavelength undulating foil as compared with the larger wavelength pitching foil.