The effect of in-plane lattice strain on the atomic and electronic properties of low-index transition metal (M=Ti, Nb, and Ta) carbide surfaces is studied by first-principles molecular dynamics calculations using a pseudopotential plane-wave technique. The most stable cubic rock-salt phase is considered for carbides. The first-principle study of various [(001), (110), and metal-terminated (111)] carbide surfaces reveals that both compressive and tensile strains strongly affect surface relaxation and electronic properties (work function values and band structures). The most stable (001) carbide surfaces exhibit rumpling between transition metal and carbon atoms in the topmost surface layers, which depends on the applied strain. The work function (WF) for the metal-terminated (111) surfaces varies monotonically, rather strongly depending on the applied strain (the range of variation reaches about 1 eV), while the WF for the (001) surface varies nonmonotonically with a much smaller resulting variation over the wide range of the applied strains. Surface energy calculations show that surface stability is also governed by the applied strain.