A functional of the quantities describing the macroscopic equilibrium of a magnetized plasma is defined, which has the meaning of the entropy and is constructed by a direct calculation of the probability of the distributions of the current density in a coarse-grained configuration space, under suitable constraints. The entropy law is applied to the derivation of the stability properties of the force-free states, with respect both to the resistive and to the ideal MHD disturbances.