The crystal structure, electronic properties, mechanical properties, and anisotropy of XB2 (X=V, Nb, Ta, Cr, Mo, and W) were calculated by first principles calculations based on density functional theory (DFT) with the generalized gradient approximation (GGA). The results are in good agreement with available theoretical and experimental values. The calculated cohesive energy and formation enthalpy indicate that they are thermodynamically stable structures. The elastic constants satisfy all of the mechanical stability criteria. The mechanical moduli were predicted by the Voigt–Reuss–Hill approximation. The mechanical anisotropy was indicated by the surface constructions of Young's moduli, and the results show that anisotropy of WB2 is stronger than others. The electronic structure indicates that the bonding behaviors of XB2 (X=V, Nb, Ta, Cr, Mo, and W) are the combinations of covalent and metallic bonds. The hardness of the borides was also evaluated, and the result reveals that TaB2 is the hardest compound among them.