A binary modified harmony search algorithm is proposed to solve the 0-1 knapsack problem(KP). In the algorithm, the improvisation process is modified and the parameter PAR is adjusted dynamically, as well as a stochastic repair operator is developed to effectively repair infeasible harmony and enhance local search. Besides, a feasible harmony initialization method is used to guarantee initial harmony feasible. The 0-1 binary model is completely used in the whole search process. Fourteen 0-1 knapsack problems are tested. The proposed algorithm is compared with other algorithms, and the statistical results demonstrate the effectiveness of the proposed algorithm.