An entropy method has been proposed for calculating magnetic heat capacity Cm of rare-earth diborides on their thermal expansion data. It was found that the temperature changes of magnetic entropy ΔSm(T) calculated from calorimetric data correlate with the magnetic components of lattice parameters Δam(T) and Δcm(T) calculated from X-ray diffraction data. Using this correlation, a formula for Cm(T) has been derived. Calculations of Cm(T) for TbB2, DyB2, HoB2, and ErB2 have been carried out. The temperature dependencies Cm(T) obtained from X-ray diffraction data are in a good agreement with the calorimetric data.