We present the results of a spectral and temporal study of the complete set of BeppoSAX NFI (11) and WFC (71) observations of the BL Lac object Mkn 501. The WFC 2-28 keV data, reported here for the first time, were collected over a period of about five years, from September 1996 to October 2001. These observations, although not evenly distributed, show that Mkn 501, after going through a very active phase from spring 1997 to early 1999, remained in a low brightness state until late 2001. The data from the LECS, MECS and PDS instruments, covering the wide energy interval 0.1-150 keV, have been used to study in detail the spectral variability of the source. We show that the X-ray energy distribution of Mkn 501 is well described by a log-parabolic law in all luminosity states. This model allowed us to obtain good estimates of the SED synchrotron peak energy and of its associated power. The strong spectral variability observed, consisting of strictly correlated changes between the synchrotron peak energy and bolometric flux, suggests that the main physical changes are not only due to variations of the maximum Lorentz factor of the emitting particles but that other quantities must be varying as well. During the 1997 flare the high energy part of the spectrum of Mkn 501 shows evidence of an excess above the best fit log-parabolic law suggesting the existence of a second emission component that may be responsible for most of the observed variability.