We have investigated the structural parameters (the lattice constants and bond length) and phonon dispersion relations in XB2 (X = Hf, Ta) compounds using the first-principles total energy calculations. The generalized gradient approximations are used to model exchange-correlation effects. Our secondary results on the temperature-dependent behavior of thermodynamical properties such as entropy, heat capacity, internal energy, and free energy are also presented for the same compounds. The obtained results are in good agreement with the available experimental and other theoretical data. (C) 2009 Elsevier B.V. All rights reserved.