The numerical study on the power extraction performance of a flapping foil with a flexible tail is performed in this work. A NACA0015 airfoil is arranged in a two-dimensional laminar flow and imposed with a synchronous harmonic plunge and pitch rotary motion. A flat plate that is attached to the trailing edge of the foil is utilized to model a tail, and so they are viewed as a whole for the purpose of power extraction. In addition, the tail either is rigid or can deform due to the exerted hydrodynamic forces. To implement numerical simulations, an immersed boundary-lattice Boltzmann method is employed. At a Reynolds number of 1100 and the position of the pitching axis at third chord, the influences of the mass and flexibility of the tail as well as the frequency of motion on the power extraction are systematically examined. It is found that compared to the foil with a rigid tail, the efficiency of power extraction for the foil with a deformable tail can be improved. Based on the numerical analysis, it is indicated that the enhanced plunging component of the power extraction, which is caused by the increased lift force, directly contributes to the efficiency improvement. Since a flexible tail with medium and high masses is not beneficial to the efficiency improvement, a flexible tail with low mass together with high flexibility is recommended in the flapping foil based power extraction system.