Abstract The present study is a numerical investigation of the hydrodynamic effects of passive flexibility on a self-propelled plunging foil. In the model problem, the flow is two-dimensional, incompressible and laminar, while the flexible foil is treated as an inextensible filament. The leading-edge of the foil undergoes a prescribed harmonic oscillation in the vertical direction. In the horizontal direction, the foil is free to move and no constraint is imposed. The simulations are performed by using a solver which couples the immersed boundary method for the flow and the finite difference method for the structure. A systematic parametric study has been conducted to investigate the effects of flexibility on important physical quantities such as the cruising speed, swimming power and propulsive efficiency. It is found that optimal cruising speed is always achieved in foils with some passive flexibility and not the rigid ones. Another important finding is that optimum performance is always achieved at a forcing frequency much lower than the resonance point. Based on the simulation results, three dynamical states of a self-propelled foil have been identified with the increase of bending rigidity, i.e., non-periodic movement, periodic backward-movement and periodic forward-movement. For a flexible foil in forward movement, depending on the range of bending rigidity, either a deflected or a symmetric vortex street arises as the characteristic wake structure. It is found that moderate flexibility is beneficial to symmetry preservation in the wake, while excessive flexibility can trigger symmetry-breaking. The results obtained in the current work shed some light on the role of flexibility in flapping-based biolocomotion.