We study the perturbative stability of magnetic black holes in a general class of nonlinear electrodynamics, where the Lagrangian is given by a general function of the field strength of electromagnetic field F μν and its Hodge dualF μν . We derive sufficient conditions for the stability of the black holes. We apply the stability conditions to Bardeen's regular black holes, black holes in Euler-Heisenberg theory, and black holes in Born-Infeld theory. As a result, we obtain a sufficient condition for the stability of Bardeen's black holes, which restricts F μνF μν dependence of the Lagrangian. We also show that black holes in Euler-Heisenberg theory are stable for a sufficiently small magnetic charge. Moreover, we prove the stability of black holes in the Born-Infeld electrodynamics even when including F μνF μν dependence.