The first-principles calculations are performed to investigate the mechanical properties and electronic structure of TiC, Ti0.75W0.25C, Ti0.75W0.25C0.75N0.25, TiC0.75N0.25 and TiN. Density functional theory and ultrasoft pseudopotentials are used in this study. From the formation energy, it is found that nitrogen can increase the stability of TiC. The calculated elastic constants and elastic moduli of TiC compare favorably with other theoretical and experimental values. Tungsten and nitrogen are observed to significantly increase the bulk, shear and Young's modulus of TiC. Through the analysis of BIG and Cauchy pressure, tungsten can significantly improve the ductility of TiC. The electronic structure of TiC, TiN, Ti0.75W0.25C, Ti0.75W0.25C0.75N0.25, and TiC0.75N0.25 are used to describe nonmetal-metal and metal-metal bonds. Based on the Mulliken overlap population analysis, the hardness values of TiC, Ti0.75W0.25C, Ti0.75W0.25C0.75N0.25, TiC0.75N0.25 and TiN are estimated. (C) 2012 Elsevier B.V. All rights reserved.