We have investigated the structural, mechanical and lattice dynamical properties of ZrW2 and HfW2 compounds in cubic C15 (space group Fd-3m), hexagonal C14 (space group P6(3)/mmc) and C36 (space group P6(3)/mmc) phases using generalized gradient approximation within the plane-wave pseudo-potential density functional theory. We have found that ZrW2 and HfW2 in cubic C15 phase are the most stable among the considered phases. From calculated elastic constants, it is shown that all phases are mechanically stable according to the elastic stability criteria. The related mechanical properties, such as bulk, shear and Young moduli, Poisson's ratio, Debye temperature and hardness have been also calculated. The results show that ZrW2 and HfW2 compounds are ductile in nature with respect to the B/G and Cauchy pressure analysis. The phonon dispersion curves, phonon density of states and some thermodynamic properties are computed and discussed exhaustively for considered phases.