An experimental study was conducted to explore the effect of surface flexibility at the leading and trailing edges on the near-wake flow dynamics of a sinusoidal heaving foil. Midspan particle image velocimetry (PIV) measurements were taken in a closed-loop wind tunnel at a Reynolds number of 25,000 and at a range of reduced frequencies (k = fc/U) from 0.09 to 0.20. Time-resolved and phase-locked measurements are used to describe the mean flow characteristics and phase-averaged vortex structures and their evolution. Large-eddy scale (LES) decomposition and swirling strength analysis are used to quantify the vortical structures. The results demonstrate that trailing edge flexibility has minimal influence on the mean flow characteristics. The mean velocity deficit for the flexible trailing edge and rigid foils remains constant for all reduced frequencies tested. However, the trailing edge flexibility increases the swirling strength of the small-scale structures, resulting in enhanced cross-stream dispersion. Flexibility at the leading edge is shown to generate a large-scale leading edge vortex (LEV) for k ≥ 0.18. This results in a reduction in the swirling strength due to vortex interactions when compared to the flexible trailing edge and rigid foils. Furthermore, it is shown that the large-scale LEV is responsible for extracting a significant portion of energy from the mean flow, reducing the mean flow momentum in the wake. The kinetic energy loss in the wake is shown to scale with the energy content of the LEV.